summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--llvm/lib/IR/Verifier.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/llvm/lib/IR/Verifier.cpp b/llvm/lib/IR/Verifier.cpp
index d42ca31b5aa..05600155a8c 100644
--- a/llvm/lib/IR/Verifier.cpp
+++ b/llvm/lib/IR/Verifier.cpp
@@ -1176,6 +1176,10 @@ void Verifier::visitBasicBlock(BasicBlock &BB) {
}
}
}
+
+ // Check that all instructions have their parent pointers set up correctly.
+ for (auto &I: BB)
+ Assert(I.getParent() == &BB, "Instruction has bogus parent pointer!");
}
void Verifier::visitTerminatorInst(TerminatorInst &I) {
OpenPOWER on IntegriCloud