* Code Cleanups of IGNode.h
authorChris Lattner <sabre@nondot.org>
Tue, 5 Feb 2002 03:51:37 +0000 (03:51 +0000)
committerChris Lattner <sabre@nondot.org>
Tue, 5 Feb 2002 03:51:37 +0000 (03:51 +0000)
* Removal of getTypeID() methods, and dependence on llvm/Type.h, from IGNode & LiveRange

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@1717 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/RegAlloc/IGNode.h
lib/CodeGen/RegAlloc/LiveRange.h
lib/Target/SparcV9/RegAlloc/IGNode.h
lib/Target/SparcV9/RegAlloc/LiveRange.h

index 01ecc1378354a4faabc6a1afdbb1a3dec08bea2e..bdaedf8c134c66ae3c14f24e9bb20f54916b576c 100644 (file)
@@ -25,7 +25,6 @@
 #ifndef IG_NODE_H
 #define IG_NODE_H
 
-
 #include "llvm/CodeGen/RegAllocCommon.h"
 #include "llvm/CodeGen/LiveRange.h"
 class LiveRange;
@@ -56,35 +55,25 @@ public:
 
   // constructor
   //
-  IGNode(LiveRange *const LR, unsigned int index);
-
-  // an empty destructor
-  //
-  ~IGNode() { }                        
+  IGNode(LiveRange *LR, unsigned index);
 
-
-  inline unsigned int getIndex() const 
-    { return Index; }
+  inline unsigned int getIndex() const { return Index; }
 
   // adjLists must be updated only once.  However, the CurDegree can be changed
   //
-  inline void addAdjIGNode( IGNode *const AdjNode) 
-    { AdjList.push_back(AdjNode);  } 
+  inline void addAdjIGNode(IGNode *AdjNode) { AdjList.push_back(AdjNode);  } 
 
-  inline IGNode * getAdjIGNode(unsigned int ind) const 
-    { assert ( ind < AdjList.size()); return AdjList[ ind ]; }
+  inline IGNode *getAdjIGNode(unsigned ind) const 
+    { assert ( ind < AdjList.size()); return AdjList[ind]; }
 
   // delete a node in AdjList - node must be in the list
   // should not be called often
   //
-  void delAdjIGNode(const IGNode *const Node); 
-
-  inline unsigned int getNumOfNeighbors() const 
-    { return AdjList.size() ; }
+  void delAdjIGNode(const IGNode *Node); 
 
+  inline unsigned getNumOfNeighbors() const { return AdjList.size(); }
 
-  inline bool isOnStack() const 
-    { return OnStack; }
+  inline bool isOnStack() const { return OnStack; }
 
   // remove form IG and pushes on to stack (reduce the degree of neighbors)
   //
@@ -95,16 +84,16 @@ public:
   // after all modifications to the IG are over (i.e., all neighbors are
   // fixed).
   //
-  inline void setCurDegree() 
-    { assert( CurDegree == -1);   CurDegree = AdjList.size(); }
+  inline void setCurDegree() {
+    assert(CurDegree == -1);
+    CurDegree = AdjList.size();
+  }
 
-  inline int getCurDegree() const 
-    { return CurDegree; }
+  inline int getCurDegree() const { return CurDegree; }
 
   // called when a neigh is pushed on to stack
   //
-  inline void decCurDegree() 
-    { assert( CurDegree > 0 ); --CurDegree; }
+  inline void decCurDegree() { assert(CurDegree > 0); --CurDegree; }
 
 
   // The following methods call the methods in ParentLR
@@ -112,39 +101,24 @@ public:
   // If many of these are called within a single scope,
   // consider calling the methods directly on LR
 
+  inline void setRegClass(RegClass *RC) { ParentLR->setRegClass(RC);  }
 
-  inline void setRegClass(RegClass *const RC) 
-    { ParentLR->setRegClass(RC);  }
+  inline RegClass *getRegClass() const { return ParentLR->getRegClass(); }
 
