From 4ae0ab095bf97123c2d2a6aa2e82dcc25cf040f1 Mon Sep 17 00:00:00 2001 From: Nathan Chancellor Date: Sun, 27 Jun 2021 11:59:57 -0700 Subject: [BitCode] Add noprofile to getAttrFromCode() After D104475 / D104658, building the Linux kernel with ThinLTO is broken: ld.lld: error: Unknown attribute kind (73) (Producer: 'LLVM13.0.0git' Reader: 'LLVM 13.0.0git') getAttrFromCode() has never handled this attribute so it is written during the ThinLTO phase but it cannot be handled during the linking phase. Add noprofile to getAttrFromCode() so that disassembly works properly. Reviewed By: MaskRay Differential Revision: https://reviews.llvm.org/D104995 --- 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 7deb193..8f8bd73 100644 --- a/llvm/lib/Bitcode/Reader/BitcodeReader.cpp +++ b/llvm/lib/Bitcode/Reader/BitcodeReader.cpp @@ -1439,6 +1439,8 @@ static Attribute::AttrKind getAttrFromCode(uint64_t Code) { return Attribute::NoSync; case bitc::ATTR_KIND_NOCF_CHECK: return Attribute::NoCfCheck; + case bitc::ATTR_KIND_NO_PROFILE: + return Attribute::NoProfile; case bitc::ATTR_KIND_NO_UNWIND: return Attribute::NoUnwind; case bitc::ATTR_KIND_NO_SANITIZE_COVERAGE: -- cgit v1.1