[llvm-commits] [llvm] r114469 - /llvm/trunk/lib/CodeGen/LiveInterval.cpp
Jakob Stoklund Olesen
stoklund at 2pi.dk
Tue Sep 21 13:16:12 PDT 2010
Author: stoklund
Date: Tue Sep 21 15:16:12 2010
New Revision: 114469
URL: http://llvm.org/viewvc/llvm-project?rev=114469&view=rev
Log:
Refix MSVC9 and upper_bound. It actually needs a fully symmetric comparator.
Modified:
llvm/trunk/lib/CodeGen/LiveInterval.cpp
Modified: llvm/trunk/lib/CodeGen/LiveInterval.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/LiveInterval.cpp?rev=114469&r1=114468&r2=114469&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/LiveInterval.cpp (original)
+++ llvm/trunk/lib/CodeGen/LiveInterval.cpp Tue Sep 21 15:16:12 2010
@@ -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).
More information about the llvm-commits
mailing list