[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.
This commit is contained in:
Nikita Popov
2021-07-20 21:05:07 +02:00
parent a7f183afe7
commit 6312a75dba

View File

@@ -1280,6 +1280,8 @@ static void addRawAttributeValue(AttrBuilder &B, uint64_t Val) {
B.addAlignmentAttr(1ULL << ((A >> 16) - 1));
else if (I == Attribute::StackAlignment)
B.addStackAlignmentAttr(1ULL << ((A >> 26)-1));
else if (Attribute::isTypeAttrKind(I))
B.addTypeAttr(I, nullptr); // Type will be auto-upgraded.
else
B.addAttribute(I);
}