From: Jessica Paquette Date: Mon, 18 Dec 2017 21:44:52 +0000 (+0000) Subject: [MachineOutliner][NFC] Gardening: use std::any_of instead of bool + loop X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=2bd867a1c6f62f360ae95bf3fb10baa6fa30534c;p=llvm [MachineOutliner][NFC] Gardening: use std::any_of instead of bool + loop River Riddle suggested to use std::any_of instead of the bool + loop thing on r320229. This commit does that. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@321028 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Target/AArch64/AArch64InstrInfo.cpp b/lib/Target/AArch64/AArch64InstrInfo.cpp index c7c560a8132..abbba7d1d5a 100644 --- a/lib/Target/AArch64/AArch64InstrInfo.cpp +++ b/lib/Target/AArch64/AArch64InstrInfo.cpp @@ -4963,16 +4963,9 @@ void AArch64InstrInfo::insertOutlinerEpilogue( MachineBasicBlock &MBB, MachineFunction &MF, const MachineOutlinerInfo &MInfo) const { - bool ContainsCalls = false; - - for (MachineInstr &MI : MBB) { - if (MI.isCall()) { - ContainsCalls = true; - break; - } - } - - if (ContainsCalls) { + // Is there a call in the outlined range? + if (std::any_of(MBB.instr_begin(), MBB.instr_end(), + [](MachineInstr &MI) { return MI.isCall(); })) { // Fix up the instructions in the range, since we're going to modify the // stack. fixupPostOutline(MBB);