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
This commit is contained in:
Teresa Johnson 2015-12-21 15:38:13 +00:00
parent 35733957df
commit 6cfd049a12

View File

@ -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();
}
}
}