summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorJakob Stoklund Olesen <stoklund@2pi.dk>2010-09-21 20:16:12 +0000
committerJakob Stoklund Olesen <stoklund@2pi.dk>2010-09-21 20:16:12 +0000
commit7c727072168c55493ec362e254af1cd740d7eaf2 (patch)
tree82e0a3e82b1b343e99890d0d9b3a490f6cbc7f61 /lib
parent701cd622978ffe8c3197c0c465b97c5f2aeb8346 (diff)
downloadllvm-7c727072168c55493ec362e254af1cd740d7eaf2.tar.gz
llvm-7c727072168c55493ec362e254af1cd740d7eaf2.tar.bz2
llvm-7c727072168c55493ec362e254af1cd740d7eaf2.tar.xz
Refix MSVC9 and upper_bound. It actually needs a fully symmetric comparator.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@114469 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r--lib/CodeGen/LiveInterval.cpp12
1 files changed, 5 insertions, 7 deletions
diff --git a/lib/CodeGen/LiveInterval.cpp b/lib/CodeGen/LiveInterval.cpp
index fd5fe787b6..44101ffee7 100644
--- a/lib/CodeGen/LiveInterval.cpp
+++ b/lib/CodeGen/LiveInterval.cpp
@@ -30,20 +30,18 @@
#include <algorithm>
using namespace llvm;
-// CompEnd - Compare LiveRange end to Pos.
+// CompEnd - Compare LiveRange ends.
namespace {
struct CompEnd {
- bool operator()(SlotIndex Pos, const LiveRange &LR) const {
- return Pos < LR.end;
- }
- bool operator()(const LiveRange &LR, SlotIndex Pos) const {
- return LR.end < Pos;
+ bool operator()(const LiveRange &A, const LiveRange &B) const {
+ return A.end < B.end;
}
};
}
LiveInterval::iterator LiveInterval::find(SlotIndex Pos) {
- return std::upper_bound(begin(), end(), Pos, CompEnd());
+ return std::upper_bound(begin(), end(), LiveRange(SlotIndex(), Pos, 0),
+ CompEnd());
}
/// killedInRange - Return true if the interval has kills in [Start,End).