mirror of
https://github.com/RPCSX/llvm.git
synced 2025-01-30 00:32:53 +00:00
MetadataLoader: Add an assertion for the implicit invariant of PlaceHolder while loading Metadata (NFC)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@290408 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
4408314ccf
commit
b1c75432e5
@ -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…
x
Reference in New Issue
Block a user