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

Chris Lattner lattner at cs.uiuc.edu
Tue Jul 11 13:30:02 PDT 2006



Changes in directory llvm/lib/VMCore:

Verifier.cpp updated: 1.158 -> 1.159
---
Log message:

Fix PR826: http://llvm.org/PR826 , testcase here: Regression/Verifier/2006-07-11-StoreStruct.ll


---
Diffs of the changes:  (+8 -2)

 Verifier.cpp |   10 ++++++++--
 1 files changed, 8 insertions(+), 2 deletions(-)


Index: llvm/lib/VMCore/Verifier.cpp
diff -u llvm/lib/VMCore/Verifier.cpp:1.158 llvm/lib/VMCore/Verifier.cpp:1.159
--- llvm/lib/VMCore/Verifier.cpp:1.158	Thu Jul  6 13:01:23 2006
+++ llvm/lib/VMCore/Verifier.cpp	Tue Jul 11 15:29:49 2006
@@ -652,10 +652,16 @@
   }
 
   for (unsigned i = 0, e = I.getNumOperands(); i != e; ++i) {
-    // Check to make sure that the "address of" an intrinsic function is never
-    // taken.
     Assert1(I.getOperand(i) != 0, "Instruction has null operand!", &I);
+
+    // Check to make sure that only first-class-values are operands to
+    // instructions.
+    Assert1(I.getOperand(i)->getType()->isFirstClassType(),
+            "Instruction operands must be first-class values!", &I);
+  
     if (Function *F = dyn_cast<Function>(I.getOperand(i))) {
+      // Check to make sure that the "address of" an intrinsic function is never
+      // taken.
       Assert1(!F->isIntrinsic() || (i == 0 && isa<CallInst>(I)),
               "Cannot take the address of an intrinsic!", &I);
     } else if (BasicBlock *OpBB = dyn_cast<BasicBlock>(I.getOperand(i))) {






More information about the llvm-commits mailing list