mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-02-07 14:33:15 +00:00
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
This commit is contained in:
parent
701cd62297
commit
7c72707216
@ -30,20 +30,18 @@
|
|||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
using namespace llvm;
|
using namespace llvm;
|
||||||
|
|
||||||
// CompEnd - Compare LiveRange end to Pos.
|
// CompEnd - Compare LiveRange ends.
|
||||||
namespace {
|
namespace {
|
||||||
struct CompEnd {
|
struct CompEnd {
|
||||||
bool operator()(SlotIndex Pos, const LiveRange &LR) const {
|
bool operator()(const LiveRange &A, const LiveRange &B) const {
|
||||||
return Pos < LR.end;
|
return A.end < B.end;
|
||||||
}
|
|
||||||
bool operator()(const LiveRange &LR, SlotIndex Pos) const {
|
|
||||||
return LR.end < Pos;
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
LiveInterval::iterator LiveInterval::find(SlotIndex Pos) {
|
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).
|
/// killedInRange - Return true if the interval has kills in [Start,End).
|
||||||
|
Loading…
x
Reference in New Issue
Block a user