mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-07-29 10:25:12 +00:00
The transform that tries to turn calls to bitcast functions into
direct calls bails out unless caller and callee have essentially equivalent parameter attributes. This is illogical - the callee's attributes should be of no relevance here. Rework the logic, which incidentally fixes a crash when removed arguments have attributes. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45658 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -418,22 +418,10 @@ void Verifier::VerifyParamAttrs(const FunctionType *FT,
|
||||
Attrs->getParamAttrsText(MutI) + "are incompatible!", V);
|
||||
}
|
||||
|
||||
uint16_t IType = Attr & ParamAttr::IntegerTypeOnly;
|
||||
Assert1(!IType || FT->getParamType(Idx-1)->isInteger(),
|
||||
"Attribute " + Attrs->getParamAttrsText(IType) +
|
||||
"should only apply to Integer type!", V);
|
||||
|
||||
uint16_t PType = Attr & ParamAttr::PointerTypeOnly;
|
||||
Assert1(!PType || isa<PointerType>(FT->getParamType(Idx-1)),
|
||||
"Attribute " + Attrs->getParamAttrsText(PType) +
|
||||
"should only apply to Pointer type!", V);
|
||||
|
||||
if (Attr & ParamAttr::ByVal) {
|
||||
const PointerType *Ty =
|
||||
dyn_cast<PointerType>(FT->getParamType(Idx-1));
|
||||
Assert1(!Ty || isa<StructType>(Ty->getElementType()),
|
||||
"Attribute byval should only apply to pointer to structs!", V);
|
||||
}
|
||||
uint16_t IType = ParamAttr::incompatibleWithType(FT->getParamType(Idx-1),
|
||||
Attr);
|
||||
Assert1(!IType, "Wrong type for attribute " +
|
||||
Attrs->getParamAttrsText(IType), V);
|
||||
|
||||
if (Attr & ParamAttr::Nest) {
|
||||
Assert1(!SawNest, "More than one parameter has attribute nest!", V);
|
||||
|
Reference in New Issue
Block a user