summaryrefslogtreecommitdiff
path: root/lib/CodeGen/LiveInterval.cpp
diff options
context:
space:
mode:
authorJakob Stoklund Olesen <stoklund@2pi.dk>2010-09-21 18:24:30 +0000
committerJakob Stoklund Olesen <stoklund@2pi.dk>2010-09-21 18:24:30 +0000
commit2de0e808c1fa742f3eac68b5d10d182699cbbe04 (patch)
treed868f975cc771863297d1583e9b757d822651a1e /lib/CodeGen/LiveInterval.cpp
parent65ffec49f73d1f8856211b107712c58cc9636b78 (diff)
downloadllvm-2de0e808c1fa742f3eac68b5d10d182699cbbe04.tar.gz
llvm-2de0e808c1fa742f3eac68b5d10d182699cbbe04.tar.bz2
llvm-2de0e808c1fa742f3eac68b5d10d182699cbbe04.tar.xz
MSVC9 does not support upper_bound with an asymmetric comparator.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@114455 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/LiveInterval.cpp')
-rw-r--r--lib/CodeGen/LiveInterval.cpp16
1 files changed, 10 insertions, 6 deletions
diff --git a/lib/CodeGen/LiveInterval.cpp b/lib/CodeGen/LiveInterval.cpp
index 6a6ecf78f6..199e5000b6 100644
--- a/lib/CodeGen/LiveInterval.cpp
+++ b/lib/CodeGen/LiveInterval.cpp
@@ -30,14 +30,18 @@
#include <algorithm>
using namespace llvm;
-// compEnd - Compare LiveRange end to Pos.
-// This argument ordering works for upper_bound.
-static inline bool compEnd(SlotIndex Pos, const LiveRange &LR) {
- return Pos < LR.end;
-}
+// CompEnd - Compare LiveRange end to Pos.
+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;
+ }
+};
LiveInterval::iterator LiveInterval::find(SlotIndex Pos) {
- return std::upper_bound(begin(), end(), Pos, compEnd);
+ return std::upper_bound(begin(), end(), Pos, CompEnd());
}
/// killedInRange - Return true if the interval has kills in [Start,End).