aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Bitcode/Reader/BitcodeReader.cpp
diff options
context:
space:
mode:
authorArthur Eubanks <aeubanks@google.com>2021-06-29 11:38:18 -0700
committerArthur Eubanks <aeubanks@google.com>2021-06-29 14:47:29 -0700
commitcb3580e7ad247dfdcf2ad279895f52bb73c4cee4 (patch)
treeb617f7749c9ce6ff7aa91bd54eeb90cb4d58ae48 /llvm/lib/Bitcode/Reader/BitcodeReader.cpp
parentb810600a93a1f426389ffe93c609af9b659a8430 (diff)
downloadllvm-cb3580e7ad247dfdcf2ad279895f52bb73c4cee4.zip
llvm-cb3580e7ad247dfdcf2ad279895f52bb73c4cee4.tar.gz
llvm-cb3580e7ad247dfdcf2ad279895f52bb73c4cee4.tar.bz2
[OpaquePtr][BitcodeWriter] Handle attributes with types
For example, byval. Skip the type attribute auto-upgrade if we already have the type. I've actually seen this error of the ValueEnumerator missing a type attribute's type in a non-opaque pointer context. Reviewed By: nikic Differential Revision: https://reviews.llvm.org/D105138
Diffstat (limited to 'llvm/lib/Bitcode/Reader/BitcodeReader.cpp')
-rw-r--r--llvm/lib/Bitcode/Reader/BitcodeReader.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/llvm/lib/Bitcode/Reader/BitcodeReader.cpp b/llvm/lib/Bitcode/Reader/BitcodeReader.cpp
index 8f8bd73..854243e 100644
--- a/llvm/lib/Bitcode/Reader/BitcodeReader.cpp
+++ b/llvm/lib/Bitcode/Reader/BitcodeReader.cpp
@@ -3333,6 +3333,9 @@ Error BitcodeReader::parseFunctionRecord(ArrayRef<uint64_t> Record) {
if (!Func->hasParamAttribute(i, Kind))
continue;
+ if (Func->getParamAttribute(i, Kind).getValueAsType())
+ continue;
+
Func->removeParamAttr(i, Kind);
Type *PTy = cast<FunctionType>(FTy)->getParamType(i);