[llvm-commits] CVS: llvm/lib/VMCore/Verifier.cpp

Chris Lattner lattner at cs.uiuc.edu
Tue Jan 13 23:44:00 PST 2004


Changes in directory llvm/lib/VMCore:

Verifier.cpp updated: 1.77 -> 1.78

---
Log message:

Fix check.  PHI nodes must be handled specially, of course.


---
Diffs of the changes:  (+5 -4)

Index: llvm/lib/VMCore/Verifier.cpp
diff -u llvm/lib/VMCore/Verifier.cpp:1.77 llvm/lib/VMCore/Verifier.cpp:1.78
--- llvm/lib/VMCore/Verifier.cpp:1.77	Tue Jan 13 22:25:59 2004
+++ llvm/lib/VMCore/Verifier.cpp	Tue Jan 13 23:42:52 2004
@@ -507,14 +507,15 @@
 
     else if (Instruction *Op = dyn_cast<Instruction>(I.getOperand(i))) {
       BasicBlock *OpBlock = Op->getParent();
-      // Invoke results are only usable in the normal destination, not in the
-      // exceptional destination.
-      if (InvokeInst *II = dyn_cast<InvokeInst>(Op))
-        OpBlock = II->getNormalDest();
 
       // Check that a definition dominates all of its uses.
       //
       if (!isa<PHINode>(I)) {
+        // Invoke results are only usable in the normal destination, not in the
+        // exceptional destination.
+        if (InvokeInst *II = dyn_cast<InvokeInst>(Op))
+          OpBlock = II->getNormalDest();
+
         // Definition must dominate use unless use is unreachable!
         Assert2(DS->dominates(OpBlock, BB) ||
                 !DS->dominates(&BB->getParent()->getEntryBlock(), BB),





More information about the llvm-commits mailing list