forked from OSchip/llvm-project
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:
parent
5ac3720620
commit
4f90ee0010
|
@ -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();
|
||||
|
|
Loading…
Reference in New Issue