mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-17 04:24:00 +00:00
Now that we have C++11, turn simple functors into lambdas and remove a ton of boilerplate.
No intended functionality change. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@202588 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@ -1724,17 +1724,6 @@ ARMPreAllocLoadStoreOpt::CanFormLdStDWord(MachineInstr *Op0, MachineInstr *Op1,
|
||||
return true;
|
||||
}
|
||||
|
||||
namespace {
|
||||
struct OffsetCompare {
|
||||
bool operator()(const MachineInstr *LHS, const MachineInstr *RHS) const {
|
||||
int LOffset = getMemoryOpOffset(LHS);
|
||||
int ROffset = getMemoryOpOffset(RHS);
|
||||
assert(LHS == RHS || LOffset != ROffset);
|
||||
return LOffset > ROffset;
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
bool ARMPreAllocLoadStoreOpt::RescheduleOps(MachineBasicBlock *MBB,
|
||||
SmallVectorImpl<MachineInstr *> &Ops,
|
||||
unsigned Base, bool isLd,
|
||||
@ -1742,7 +1731,13 @@ bool ARMPreAllocLoadStoreOpt::RescheduleOps(MachineBasicBlock *MBB,
|
||||
bool RetVal = false;
|
||||
|
||||
// Sort by offset (in reverse order).
|
||||
std::sort(Ops.begin(), Ops.end(), OffsetCompare());
|
||||
std::sort(Ops.begin(), Ops.end(),
|
||||
[](const MachineInstr *LHS, const MachineInstr *RHS) {
|
||||
int LOffset = getMemoryOpOffset(LHS);
|
||||
int ROffset = getMemoryOpOffset(RHS);
|
||||
assert(LHS == RHS || LOffset != ROffset);
|
||||
return LOffset > ROffset;
|
||||
});
|
||||
|
||||
// The loads / stores of the same base are in order. Scan them from first to
|
||||
// last and check for the following:
|
||||
|
Reference in New Issue
Block a user