From 607c8a9d1481312acb421425ac8c8df56a0c9012 Mon Sep 17 00:00:00 2001 From: Tim Northover Date: Wed, 5 Jun 2019 20:37:47 +0000 Subject: 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 --- llvm/lib/Bitcode/Reader/BitcodeReader.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'llvm/lib/Bitcode/Reader/BitcodeReader.cpp') diff --git a/llvm/lib/Bitcode/Reader/BitcodeReader.cpp b/llvm/lib/Bitcode/Reader/BitcodeReader.cpp index 9f562ba..c33fc56 100644 --- a/llvm/lib/Bitcode/Reader/BitcodeReader.cpp +++ b/llvm/lib/Bitcode/Reader/BitcodeReader.cpp @@ -3049,7 +3049,8 @@ Error BitcodeReader::parseFunctionRecord(ArrayRef 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())); -- cgit v1.1