diff options
author | Arthur Eubanks <aeubanks@google.com> | 2021-06-29 11:38:18 -0700 |
---|---|---|
committer | Arthur Eubanks <aeubanks@google.com> | 2021-06-29 14:47:29 -0700 |
commit | cb3580e7ad247dfdcf2ad279895f52bb73c4cee4 (patch) | |
tree | b617f7749c9ce6ff7aa91bd54eeb90cb4d58ae48 /llvm/lib/Bitcode/Writer/ValueEnumerator.cpp | |
parent | b810600a93a1f426389ffe93c609af9b659a8430 (diff) | |
download | llvm-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/Writer/ValueEnumerator.cpp')
-rw-r--r-- | llvm/lib/Bitcode/Writer/ValueEnumerator.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/llvm/lib/Bitcode/Writer/ValueEnumerator.cpp b/llvm/lib/Bitcode/Writer/ValueEnumerator.cpp index 2be3ca7..d86db61 100644 --- a/llvm/lib/Bitcode/Writer/ValueEnumerator.cpp +++ b/llvm/lib/Bitcode/Writer/ValueEnumerator.cpp @@ -1045,6 +1045,11 @@ void ValueEnumerator::EnumerateAttributes(AttributeList PAL) { if (Entry == 0) { AttributeGroups.push_back(Pair); Entry = AttributeGroups.size(); + + for (Attribute Attr : AS) { + if (Attr.isTypeAttribute()) + EnumerateType(Attr.getValueAsType()); + } } } } |