Add getPotentialPassManagerType(). No functionality change, yet.
[oota-llvm.git] / include / llvm / Analysis / ET-Forest.h
index 5607d52ec54b13a99eb4d7b789c87eab90dac4a3..f41e1f59c9bb30eeef7572dba8a5cacb93a9c41e 100644 (file)
@@ -130,7 +130,8 @@ public:
 
 class ETNode {
 public:
-  ETNode(void *d) : data(d), Father(NULL), Left(NULL),
+  ETNode(void *d) : data(d), DFSNumIn(-1), DFSNumOut(-1),
+                    Father(NULL), Left(NULL),
                     Right(NULL), Son(NULL), ParentOcc(NULL) {   
     RightmostOcc = new ETOccurrence(this);
   };
@@ -140,6 +141,7 @@ public:
   // removeFromForest()
   ~ETNode() {
     delete RightmostOcc;
+    delete ParentOcc;
   }
 
   void removeFromForest() {
@@ -249,16 +251,7 @@ public:
     return this->Below(other);
   }
 
-  void assignDFSNumber(int &num) {
-    DFSNumIn = num++;
-    
-    if (Son) {
-      Son->assignDFSNumber(num);
-      for (ETNode *son = Son->Right; son != Son; son = son->Right)
-        son->assignDFSNumber(num);
-    }
-    DFSNumOut = num++;
-  }
+  void assignDFSNumber (int);
   
   bool hasFather() const {
     return Father != NULL;
@@ -287,7 +280,7 @@ public:
   void *data;
 
   // DFS Numbers
-  unsigned DFSNumIn, DFSNumOut;
+  int DFSNumIn, DFSNumOut;
 
   // Father
   ETNode *Father;