diff options
author | Jakob Stoklund Olesen <stoklund@2pi.dk> | 2010-09-21 20:16:12 +0000 |
---|---|---|
committer | Jakob Stoklund Olesen <stoklund@2pi.dk> | 2010-09-21 20:16:12 +0000 |
commit | beb64f55cf58b908fc58c15129d94ebc5762a39f (patch) | |
tree | 21b37d7b9658d7cce076062241a2ed5c4b235efe /llvm/lib | |
parent | c6d8839a2b6b0edf8dfed2de32662c900d648bef (diff) | |
download | bcm5719-llvm-beb64f55cf58b908fc58c15129d94ebc5762a39f.tar.gz bcm5719-llvm-beb64f55cf58b908fc58c15129d94ebc5762a39f.zip |
Refix MSVC9 and upper_bound. It actually needs a fully symmetric comparator.
llvm-svn: 114469
Diffstat (limited to 'llvm/lib')
-rw-r--r-- | llvm/lib/CodeGen/LiveInterval.cpp | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/llvm/lib/CodeGen/LiveInterval.cpp b/llvm/lib/CodeGen/LiveInterval.cpp index fd5fe787b6b..44101ffee7a 100644 --- a/llvm/lib/CodeGen/LiveInterval.cpp +++ b/llvm/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). |