summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Bitcode/Reader/MetadataLoader.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/lib/Bitcode/Reader/MetadataLoader.cpp')
-rw-r--r--llvm/lib/Bitcode/Reader/MetadataLoader.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/llvm/lib/Bitcode/Reader/MetadataLoader.cpp b/llvm/lib/Bitcode/Reader/MetadataLoader.cpp
index 9d53caffd91..8cec349af30 100644
--- a/llvm/lib/Bitcode/Reader/MetadataLoader.cpp
+++ b/llvm/lib/Bitcode/Reader/MetadataLoader.cpp
@@ -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();
OpenPOWER on IntegriCloud