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

Chris Lattner lattner at cs.uiuc.edu
Wed Nov 12 01:14:01 PST 2003


Changes in directory llvm/lib/VMCore:

Verifier.cpp updated: 1.66 -> 1.67

---
Log message:

Detect problems with PHI node operands!


---
Diffs of the changes:  (+6 -0)

Index: llvm/lib/VMCore/Verifier.cpp
diff -u llvm/lib/VMCore/Verifier.cpp:1.66 llvm/lib/VMCore/Verifier.cpp:1.67
--- llvm/lib/VMCore/Verifier.cpp:1.66	Tue Nov 11 16:41:34 2003
+++ llvm/lib/VMCore/Verifier.cpp	Wed Nov 12 01:13:37 2003
@@ -340,6 +340,12 @@
           "PHI nodes not grouped at top of basic block!",
           &PN, PN.getParent());
 
+  // Check that all of the operands of the PHI node have the same type as the
+  // result.
+  for (unsigned i = 0, e = PN.getNumIncomingValues(); i != e; ++i)
+    Assert1(PN.getType() == PN.getIncomingValue(i)->getType(),
+            "PHI node operands are not the same type as the result!", &PN);
+
   // All other PHI node constraints are checked in the visitBasicBlock method.
 
   visitInstruction(PN);





More information about the llvm-commits mailing list