MetadataLoader: add an extra assertion in Placeholders flush (NFC)

We don't expect any forward reference at this point.

llvm-svn: 290506
This commit is contained in:
Mehdi Amini 2016-12-25 03:55:53 +00:00
parent 5ac3720620
commit 4f90ee0010
1 changed files with 3 additions and 3 deletions

View File

@ -374,12 +374,12 @@ DistinctMDOperandPlaceholder &PlaceholderQueue::getPlaceholderOp(unsigned ID) {
void PlaceholderQueue::flush(BitcodeReaderMetadataList &MetadataList) {
while (!PHs.empty()) {
auto *MD = MetadataList.getMetadataFwdRef(PHs.front().getID());
auto *MD = MetadataList.lookup(PHs.front().getID());
assert(MD && "Flushing placeholder on unassigned MD");
#ifndef NDEBUG
if (auto MDN = dyn_cast<MDNode>(MD)) {
if (auto *MDN = dyn_cast<MDNode>(MD))
assert(MDN->isResolved() &&
"Flushing Placeholder while cycles aren't resolved");
}
#endif
PHs.front().replaceUseWith(MD);
PHs.pop_front();