mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2025-01-19 18:24:05 +00:00
Refix MSVC9 and upper_bound. It actually needs a fully symmetric comparator.
llvm-svn: 114469
This commit is contained in:
parent
c153d48869
commit
cb8f334578
@ -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).
|
||||
|
Loading…
x
Reference in New Issue
Block a user