mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-01-24 08:33:39 +00:00
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
This commit is contained in:
parent
65ffec49f7
commit
2de0e808c1
@ -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).
|
||||
|
Loading…
x
Reference in New Issue
Block a user