mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-02-05 14:34:55 +00:00
Avoid comparing invalid slot indexes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@126922 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
36d61863bc
commit
b64f669b66
@ -33,16 +33,18 @@ using namespace llvm;
|
|||||||
// CompEnd - Compare LiveRange ends.
|
// CompEnd - Compare LiveRange ends.
|
||||||
namespace {
|
namespace {
|
||||||
struct CompEnd {
|
struct CompEnd {
|
||||||
bool operator()(const LiveRange &A, const LiveRange &B) const {
|
bool operator()(SlotIndex A, const LiveRange &B) const {
|
||||||
return A.end < B.end;
|
return A < B.end;
|
||||||
|
}
|
||||||
|
bool operator()(const LiveRange &A, SlotIndex B) const {
|
||||||
|
return A.end < B;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
LiveInterval::iterator LiveInterval::find(SlotIndex Pos) {
|
LiveInterval::iterator LiveInterval::find(SlotIndex Pos) {
|
||||||
assert(Pos.isValid() && "Cannot search for an invalid index");
|
assert(Pos.isValid() && "Cannot search for an invalid index");
|
||||||
return std::upper_bound(begin(), end(), LiveRange(SlotIndex(), Pos, 0),
|
return std::upper_bound(begin(), end(), Pos, CompEnd());
|
||||||
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