mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-12 13:38:21 +00:00
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
This commit is contained in:
@ -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;
|
||||
|
Reference in New Issue
Block a user