-  inline RegClass *const getRegClass() const {
-    return ParentLR->getRegClass();
-  }
-
-  inline bool hasColor() const 
-    { return ParentLR->hasColor();  }
+  inline bool hasColor() const { return ParentLR->hasColor();  }
 
-  inline unsigned int getColor() const 
-    { return ParentLR->getColor();  }
+  inline unsigned int getColor() const { return ParentLR->getColor();  }
 
-  inline void setColor(unsigned int Col) 
-    { ParentLR->setColor(Col);  }
+  inline void setColor(unsigned Col) { ParentLR->setColor(Col);  }
 
-  inline void markForSpill() 
-    { ParentLR->markForSpill();  }
+  inline void markForSpill() { ParentLR->markForSpill(); }
 
-  inline void markForSaveAcrossCalls() 
-    { ParentLR->markForSaveAcrossCalls();  }
+  inline void markForSaveAcrossCalls() { ParentLR->markForSaveAcrossCalls();  }
 
   inline unsigned int isCallInterference() const 
   { return ParentLR->isCallInterference(); } 
 
-  inline LiveRange *getParentLR() const 
-    { return ParentLR; }
-
-  inline Type::PrimitiveID getTypeID() const 
-    { return ParentLR->getTypeID(); }
-
-
+  inline LiveRange *getParentLR() const { return ParentLR; }
 };
 
 #endif
index 6c2952af6b9dbad56a406a8af4b70e7c508c1319..5f3e41bd15285f5405306796320deec8b267cc86 100644 (file)
 #define LIVE_RANGE_H
 
 #include "llvm/Analysis/LiveVar/ValueSet.h"
-#include "llvm/Type.h"
+#include "llvm/Value.h"
 #include <iostream>
 
 class RegClass;
 class IGNode;
+class Type;
 
 class LiveRange : public ValueSet {
   RegClass *MyRegClass;       // register classs (e.g., int, FP) for this LR
@@ -134,10 +135,6 @@ public:
     return (*begin())->getType();  // set's don't have a front
   }
   
