From 6312a75dbaaf2d4c968cfa3322fc9df60621d4ee Mon Sep 17 00:00:00 2001 From: Nikita Popov Date: Tue, 20 Jul 2021 21:05:07 +0200 Subject: [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. --- llvm/lib/Bitcode/Reader/BitcodeReader.cpp | 2 ++ 1 file changed, 2 insertions(+) (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 42e17f0..e167792 100644 --- a/llvm/lib/Bitcode/Reader/BitcodeReader.cpp +++ b/llvm/lib/Bitcode/Reader/BitcodeReader.cpp @@ -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); } -- cgit v1.1