class BitcodeReaderMDValueList {
unsigned NumFwdRefs;
bool AnyFwdRefs;
- bool SavedFwdRefs;
unsigned MinFwdRef;
unsigned MaxFwdRef;
std::vector<TrackingMDRef> MDValuePtrs;
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(); }
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];
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();
continue;
}
MDValueToValIDMap[MD] = ValID;
- // Flag that we saved the forward refs (temporary metadata) for error
- // checking during MDValueList destruction.
- if (OnlyTempMD)
- MDValueList.savedFwdRefs();
}
}
}