-  inline Type::PrimitiveID getTypeID() const {
-    return getType()->getPrimitiveID();
-  }
-
   inline void setSuggestedColor(int Col) {
     if (SuggestedColor == -1)
       SuggestedColor = Col;
index 01ecc1378354a4faabc6a1afdbb1a3dec08bea2e..bdaedf8c134c66ae3c14f24e9bb20f54916b576c 100644 (file)
@@ -25,7 +25,6 @@
 #ifndef IG_NODE_H
 #define IG_NODE_H
 
-
 #include "llvm/CodeGen/RegAllocCommon.h"
 #include "llvm/CodeGen/LiveRange.h"
 class LiveRange;
@@ -56,35 +55,25 @@ public:
 
   // constructor
   //
-  IGNode(LiveRange *const LR, unsigned int index);
-
-  // an empty destructor
-  //
-  ~IGNode() { }                        
+  IGNode(LiveRange *LR, unsigned index);
 
-
-  inline unsigned int getIndex() const 
-    { return Index; }
+  inline unsigned int getIndex() const { return Index; }
 
   // adjLists must be updated only once.  However, the CurDegree can be changed
   //
-  inline void addAdjIGNode( IGNode *const AdjNode) 
-    { AdjList.push_back(AdjNode);  } 
+  inline void addAdjIGNode(IGNode *AdjNode) { AdjList.push_back(AdjNode);  } 
 
-  inline IGNode * getAdjIGNode(unsigned int ind) const 
-    { assert ( ind < AdjList.size()); return AdjList[ ind ]; }
+  inline IGNode *getAdjIGNode(unsigned ind) const 
+    { assert ( ind < AdjList.size()); return AdjList[ind]; }
 
   // delete a node in AdjList - node must be in the list
   // should not be called often
   //
-  void delAdjIGNode(const IGNode *const Node); 
-
-  inline unsigned int getNumOfNeighbors() const 
-    { return AdjList.size() ; }
+  void delAdjIGNode(const IGNode *Node); 
 
+  inline unsigned getNumOfNeighbors() const { return AdjList.size(); }
 
-  inline bool isOnStack() const 
-    { return OnStack; }
+  inline bool isOnStack() const { return OnStack; }
 
   // remove form IG and pushes on to stack (reduce the degree of neighbors)
   //
@@ -95,16 +84,16 @@ public:
   // after all modifications to the IG are over (i.e., all neighbors are
   // fixed).
   //
-  inline void setCurDegree() 
-    { assert( CurDegree == -1);   CurDegree = AdjList.size(); }
+  inline void setCurDegree() {
+    assert(CurDegree == -1);
+    CurDegree = AdjList.size();
+  }
 
-  inline int getCurDegree() const 
-    { return CurDegree; }
+  inline int getCurDegree() const { return CurDegree; }
 
   // called when a neigh is pushed on to stack
   //
-  inline void decCurDegree() 
-    { assert( CurDegree > 0 ); --CurDegree; }
+  inline void decCurDegree() { assert(CurDegree > 0); --CurDegree; }
 
 
   // The following methods call the methods in ParentLR
@@ -112,39 +101,24 @@ public:
   // If many of these are called within a single scope,
   // consider calling the methods directly on LR
 
+  inline void setRegClass(RegClass *RC) { ParentLR->setRegClass(RC);  }
 
-  inline void setRegClass(RegClass *const RC) 
-    { ParentLR->setRegClass(RC);  }
+  inline RegClass *getRegClass() const { return ParentLR->getRegClass(); }
 
-  inline RegClass *const getRegClass() const {
-    return ParentLR->getRegClass();
-  }
-
-  inline bool hasColor() const 
-    { return ParentLR->hasColor();  }
+  inline bool hasColor() const { return ParentLR->hasColor();  }
 
-  inline unsigned int getColor() const 
-    { return ParentLR->getColor();  }
+  inline unsigned int getColor() const { return ParentLR->getColor();  }
 
-  inline void setColor(unsigned int Col) 
-    { ParentLR->setColor(Col);  }
+  inline void setColor(unsigned Col) { ParentLR->setColor(Col);  }
 
-  inline void markForSpill() 
-    { ParentLR->markForSpill();  }
+  inline void markForSpill() { ParentLR->markForSpill(); }
 
-  inline void markForSaveAcrossCalls() 
-    { ParentLR->markForSaveAcrossCalls();  }
+  inline void markForSaveAcrossCalls() { ParentLR->markForSaveAcrossCalls();  }
 
   inline unsigned int isCallInterference() const 
   { return ParentLR->isCallInterference(); } 
 
-  inline LiveRange *getParentLR() const 
-    { return ParentLR; }
-
-  inline Type::PrimitiveID getTypeID() const 
-    { return ParentLR->getTypeID(); }
-
-
+  inline LiveRange *getParentLR() const { return ParentLR; }
 };
 
 #endif
index 6c2952af6b9dbad56a406a8af4b70e7c508c1319..5f3e41bd15285f5405306796320deec8b267cc86 100644 (file)
 #define LIVE_RANGE_H
 
 #include "llvm/Analysis/LiveVar/ValueSet.h"
-#include "llvm/Type.h"
+#include "llvm/Value.h"
 #include <iostream>
 
 class RegClass;
 class IGNode;
+class Type;
 
 class LiveRange : public ValueSet {
   RegClass *MyRegClass;       // register classs (e.g., int, FP) for this LR
@@ -134,10 +135,6 @@ public:
     return (*begin())->getType();  // set's don't have a front
   }
   
-  inline Type::PrimitiveID getTypeID() const {
-    return getType()->getPrimitiveID();
-  }
-
   inline void setSuggestedColor(int Col) {
     if (SuggestedColor == -1)
       SuggestedColor = Col;