summaryrefslogtreecommitdiffstats
path: root/llvm/lib/VMCore/Verifier.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2004-04-16 05:51:47 +0000
committerChris Lattner <sabre@nondot.org>2004-04-16 05:51:47 +0000
commit0377e4384fcc8c39edebf3b0187b3a1f76e713f2 (patch)
tree5dd9347c3103df708fc57b04d36e62a769294410 /llvm/lib/VMCore/Verifier.cpp
parent82876bdb2a85a80bac84cece450ef891fc182f3e (diff)
downloadbcm5719-llvm-0377e4384fcc8c39edebf3b0187b3a1f76e713f2.tar.gz
bcm5719-llvm-0377e4384fcc8c39edebf3b0187b3a1f76e713f2.zip
Make sure to check for a very bad class of errors: an instruction
that does not dominate all of its users, but is in the same basic block as its users. This class of error is what caused the mysterious CBE only failures last night. llvm-svn: 12979
Diffstat (limited to 'llvm/lib/VMCore/Verifier.cpp')
-rw-r--r--llvm/lib/VMCore/Verifier.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/llvm/lib/VMCore/Verifier.cpp b/llvm/lib/VMCore/Verifier.cpp
index ffe2c5a5486..edd3da1a007 100644
--- a/llvm/lib/VMCore/Verifier.cpp
+++ b/llvm/lib/VMCore/Verifier.cpp
@@ -559,6 +559,12 @@ void Verifier::visitInstruction(Instruction &I) {
// exceptional destination.
if (InvokeInst *II = dyn_cast<InvokeInst>(Op))
OpBlock = II->getNormalDest();
+ else if (OpBlock == BB) {
+ // If they are in the same basic block, make sure that the definition
+ // comes before the use.
+ Assert2(DS->dominates(Op, &I),
+ "Instruction does not dominate all uses!", Op, &I);
+ }
// Definition must dominate use unless use is unreachable!
Assert2(DS->dominates(OpBlock, BB) ||
OpenPOWER on IntegriCloud