Added two minor methods.
authorVikram S. Adve <vadve@cs.uiuc.edu>
Thu, 8 Nov 2001 04:49:52 +0000 (04:49 +0000)
committerVikram S. Adve <vadve@cs.uiuc.edu>
Thu, 8 Nov 2001 04:49:52 +0000 (04:49 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@1187 91177308-0d34-0410-b5e6-96231b3b80d8

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

index 23c217cd7a39afb8eed8e393bd63078cfbd6d23c..5b7b7ca2d4973574c603828a4a6eda11ee1f8dab 100644 (file)
@@ -131,12 +131,15 @@ class LiveRange : public ValueSet
   inline IGNode * getUserIGNode() const 
     { return UserIGNode; }    // NULL if the user is not allocated
 
-  inline Type::PrimitiveID getTypeID() const {
+  inline const Type* getType() const {
     const Value *val = *begin();
     assert(val && "Can't find type - Live range is empty" );
-    return (val->getType())->getPrimitiveID();
+    return val->getType();
+  }
+  
+  inline Type::PrimitiveID getTypeID() const {
+    return this->getType()->getPrimitiveID();
   }
-
 
   inline void setSuggestedColor(int Col) {
     //assert( (SuggestedColor == -1) && "Changing an already suggested color");
index d98ad9ab7a5859cc7b194e016cfee20a21dc7fe0..934737327be0bd66e91fe2a06c35b25d96824696 100644 (file)
@@ -75,6 +75,8 @@ public:
 
   void constructLiveRanges();
 
+  const Method* getMethod() { return Meth; }
+
   inline void addLRToMap(const Value *Val, LiveRange *LR) {
     assert( Val && LR && "Val/LR is NULL!\n");
     assert( (! LiveRangeMap[ Val ]) && "LR already set in map");
index 23c217cd7a39afb8eed8e393bd63078cfbd6d23c..5b7b7ca2d4973574c603828a4a6eda11ee1f8dab 100644 (file)
@@ -131,12 +131,15 @@ class LiveRange : public ValueSet
   inline IGNode * getUserIGNode() const 
     { return UserIGNode; }    // NULL if the user is not allocated
 
-  inline Type::PrimitiveID getTypeID() const {
+  inline const Type* getType() const {
     const Value *val = *begin();
     assert(val && "Can't find type - Live range is empty" );
-    return (val->getType())->getPrimitiveID();
+    return val->getType();
+  }
+  
+  inline Type::PrimitiveID getTypeID() const {
+    return this->getType()->getPrimitiveID();
   }
-
 
   inline void setSuggestedColor(int Col) {
     //assert( (SuggestedColor == -1) && "Changing an already suggested color");
index d98ad9ab7a5859cc7b194e016cfee20a21dc7fe0..934737327be0bd66e91fe2a06c35b25d96824696 100644 (file)
@@ -75,6 +75,8 @@ public:
 
   void constructLiveRanges();
 
+  const Method* getMethod() { return Meth; }
+
   inline void addLRToMap(const Value *Val, LiveRange *LR) {
     assert( Val && LR && "Val/LR is NULL!\n");
     assert( (! LiveRangeMap[ Val ]) && "LR already set in map");