IR: make getParamByValType Just Work. NFC.
Most parts of LLVM don't care whether the byval type is derived from an explicit Attribute or from the parameter's pointee type, so it makes sense for the main access function to just return the right value. The very few users who do care (only BitcodeReader so far) can find out how it's specified by accessing the Attribute directly. llvm-svn: 362642
This commit is contained in:
@@ -3049,7 +3049,8 @@ Error BitcodeReader::parseFunctionRecord(ArrayRef<uint64_t> Record) {
|
||||
// pointee type. There should be no opaque pointers where the byval type is
|
||||
// implicit.
|
||||
for (auto &Arg : Func->args()) {
|
||||
if (Arg.hasByValAttr() && !Arg.getParamByValType()) {
|
||||
if (Arg.hasByValAttr() &&
|
||||
!Arg.getAttribute(Attribute::ByVal).getValueAsType()) {
|
||||
Arg.removeAttr(Attribute::ByVal);
|
||||
Arg.addAttr(Attribute::getWithByValType(
|
||||
Context, Arg.getType()->getPointerElementType()));
|
||||
|
||||
Reference in New Issue
Block a user