From bdbb802c2f31412d8bd49242bba9696ab24e44c4 Mon Sep 17 00:00:00 2001 From: "Vikram S. Adve" Date: Thu, 8 Nov 2001 04:49:52 +0000 Subject: [PATCH] Added two minor methods. llvm-svn: 1187 --- llvm/lib/CodeGen/RegAlloc/LiveRange.h | 9 ++++++--- llvm/lib/CodeGen/RegAlloc/LiveRangeInfo.h | 2 ++ 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/llvm/lib/CodeGen/RegAlloc/LiveRange.h b/llvm/lib/CodeGen/RegAlloc/LiveRange.h index 23c217cd7a39..5b7b7ca2d497 100644 --- a/llvm/lib/CodeGen/RegAlloc/LiveRange.h +++ b/llvm/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/llvm/lib/CodeGen/RegAlloc/LiveRangeInfo.h b/llvm/lib/CodeGen/RegAlloc/LiveRangeInfo.h index d98ad9ab7a58..934737327be0 100644 --- a/llvm/lib/CodeGen/RegAlloc/LiveRangeInfo.h +++ b/llvm/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");