aboutsummaryrefslogtreecommitdiff
path: root/lib/CodeGen/LiveInterval.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2004-07-25 06:23:01 +0000
committerChris Lattner <sabre@nondot.org>2004-07-25 06:23:01 +0000
commitd3a205eab5761298ccfb320834b5f0ea0184ab27 (patch)
treeff2c1f52ec78f87878b8882ee2d18f4fc7df3342 /lib/CodeGen/LiveInterval.cpp
parent1d6dc974631a8920a4e5a801a6c7cd4753ae8a8e (diff)
Make a method const, no functionality changes
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15193 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/LiveInterval.cpp')
-rw-r--r--lib/CodeGen/LiveInterval.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/lib/CodeGen/LiveInterval.cpp b/lib/CodeGen/LiveInterval.cpp
index e533153080..29bee9bd6b 100644
--- a/lib/CodeGen/LiveInterval.cpp
+++ b/lib/CodeGen/LiveInterval.cpp
@@ -237,10 +237,10 @@ void LiveInterval::removeRange(unsigned Start, unsigned End) {
/// getLiveRangeContaining - Return the live range that contains the
/// specified index, or null if there is none.
-LiveRange *LiveInterval::getLiveRangeContaining(unsigned Idx) {
- Ranges::iterator It = std::upper_bound(ranges.begin(), ranges.end(), Idx);
+const LiveRange *LiveInterval::getLiveRangeContaining(unsigned Idx) const {
+ Ranges::const_iterator It = std::upper_bound(ranges.begin(),ranges.end(),Idx);
if (It != ranges.begin()) {
- LiveRange &LR = *prior(It);
+ const LiveRange &LR = *prior(It);
if (LR.contains(Idx))
return &LR;
}
@@ -254,8 +254,8 @@ LiveRange *LiveInterval::getLiveRangeContaining(unsigned Idx) {
/// is the result of a copy instruction in the source program, that occurs at
/// index 'CopyIdx' that copies from 'Other' to 'this'.
void LiveInterval::join(LiveInterval &Other, unsigned CopyIdx) {
- LiveRange *SourceLR = Other.getLiveRangeContaining(CopyIdx-1);
- LiveRange *DestLR = getLiveRangeContaining(CopyIdx);
+ const LiveRange *SourceLR = Other.getLiveRangeContaining(CopyIdx-1);
+ const LiveRange *DestLR = getLiveRangeContaining(CopyIdx);
assert(SourceLR && DestLR && "Not joining due to a copy?");
unsigned MergedSrcValIdx = SourceLR->ValId;
unsigned MergedDstValIdx = DestLR->ValId;