diff options
author | Vikram S. Adve <vadve@cs.uiuc.edu> | 2001-11-08 04:49:52 +0000 |
---|---|---|
committer | Vikram S. Adve <vadve@cs.uiuc.edu> | 2001-11-08 04:49:52 +0000 |
commit | 38f5d46affe2cd8837c69918b6387783cf73bff3 (patch) | |
tree | 0bb6d24b2a2066d4caa56c340601b763cbc4222f | |
parent | 12af164c87b57b275c4d9830e42b0dd23364c58a (diff) |
Added two minor methods.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@1187 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | lib/CodeGen/RegAlloc/LiveRange.h | 9 | ||||
-rw-r--r-- | lib/CodeGen/RegAlloc/LiveRangeInfo.h | 2 | ||||
-rw-r--r-- | lib/Target/SparcV9/RegAlloc/LiveRange.h | 9 | ||||
-rw-r--r-- | lib/Target/SparcV9/RegAlloc/LiveRangeInfo.h | 2 |
4 files changed, 16 insertions, 6 deletions
diff --git a/lib/CodeGen/RegAlloc/LiveRange.h b/lib/CodeGen/RegAlloc/LiveRange.h index 23c217cd7a..5b7b7ca2d4 100644 --- a/lib/CodeGen/RegAlloc/LiveRange.h +++ b/lib/CodeGen/RegAlloc/LiveRange.h @@ -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"); diff --git a/lib/CodeGen/RegAlloc/LiveRangeInfo.h b/lib/CodeGen/RegAlloc/LiveRangeInfo.h index d98ad9ab7a..934737327b 100644 --- a/lib/CodeGen/RegAlloc/LiveRangeInfo.h +++ b/lib/CodeGen/RegAlloc/LiveRangeInfo.h @@ -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"); diff --git a/lib/Target/SparcV9/RegAlloc/LiveRange.h b/lib/Target/SparcV9/RegAlloc/LiveRange.h index 23c217cd7a..5b7b7ca2d4 100644 --- a/lib/Target/SparcV9/RegAlloc/LiveRange.h +++ b/lib/Target/SparcV9/RegAlloc/LiveRange.h @@ -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"); diff --git a/lib/Target/SparcV9/RegAlloc/LiveRangeInfo.h b/lib/Target/SparcV9/RegAlloc/LiveRangeInfo.h index d98ad9ab7a..934737327b 100644 --- a/lib/Target/SparcV9/RegAlloc/LiveRangeInfo.h +++ b/lib/Target/SparcV9/RegAlloc/LiveRangeInfo.h @@ -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"); |