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

LLVM llvm at cs.uiuc.edu
Sun May 16 19:01:01 PDT 2004


Changes in directory llvm/lib/VMCore:

Verifier.cpp updated: 1.97.2.1 -> 1.97.2.2

---
Log message:

Changes resulting from making Type not be a Value. Had to create a 
WriteType function and a few more CheckFailed methods to handle the checks
involving Types.


---
Diffs of the changes:  (+19 -7)

Index: llvm/lib/VMCore/Verifier.cpp
diff -u llvm/lib/VMCore/Verifier.cpp:1.97.2.1 llvm/lib/VMCore/Verifier.cpp:1.97.2.2
--- llvm/lib/VMCore/Verifier.cpp:1.97.2.1	Wed May 12 11:33:43 2004
+++ llvm/lib/VMCore/Verifier.cpp	Sun May 16 19:01:17 2004
@@ -183,14 +183,17 @@
       if (!V) return;
       if (isa<Instruction>(V)) {
         msgs << *V;
-      } else if (const Type *Ty = dyn_cast<Type>(V)) {
-        WriteTypeSymbolic(msgs, Ty, Mod);
       } else {
         WriteAsOperand (msgs, V, true, true, Mod);
         msgs << "\n";
       }
     }
 
+    void WriteType(const Type* T ) {
+      if ( !T ) return;
+      WriteTypeSymbolic(msgs, T, Mod );
+    }
+
 
     // CheckFailed - A check failed, so print out the condition and the message
     // that failed.  This provides a nice place to put a breakpoint if you want
@@ -205,6 +208,14 @@
       WriteValue(V4);
       Broken = true;
     }
+
+    void CheckFailed( const std::string& Message, const Value* V1, 
+	              const Type* T2, const Value* V3 = 0 ) {
+      msgs << Message << "\n";
+      WriteValue(V1);
+      WriteType(T2);
+      WriteValue(V3);
+    }
   };
 
   RegisterOpt<Verifier> X("verify", "Module Verifier");
@@ -241,11 +252,12 @@
 //
 void Verifier::verifySymbolTable(SymbolTable &ST) {
 
-  // Loop over all of the types in the symbol table...
-  for (SymbolTable::type_const_iterator TI = ST.begin(), TE = ST.end(); TI != TE; ++TI)
-  for (SymbolTable::value_const_iterator I = TI->second.begin(),
-      E = TI->second.end(); I != E; ++I) {
-    Value *V = I->second;
+  // Loop over all of the type planes in the symbol table.
+  for (SymbolTable::plane_const_iterator PI = ST.plane_begin(), 
+       PE = ST.plane_end(); PI != PE; ++PI)
+  for (SymbolTable::value_const_iterator VI = PI->second.begin(),
+      VE = PI->second.end(); VI != VE; ++VI) {
+    Value *V = VI->second;
     // Check that there are no void typed values in the symbol table.  Values
     // with a void type cannot be put into symbol tables because they cannot
     // have names!





More information about the llvm-commits mailing list