diff options
| author | Vikram S. Adve <vadve@cs.uiuc.edu> | 2003-07-29 19:38:22 +0000 |
|---|---|---|
| committer | Vikram S. Adve <vadve@cs.uiuc.edu> | 2003-07-29 19:38:22 +0000 |
| commit | e2ef34a81871854adb1676ec3d779dc38e35543e (patch) | |
| tree | 417950e58ebfb27c51b492022218e704bece0208 | |
| parent | 91e75d87d24058eb2215600259f604544c985308 (diff) | |
| download | bcm5719-llvm-e2ef34a81871854adb1676ec3d779dc38e35543e.tar.gz bcm5719-llvm-e2ef34a81871854adb1676ec3d779dc38e35543e.zip | |
Add const version of getLiveRangeForValue().
llvm-svn: 7386
| -rw-r--r-- | llvm/lib/CodeGen/RegAlloc/LiveRangeInfo.h | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/llvm/lib/CodeGen/RegAlloc/LiveRangeInfo.h b/llvm/lib/CodeGen/RegAlloc/LiveRangeInfo.h index 0425606b1c9..7b6ecb8db65 100644 --- a/llvm/lib/CodeGen/RegAlloc/LiveRangeInfo.h +++ b/llvm/lib/CodeGen/RegAlloc/LiveRangeInfo.h @@ -92,10 +92,15 @@ public: inline const LiveRangeMapType *getLiveRangeMap() const { return &LiveRangeMap; } - // Method sed to get the corresponding live range of a Value - // - inline LiveRange *getLiveRangeForValue( const Value *Val) - { return LiveRangeMap[Val]; } + // Method used to get the live range containing a Value. + // This may return NULL if no live range exists for a Value (eg, some consts) + inline LiveRange *getLiveRangeForValue(const Value *Val) { + return LiveRangeMap[Val]; + } + inline const LiveRange *getLiveRangeForValue(const Value *Val) const { + LiveRangeMapType::const_iterator I = LiveRangeMap.find(Val); + return I->second; + } // Method for coalescing live ranges. Called only after interference info // is calculated. |

