Skip to content

Commit 6312a75

Browse files
committed
[BitcodeReader] Handle type attributes more explicitly (NFCI)
For attributes in legacy bitcode that are now typed, explicitly create a type attribute with nullptr type, the same as we do for the attribute group representation. This is so we can assert use of the correct constructor in the future.
1 parent a7f183a commit 6312a75

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

llvm/lib/Bitcode/Reader/BitcodeReader.cpp

+2
Original file line numberDiff line numberDiff line change
@@ -1280,6 +1280,8 @@ static void addRawAttributeValue(AttrBuilder &B, uint64_t Val) {
12801280
B.addAlignmentAttr(1ULL << ((A >> 16) - 1));
12811281
else if (I == Attribute::StackAlignment)
12821282
B.addStackAlignmentAttr(1ULL << ((A >> 26)-1));
1283+
else if (Attribute::isTypeAttrKind(I))
1284+
B.addTypeAttr(I, nullptr); // Type will be auto-upgraded.
12831285
else
12841286
B.addAttribute(I);
12851287
}

0 commit comments

Comments
 (0)