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

Devang Patel dpatel at apple.com
Mon Jun 11 08:41:10 PDT 2007



Changes in directory llvm/lib/VMCore:

Verifier.cpp updated: 1.213 -> 1.214
---
Log message:

Use DominatorTree instead of ETForest.


---
Diffs of the changes:  (+16 -16)

 Verifier.cpp |   32 ++++++++++++++++----------------
 1 files changed, 16 insertions(+), 16 deletions(-)


Index: llvm/lib/VMCore/Verifier.cpp
diff -u llvm/lib/VMCore/Verifier.cpp:1.213 llvm/lib/VMCore/Verifier.cpp:1.214
--- llvm/lib/VMCore/Verifier.cpp:1.213	Thu Jun  7 01:12:03 2007
+++ llvm/lib/VMCore/Verifier.cpp	Mon Jun 11 10:40:48 2007
@@ -76,7 +76,7 @@
     VerifierFailureAction action;
                           // What to do if verification fails.
     Module *Mod;          // Module we are verifying right now
-    ETForest *EF;     // ET-Forest, caution can be null!
+    DominatorTree *DT; // Dominator Tree, caution can be null!
     std::stringstream msgs;  // A stringstream to collect messages
 
     /// InstInThisBlock - when verifying a basic block, keep track of all of the
@@ -88,20 +88,20 @@
     Verifier()
       : FunctionPass((intptr_t)&ID), 
       Broken(false), RealPass(true), action(AbortProcessAction),
-      EF(0), msgs( std::ios::app | std::ios::out ) {}
+      DT(0), msgs( std::ios::app | std::ios::out ) {}
     Verifier( VerifierFailureAction ctn )
       : FunctionPass((intptr_t)&ID), 
-      Broken(false), RealPass(true), action(ctn), EF(0),
+      Broken(false), RealPass(true), action(ctn), DT(0),
       msgs( std::ios::app | std::ios::out ) {}
     Verifier(bool AB )
       : FunctionPass((intptr_t)&ID), 
       Broken(false), RealPass(true),
-      action( AB ? AbortProcessAction : PrintMessageAction), EF(0),
+      action( AB ? AbortProcessAction : PrintMessageAction), DT(0),
       msgs( std::ios::app | std::ios::out ) {}
-    Verifier(ETForest &ef)
+    Verifier(DominatorTree &dt)
       : FunctionPass((intptr_t)&ID), 
       Broken(false), RealPass(false), action(PrintMessageAction),
-      EF(&ef), msgs( std::ios::app | std::ios::out ) {}
+      DT(&dt), msgs( std::ios::app | std::ios::out ) {}
 
 
     bool doInitialization(Module &M) {
@@ -118,7 +118,7 @@
 
     bool runOnFunction(Function &F) {
       // Get dominator information if we are being run by PassManager
-      if (RealPass) EF = &getAnalysis<ETForest>();
+      if (RealPass) DT = &getAnalysis<DominatorTree>();
 
       Mod = F.getParent();
 
@@ -158,7 +158,7 @@
     virtual void getAnalysisUsage(AnalysisUsage &AU) const {
       AU.setPreservesAll();
       if (RealPass)
-        AU.addRequired<ETForest>();
+        AU.addRequired<DominatorTree>();
     }
 
     /// abortIfBroken - If the module is broken and we are supposed to abort on
@@ -879,7 +879,7 @@
     for (Value::use_iterator UI = I.use_begin(), UE = I.use_end();
          UI != UE; ++UI)
       Assert1(*UI != (User*)&I ||
-              !EF->dominates(&BB->getParent()->getEntryBlock(), BB),
+              !DT->dominates(&BB->getParent()->getEntryBlock(), BB),
               "Only PHI nodes may reference their own value!", &I);
   }
 
@@ -948,7 +948,7 @@
           // dominates all of it's predecessors (other than the invoke) or if
           // the invoke value is only used by a phi in the successor.
           if (!OpBlock->getSinglePredecessor() &&
-              EF->dominates(&BB->getParent()->getEntryBlock(), BB)) {
+              DT->dominates(&BB->getParent()->getEntryBlock(), BB)) {
             // The first case we allow is if the use is a PHI operand in the
             // normal block, and if that PHI operand corresponds to the invoke's
             // block.
@@ -965,7 +965,7 @@
               Bad = false;
               for (pred_iterator PI = pred_begin(OpBlock),
                    E = pred_end(OpBlock); PI != E; ++PI) {
-                if (*PI != II->getParent() && !EF->dominates(OpBlock, *PI)) {
+                if (*PI != II->getParent() && !DT->dominates(OpBlock, *PI)) {
                   Bad = true;
                   break;
                 }
@@ -979,20 +979,20 @@
           // If they are in the same basic block, make sure that the definition
           // comes before the use.
           Assert2(InstsInThisBlock.count(Op) ||
-                  !EF->dominates(&BB->getParent()->getEntryBlock(), BB),
+                  !DT->dominates(&BB->getParent()->getEntryBlock(), BB),
                   "Instruction does not dominate all uses!", Op, &I);
         }
 
         // Definition must dominate use unless use is unreachable!
-        Assert2(EF->dominates(OpBlock, BB) ||
-                !EF->dominates(&BB->getParent()->getEntryBlock(), BB),
+        Assert2(DT->dominates(OpBlock, BB) ||
+                !DT->dominates(&BB->getParent()->getEntryBlock(), BB),
                 "Instruction does not dominate all uses!", Op, &I);
       } else {
         // PHI nodes are more difficult than other nodes because they actually
         // "use" the value in the predecessor basic blocks they correspond to.
         BasicBlock *PredBB = cast<BasicBlock>(I.getOperand(i+1));
-        Assert2(EF->dominates(OpBlock, PredBB) ||
-                !EF->dominates(&BB->getParent()->getEntryBlock(), PredBB),
+        Assert2(DT->dominates(OpBlock, PredBB) ||
+                !DT->dominates(&BB->getParent()->getEntryBlock(), PredBB),
                 "Instruction does not dominate all uses!", Op, &I);
       }
     } else if (isa<InlineAsm>(I.getOperand(i))) {






More information about the llvm-commits mailing list