mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-25 16:24:23 +00:00
Fix Intrinsic::getType not working with vararg
VarArg Intrinsic functions are encoded with "void" type as the last argument. Now Intrinsic::getType can correctly return all the intrinsic function type. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@220205 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@ -739,6 +739,12 @@ FunctionType *Intrinsic::getType(LLVMContext &Context,
|
|||||||
while (!TableRef.empty())
|
while (!TableRef.empty())
|
||||||
ArgTys.push_back(DecodeFixedType(TableRef, Tys, Context));
|
ArgTys.push_back(DecodeFixedType(TableRef, Tys, Context));
|
||||||
|
|
||||||
|
// DecodeFixedType returns Void for IITDescriptor::Void and IITDescriptor::VarArg
|
||||||
|
// If we see void type as the type of the last argument, it is vararg intrinsic
|
||||||
|
if (!ArgTys.empty() && ArgTys.back()->isVoidTy()) {
|
||||||
|
ArgTys.pop_back();
|
||||||
|
return FunctionType::get(ResultTy, ArgTys, true);
|
||||||
|
}
|
||||||
return FunctionType::get(ResultTy, ArgTys, false);
|
return FunctionType::get(ResultTy, ArgTys, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user