diff options
author | Jonas Devlieghere <jonas@devlieghere.com> | 2021-07-02 15:45:15 -0700 |
---|---|---|
committer | Jonas Devlieghere <jonas@devlieghere.com> | 2021-07-02 15:57:07 -0700 |
commit | 52b5491a212a78e93e869b43ec325ddbd8832784 (patch) | |
tree | bc2c7cbea7013a4295971c02826e8d5f9071e099 /llvm/lib/Bitcode/Writer/BitcodeWriter.cpp | |
parent | b8a021dbe322c4fae196318df7c0ebb2dd0f4a31 (diff) | |
download | llvm-52b5491a212a78e93e869b43ec325ddbd8832784.zip llvm-52b5491a212a78e93e869b43ec325ddbd8832784.tar.gz llvm-52b5491a212a78e93e869b43ec325ddbd8832784.tar.bz2 |
Revert "[DebugInfo] Enforce implicit constraints on `distinct` MDNodes"
This reverts commit 8cd35ad854ab4458fd509447359066ea3578b494.
It breaks `TestMembersAndLocalsWithSameName.py` on GreenDragon and
Mikael Holmén points out in D104827 that bitcode files created with the
patch cannot be parsed with binaries built before it.
Diffstat (limited to 'llvm/lib/Bitcode/Writer/BitcodeWriter.cpp')
-rw-r--r-- | llvm/lib/Bitcode/Writer/BitcodeWriter.cpp | 17 |
1 files changed, 2 insertions, 15 deletions
diff --git a/llvm/lib/Bitcode/Writer/BitcodeWriter.cpp b/llvm/lib/Bitcode/Writer/BitcodeWriter.cpp index 1ad55e2..bdb973e 100644 --- a/llvm/lib/Bitcode/Writer/BitcodeWriter.cpp +++ b/llvm/lib/Bitcode/Writer/BitcodeWriter.cpp @@ -1758,6 +1758,7 @@ void ModuleBitcodeWriter::writeDIFile(const DIFile *N, void ModuleBitcodeWriter::writeDICompileUnit(const DICompileUnit *N, SmallVectorImpl<uint64_t> &Record, unsigned Abbrev) { + assert(N->isDistinct() && "Expected distinct compile units"); Record.push_back(/* IsDistinct */ true); Record.push_back(N->getSourceLanguage()); Record.push_back(VE.getMetadataOrNullID(N->getFile())); @@ -2008,7 +2009,7 @@ void ModuleBitcodeWriter::writeDIExpression(const DIExpression *N, SmallVectorImpl<uint64_t> &Record, unsigned Abbrev) { Record.reserve(N->getElements().size() + 1); - const uint64_t Version = 4 << 1; + const uint64_t Version = 3 << 1; Record.push_back((uint64_t)N->isDistinct() | Version); Record.append(N->elements_begin(), N->elements_end()); @@ -2153,20 +2154,6 @@ void ModuleBitcodeWriter::writeMetadataRecords( if (const MDNode *N = dyn_cast<MDNode>(MD)) { assert(N->isResolved() && "Expected forward references to be resolved"); -#ifndef NDEBUG - switch (N->getMetadataID()) { -#define HANDLE_MDNODE_LEAF_UNIQUED(CLASS) \ - case Metadata::CLASS##Kind: \ - assert(!N->isDistinct() && "Expected non-distinct " #CLASS); \ - break; -#define HANDLE_MDNODE_LEAF_DISTINCT(CLASS) \ - case Metadata::CLASS##Kind: \ - assert(N->isDistinct() && "Expected distinct " #CLASS); \ - break; -#include "llvm/IR/Metadata.def" - } -#endif - switch (N->getMetadataID()) { default: llvm_unreachable("Invalid MDNode subclass"); |