mirror of
https://github.com/intel/llvm.git
synced 2026-01-23 07:58:23 +08:00
[BOLT][NFC] Use llvm::reverse
Use llvm::reverse instead of `for (auto I = rbegin(), E = rend(); I != E; ++I)` Reviewed By: #bolt, rafauler Differential Revision: https://reviews.llvm.org/D140516
This commit is contained in:
@@ -198,14 +198,13 @@ int32_t BinaryBasicBlock::getCFIStateAtInstr(const MCInst *Instr) const {
|
||||
// Find the last CFI preceding Instr in this basic block.
|
||||
const MCInst *LastCFI = nullptr;
|
||||
bool InstrSeen = (Instr == nullptr);
|
||||
for (auto RII = Instructions.rbegin(), E = Instructions.rend(); RII != E;
|
||||
++RII) {
|
||||
for (const MCInst &Inst : llvm::reverse(Instructions)) {
|
||||
if (!InstrSeen) {
|
||||
InstrSeen = (&*RII == Instr);
|
||||
InstrSeen = (&Inst == Instr);
|
||||
continue;
|
||||
}
|
||||
if (Function->getBinaryContext().MIB->isCFI(*RII)) {
|
||||
LastCFI = &*RII;
|
||||
if (Function->getBinaryContext().MIB->isCFI(Inst)) {
|
||||
LastCFI = &Inst;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user