Move some common data structures between dom and pdom into the base class
authorNate Begeman <natebegeman@mac.com>
Mon, 20 Mar 2006 19:32:48 +0000 (19:32 +0000)
committerNate Begeman <natebegeman@mac.com>
Mon, 20 Mar 2006 19:32:48 +0000 (19:32 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@26905 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/Analysis/Dominators.h
include/llvm/Analysis/PostDominators.h

index 4b2f61129d069545fe4c95b83d58086c2f865efc..9dcabcfd477a227dadebdcdbc2b3f4be2a246796 100644 (file)
@@ -66,7 +66,23 @@ public:
 ///
 class ImmediateDominatorsBase : public DominatorBase {
 protected:
+  struct InfoRec {
+    unsigned Semi;
+    unsigned Size;
+    BasicBlock *Label, *Parent, *Child, *Ancestor;
+    
+    std::vector<BasicBlock*> Bucket;
+    
+    InfoRec() : Semi(0), Size(0), Label(0), Parent(0), Child(0), Ancestor(0){}
+  };
+  
   std::map<BasicBlock*, BasicBlock*> IDoms;
+
+  // Vertex - Map the DFS number to the BasicBlock*
+  std::vector<BasicBlock*> Vertex;
+  
+  // Info - Collection of information used during the computation of idoms.
+  std::map<BasicBlock*, InfoRec> Info;
 public:
   ImmediateDominatorsBase(bool isPostDom) : DominatorBase(isPostDom) {}
 
@@ -139,22 +155,6 @@ struct ImmediateDominators : public ImmediateDominatorsBase {
   }
 
 private:
-  struct InfoRec {
-    unsigned Semi;
-    unsigned Size;
-    BasicBlock *Label, *Parent, *Child, *Ancestor;
-
-    std::vector<BasicBlock*> Bucket;
-
-    InfoRec() : Semi(0), Size(0), Label(0), Parent(0), Child(0), Ancestor(0){}
-  };
-
-  // Vertex - Map the DFS number to the BasicBlock*
-  std::vector<BasicBlock*> Vertex;
-
-  // Info - Collection of information used during the computation of idoms.
-  std::map<BasicBlock*, InfoRec> Info;
-
   unsigned DFSPass(BasicBlock *V, InfoRec &VInfo, unsigned N);
   void Compress(BasicBlock *V, InfoRec &VInfo);
   BasicBlock *Eval(BasicBlock *v);
index 39b26d707ff514d60394d982da572c4439aeee9d..b9a1feb8ba323ee1c68e4e4bd3dd3185a2b4e551 100644 (file)
@@ -32,22 +32,6 @@ struct ImmediatePostDominators : public ImmediateDominatorsBase {
   }
   
 private:
-    struct InfoRec {
-      unsigned Semi;
-      unsigned Size;
-      BasicBlock *Label, *Parent, *Child, *Ancestor;
-      
-      std::vector<BasicBlock*> Bucket;
-      
-      InfoRec() : Semi(0), Size(0), Label(0), Parent(0), Child(0), Ancestor(0){}
-    };
-  
-  // Vertex - Map the DFS number to the BasicBlock*
-  std::vector<BasicBlock*> Vertex;
-  
-  // Info - Collection of information used during the computation of idoms.
-  std::map<BasicBlock*, InfoRec> Info;
-  
   unsigned DFSPass(BasicBlock *V, InfoRec &VInfo, unsigned N);
   void Compress(BasicBlock *V, InfoRec &VInfo);
   BasicBlock *Eval(BasicBlock *v);