Skip to content

Commit 1ecc291

Browse files
[RISCV] Use llvm::is_contained (NFC) (llvm#141372)
1 parent fb14c83 commit 1ecc291

File tree

1 file changed

+5
-11
lines changed

1 file changed

+5
-11
lines changed

llvm/lib/Target/RISCV/RISCVFrameLowering.cpp

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -573,16 +573,12 @@ getPushOrLibCallsSavedInfo(const MachineFunction &MF,
573573
// `QC.CM.PUSH(FP)`. In these cases, prioritise the CFI info that points
574574
// to the versions saved by `QC.C.MIENTER(.NEST)` which is what FP
575575
// unwinding would use.
576-
const auto *FII = llvm::find_if(FixedCSRFIQCIInterruptMap, [&](auto P) {
577-
return P.first == CS.getReg();
578-
});
579-
if (FII != std::end(FixedCSRFIQCIInterruptMap))
576+
if (llvm::is_contained(llvm::make_first_range(FixedCSRFIQCIInterruptMap),
577+
CS.getReg()))
580578
continue;
581579
}
582580

583-
const auto *FII = llvm::find_if(
584-
FixedCSRFIMap, [&](MCPhysReg P) { return P == CS.getReg(); });
585-
if (FII != std::end(FixedCSRFIMap))
581+
if (llvm::is_contained(FixedCSRFIMap, CS.getReg()))
586582
PushOrLibCallsCSI.push_back(CS);
587583
}
588584

@@ -599,10 +595,8 @@ getQCISavedInfo(const MachineFunction &MF,
599595
return QCIInterruptCSI;
600596

601597
for (const auto &CS : CSI) {
602-
const auto *FII = llvm::find_if(FixedCSRFIQCIInterruptMap, [&](auto P) {
603-
return P.first == CS.getReg();
604-
});
605-
if (FII != std::end(FixedCSRFIQCIInterruptMap))
598+
if (llvm::is_contained(llvm::make_first_range(FixedCSRFIQCIInterruptMap),
599+
CS.getReg()))
606600
QCIInterruptCSI.push_back(CS);
607601
}
608602

0 commit comments

Comments
 (0)