[Bitcode] Move x86_intrcc upgrade to bitcode reader
This upgrade requires access the legacy pointer element type, so it needs to happen inside the bitcode reader.
This commit is contained in:
@@ -3601,6 +3601,16 @@ Error BitcodeReader::parseFunctionRecord(ArrayRef<uint64_t> Record) {
|
||||
}
|
||||
}
|
||||
|
||||
if (Func->getCallingConv() == CallingConv::X86_INTR &&
|
||||
!Func->arg_empty() && !Func->hasParamAttribute(0, Attribute::ByVal)) {
|
||||
unsigned ParamTypeID = getContainedTypeID(FTyID, 1);
|
||||
Type *ByValTy = getPtrElementTypeByID(ParamTypeID);
|
||||
if (!ByValTy)
|
||||
return error("Missing param element type for x86_intrcc upgrade");
|
||||
Attribute NewAttr = Attribute::getWithByValType(Context, ByValTy);
|
||||
Func->addParamAttr(0, NewAttr);
|
||||
}
|
||||
|
||||
MaybeAlign Alignment;
|
||||
if (Error Err = parseAlignmentValue(Record[5], Alignment))
|
||||
return Err;
|
||||
|
||||
Reference in New Issue
Block a user