forked from OSchip/llvm-project
MetadataLoader: Add an assertion for the implicit invariant of PlaceHolder while loading Metadata (NFC)
llvm-svn: 290408
This commit is contained in:
parent
70a9cd4cbe
commit
5ae6170fc2
|
@ -372,8 +372,14 @@ DistinctMDOperandPlaceholder &PlaceholderQueue::getPlaceholderOp(unsigned ID) {
|
|||
|
||||
void PlaceholderQueue::flush(BitcodeReaderMetadataList &MetadataList) {
|
||||
while (!PHs.empty()) {
|
||||
PHs.front().replaceUseWith(
|
||||
MetadataList.getMetadataFwdRef(PHs.front().getID()));
|
||||
auto *MD = MetadataList.getMetadataFwdRef(PHs.front().getID());
|
||||
#ifndef NDEBUG
|
||||
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