mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-11-25 04:02:41 +01:00
[llvm] Use llvm::is_sorted (NFC)
This commit is contained in:
parent
3902d5e888
commit
607e84883f
@ -297,12 +297,11 @@ char ARMConstantIslands::ID = 0;
|
||||
void ARMConstantIslands::verify() {
|
||||
#ifndef NDEBUG
|
||||
BBInfoVector &BBInfo = BBUtils->getBBInfo();
|
||||
assert(std::is_sorted(MF->begin(), MF->end(),
|
||||
[&BBInfo](const MachineBasicBlock &LHS,
|
||||
assert(is_sorted(*MF, [&BBInfo](const MachineBasicBlock &LHS,
|
||||
const MachineBasicBlock &RHS) {
|
||||
return BBInfo[LHS.getNumber()].postOffset() <
|
||||
BBInfo[RHS.getNumber()].postOffset();
|
||||
}));
|
||||
return BBInfo[LHS.getNumber()].postOffset() <
|
||||
BBInfo[RHS.getNumber()].postOffset();
|
||||
}));
|
||||
LLVM_DEBUG(dbgs() << "Verifying " << CPUsers.size() << " CP users.\n");
|
||||
for (unsigned i = 0, e = CPUsers.size(); i != e; ++i) {
|
||||
CPUser &U = CPUsers[i];
|
||||
|
@ -807,11 +807,11 @@ void ARMInstPrinter::printRegisterList(const MCInst *MI, unsigned OpNum,
|
||||
const MCSubtargetInfo &STI,
|
||||
raw_ostream &O) {
|
||||
if (MI->getOpcode() != ARM::t2CLRM) {
|
||||
assert(std::is_sorted(MI->begin() + OpNum, MI->end(),
|
||||
[&](const MCOperand &LHS, const MCOperand &RHS) {
|
||||
return MRI.getEncodingValue(LHS.getReg()) <
|
||||
MRI.getEncodingValue(RHS.getReg());
|
||||
}));
|
||||
assert(is_sorted(drop_begin(*MI, OpNum),
|
||||
[&](const MCOperand &LHS, const MCOperand &RHS) {
|
||||
return MRI.getEncodingValue(LHS.getReg()) <
|
||||
MRI.getEncodingValue(RHS.getReg());
|
||||
}));
|
||||
}
|
||||
|
||||
O << "{";
|
||||
|
@ -1730,11 +1730,11 @@ getRegisterListOpValue(const MCInst &MI, unsigned Op,
|
||||
Binary |= NumRegs * 2;
|
||||
} else {
|
||||
const MCRegisterInfo &MRI = *CTX.getRegisterInfo();
|
||||
assert(std::is_sorted(MI.begin() + Op, MI.end(),
|
||||
[&](const MCOperand &LHS, const MCOperand &RHS) {
|
||||
return MRI.getEncodingValue(LHS.getReg()) <
|
||||
assert(is_sorted(drop_begin(MI, Op),
|
||||
[&](const MCOperand &LHS, const MCOperand &RHS) {
|
||||
return MRI.getEncodingValue(LHS.getReg()) <
|
||||
MRI.getEncodingValue(RHS.getReg());
|
||||
}));
|
||||
}));
|
||||
for (unsigned I = Op, E = MI.getNumOperands(); I < E; ++I) {
|
||||
unsigned RegNo = MRI.getEncodingValue(MI.getOperand(I).getReg());
|
||||
Binary |= 1 << RegNo;
|
||||
|
@ -610,7 +610,7 @@ static int Lookup(ArrayRef<TableEntry> Table, unsigned Opcode) {
|
||||
{ \
|
||||
static std::atomic<bool> TABLE##Checked(false); \
|
||||
if (!TABLE##Checked.load(std::memory_order_relaxed)) { \
|
||||
assert(std::is_sorted(std::begin(TABLE), std::end(TABLE)) && \
|
||||
assert(is_sorted(TABLE) && \
|
||||
"All lookup tables must be sorted for efficient access!"); \
|
||||
TABLE##Checked.store(true, std::memory_order_relaxed); \
|
||||
} \
|
||||
|
Loading…
Reference in New Issue
Block a user