diff options
author | Nikita Popov <nikita.ppv@gmail.com> | 2020-04-30 18:45:04 +0200 |
---|---|---|
committer | Nikita Popov <nikita.ppv@gmail.com> | 2020-04-30 18:47:14 +0200 |
commit | 9fc0e7c1aaab29691bc628607d6e8701e522d7b6 (patch) | |
tree | a1a35bb360aa7992d39564ae3bce09fc30c7aca1 /llvm/lib/Bitcode/Reader/BitcodeReader.cpp | |
parent | a90948fd6e3bbac6ae63a34f52882e036b2dd032 (diff) | |
download | llvm-9fc0e7c1aaab29691bc628607d6e8701e522d7b6.zip llvm-9fc0e7c1aaab29691bc628607d6e8701e522d7b6.tar.gz llvm-9fc0e7c1aaab29691bc628607d6e8701e522d7b6.tar.bz2 |
[BitcodeReader] Simplify raw attribute handling (NFC)
Every new attribute we add from now on will not be supported in the
raw format, because we ran out of space. Don't bother listing each
affected attribute twice.
Diffstat (limited to 'llvm/lib/Bitcode/Reader/BitcodeReader.cpp')
-rw-r--r-- | llvm/lib/Bitcode/Reader/BitcodeReader.cpp | 31 |
1 files changed, 4 insertions, 27 deletions
diff --git a/llvm/lib/Bitcode/Reader/BitcodeReader.cpp b/llvm/lib/Bitcode/Reader/BitcodeReader.cpp index 9bdac5c4..f36dab3 100644 --- a/llvm/lib/Bitcode/Reader/BitcodeReader.cpp +++ b/llvm/lib/Bitcode/Reader/BitcodeReader.cpp @@ -1284,28 +1284,10 @@ static uint64_t getRawAttributeMask(Attribute::AttrKind Val) { return 1ULL << 62; case Attribute::NoFree: return 1ULL << 63; - case Attribute::NoSync: - llvm_unreachable("nosync attribute not supported in raw format"); - break; - case Attribute::Dereferenceable: - llvm_unreachable("dereferenceable attribute not supported in raw format"); - break; - case Attribute::DereferenceableOrNull: - llvm_unreachable("dereferenceable_or_null attribute not supported in raw " - "format"); - break; - case Attribute::ArgMemOnly: - llvm_unreachable("argmemonly attribute not supported in raw format"); - break; - case Attribute::AllocSize: - llvm_unreachable("allocsize not supported in raw format"); - break; - case Attribute::SanitizeMemTag: - llvm_unreachable("sanitize_memtag attribute not supported in raw format"); - break; - case Attribute::Preallocated: - llvm_unreachable("preallocated attribute not supported in raw format"); - break; + default: + // Other attributes are not supported in the raw format, + // as we ran out of space. + return 0; } llvm_unreachable("Unsupported attribute type"); } @@ -1315,11 +1297,6 @@ static void addRawAttributeValue(AttrBuilder &B, uint64_t Val) { for (Attribute::AttrKind I = Attribute::None; I != Attribute::EndAttrKinds; I = Attribute::AttrKind(I + 1)) { - if (I == Attribute::SanitizeMemTag || I == Attribute::Dereferenceable || - I == Attribute::DereferenceableOrNull || I == Attribute::ArgMemOnly || - I == Attribute::AllocSize || I == Attribute::NoSync || - I == Attribute::Preallocated) - continue; if (uint64_t A = (Val & getRawAttributeMask(I))) { if (I == Attribute::Alignment) B.addAlignmentAttr(1ULL << ((A >> 16) - 1)); |