summaryrefslogtreecommitdiffstats
path: root/lib/ExecutionEngine/JIT/JIT.cpp
diff options
context:
space:
mode:
authorBenjamin Kramer <benny.kra@googlemail.com>2010-01-05 13:12:22 +0000
committerBenjamin Kramer <benny.kra@googlemail.com>2010-01-05 13:12:22 +0000
commitf012705c7e4ca8cf90b6b734ce1d5355daca5ba5 (patch)
treed1bcdd1cfc5ddc28894a9b9d6cbb2875d922e437 /lib/ExecutionEngine/JIT/JIT.cpp
parent804272c8d6fd960c47c8cbc1603aba3fe5a65ea8 (diff)
downloadexternal_llvm-f012705c7e4ca8cf90b6b734ce1d5355daca5ba5.zip
external_llvm-f012705c7e4ca8cf90b6b734ce1d5355daca5ba5.tar.gz
external_llvm-f012705c7e4ca8cf90b6b734ce1d5355daca5ba5.tar.bz2
Avoid going through the LLVMContext for type equality where it's safe to dereference the type pointer.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92726 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/ExecutionEngine/JIT/JIT.cpp')
-rw-r--r--lib/ExecutionEngine/JIT/JIT.cpp5
1 files changed, 2 insertions, 3 deletions
diff --git a/lib/ExecutionEngine/JIT/JIT.cpp b/lib/ExecutionEngine/JIT/JIT.cpp
index ebc2567..3eafe5f 100644
--- a/lib/ExecutionEngine/JIT/JIT.cpp
+++ b/lib/ExecutionEngine/JIT/JIT.cpp
@@ -411,8 +411,7 @@ GenericValue JIT::runFunction(Function *F,
// Handle some common cases first. These cases correspond to common `main'
// prototypes.
- if (RetTy == Type::getInt32Ty(F->getContext()) ||
- RetTy == Type::getVoidTy(F->getContext())) {
+ if (RetTy == Type::getInt32Ty(F->getContext()) || RetTy->isVoidTy()) {
switch (ArgValues.size()) {
case 3:
if (FTy->getParamType(0) == Type::getInt32Ty(F->getContext()) &&
@@ -548,7 +547,7 @@ GenericValue JIT::runFunction(Function *F,
"", StubBB);
TheCall->setCallingConv(F->getCallingConv());
TheCall->setTailCall();
- if (TheCall->getType() != Type::getVoidTy(F->getContext()))
+ if (!TheCall->getType()->isVoidTy())
// Return result of the call.
ReturnInst::Create(F->getContext(), TheCall, StubBB);
else