diff options
author | Teresa Johnson <tejohnson@google.com> | 2015-12-21 15:38:13 +0000 |
---|---|---|
committer | Teresa Johnson <tejohnson@google.com> | 2015-12-21 15:38:13 +0000 |
commit | 6cfd049a121d734fcf466dc2c2066f13c9caeb54 (patch) | |
tree | f6e7da3f9d48004f38ac7dacca027c1050ca59f9 | |
parent | 35733957dfcbcde0ba74357b7673165edae944f1 (diff) |
Remove overly strict new assert in BitcodeReader.
This fixes a bug introduced by the ThinLTO metadata linking patch
r255909. The assert is overly-strict and while useful in development of
the patch, doesn't seem interesting to keep.
Fixes PR25907.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@256161 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | lib/Bitcode/Reader/BitcodeReader.cpp | 17 |
1 files changed, 1 insertions, 16 deletions
diff --git a/lib/Bitcode/Reader/BitcodeReader.cpp b/lib/Bitcode/Reader/BitcodeReader.cpp index 7872a7b5849..dd898a7f322 100644 --- a/lib/Bitcode/Reader/BitcodeReader.cpp +++ b/lib/Bitcode/Reader/BitcodeReader.cpp @@ -97,7 +97,6 @@ public: class BitcodeReaderMDValueList { unsigned NumFwdRefs; bool AnyFwdRefs; - bool SavedFwdRefs; unsigned MinFwdRef; unsigned MaxFwdRef; std::vector<TrackingMDRef> MDValuePtrs; @@ -105,12 +104,7 @@ class BitcodeReaderMDValueList { LLVMContext &Context; public: BitcodeReaderMDValueList(LLVMContext &C) - : NumFwdRefs(0), AnyFwdRefs(false), SavedFwdRefs(false), Context(C) {} - ~BitcodeReaderMDValueList() { - // Assert that we either replaced all forward references, or saved - // them for later replacement. - assert(!NumFwdRefs || SavedFwdRefs); - } + : NumFwdRefs(0), AnyFwdRefs(false), Context(C) {} // vector compatibility methods unsigned size() const { return MDValuePtrs.size(); } @@ -121,8 +115,6 @@ public: void pop_back() { MDValuePtrs.pop_back(); } bool empty() const { return MDValuePtrs.empty(); } - void savedFwdRefs() { SavedFwdRefs = true; } - Metadata *operator[](unsigned i) const { assert(i < MDValuePtrs.size()); return MDValuePtrs[i]; @@ -1080,9 +1072,6 @@ Metadata *BitcodeReaderMDValueList::getValueFwdRef(unsigned Idx) { MinFwdRef = MaxFwdRef = Idx; } ++NumFwdRefs; - // Reset flag to ensure that we save this forward reference if we - // are delaying metadata mapping (e.g. for function importing). - SavedFwdRefs = false; // Create and return a placeholder, which will later be RAUW'd. Metadata *MD = MDNode::getTemporary(Context, None).release(); @@ -3089,10 +3078,6 @@ void BitcodeReader::saveMDValueList( continue; } MDValueToValIDMap[MD] = ValID; - // Flag that we saved the forward refs (temporary metadata) for error - // checking during MDValueList destruction. - if (OnlyTempMD) - MDValueList.savedFwdRefs(); } } } |