diff options
| author | Benjamin Kramer <benny.kra@googlemail.com> | 2010-01-05 13:12:22 +0000 |
|---|---|---|
| committer | Benjamin Kramer <benny.kra@googlemail.com> | 2010-01-05 13:12:22 +0000 |
| commit | ccce8bae14a8539e7c9e8d694e2126dd30dc774f (patch) | |
| tree | 56fd200381c4089dabdb97ce70eb595db1ae7bd4 /llvm/lib/ExecutionEngine/ExecutionEngine.cpp | |
| parent | f22afe32f905c0b229d6e55e913e8584249747f3 (diff) | |
| download | llvm-ccce8bae14a8539e7c9e8d694e2126dd30dc774f.zip llvm-ccce8bae14a8539e7c9e8d694e2126dd30dc774f.tar.gz llvm-ccce8bae14a8539e7c9e8d694e2126dd30dc774f.tar.bz2 | |
Avoid going through the LLVMContext for type equality where it's safe to dereference the type pointer.
llvm-svn: 92726
Diffstat (limited to 'llvm/lib/ExecutionEngine/ExecutionEngine.cpp')
| -rw-r--r-- | llvm/lib/ExecutionEngine/ExecutionEngine.cpp | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/llvm/lib/ExecutionEngine/ExecutionEngine.cpp b/llvm/lib/ExecutionEngine/ExecutionEngine.cpp index 6a154cc..35e6922 100644 --- a/llvm/lib/ExecutionEngine/ExecutionEngine.cpp +++ b/llvm/lib/ExecutionEngine/ExecutionEngine.cpp @@ -343,9 +343,7 @@ int ExecutionEngine::runFunctionAsMain(Function *Fn, // Check main() type unsigned NumArgs = Fn->getFunctionType()->getNumParams(); const FunctionType *FTy = Fn->getFunctionType(); - const Type* PPInt8Ty = - PointerType::getUnqual(PointerType::getUnqual( - Type::getInt8Ty(Fn->getContext()))); + const Type* PPInt8Ty = Type::getInt8PtrTy(Fn->getContext())->getPointerTo(); switch (NumArgs) { case 3: if (FTy->getParamType(2) != PPInt8Ty) { @@ -364,7 +362,7 @@ int ExecutionEngine::runFunctionAsMain(Function *Fn, // FALLS THROUGH case 0: if (!isa<IntegerType>(FTy->getReturnType()) && - FTy->getReturnType() != Type::getVoidTy(FTy->getContext())) { + !FTy->getReturnType()->isVoidTy()) { llvm_report_error("Invalid return type of main() supplied"); } break; |
