aboutsummaryrefslogtreecommitdiffstats
path: root/lib/CodeGen/LiveInterval.cpp
diff options
context:
space:
mode:
authorEvan Cheng <evan.cheng@apple.com>2009-01-29 02:20:59 +0000
committerEvan Cheng <evan.cheng@apple.com>2009-01-29 02:20:59 +0000
commit5a3c6a87b0173b9d367f7b55e7c99e5110ede057 (patch)
tree5124ba9c48331e7b38d11d10d9a7892b2874fa66 /lib/CodeGen/LiveInterval.cpp
parente5af2d3a224d4b38760a26d237cde040cb6e14eb (diff)
downloadexternal_llvm-5a3c6a87b0173b9d367f7b55e7c99e5110ede057.zip
external_llvm-5a3c6a87b0173b9d367f7b55e7c99e5110ede057.tar.gz
external_llvm-5a3c6a87b0173b9d367f7b55e7c99e5110ede057.tar.bz2
Exit with nice warnings when register allocator run out of registers.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@63267 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/LiveInterval.cpp')
-rw-r--r--lib/CodeGen/LiveInterval.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/lib/CodeGen/LiveInterval.cpp b/lib/CodeGen/LiveInterval.cpp
index 4392652..6341b9c 100644
--- a/lib/CodeGen/LiveInterval.cpp
+++ b/lib/CodeGen/LiveInterval.cpp
@@ -244,6 +244,16 @@ LiveInterval::addRangeFrom(LiveRange LR, iterator From) {
return ranges.insert(it, LR);
}
+/// isInOneLiveRange - Return true if the range specified is entirely in the
+/// a single LiveRange of the live interval.
+bool LiveInterval::isInOneLiveRange(unsigned Start, unsigned End) {
+ Ranges::iterator I = std::upper_bound(ranges.begin(), ranges.end(), Start);
+ if (I == ranges.begin())
+ return false;
+ --I;
+ return I->contains(Start) && I->contains(End-1);
+}
+
/// removeRange - Remove the specified range from this interval. Note that
/// the range must be in a single LiveRange in its entirety.