diff options
author | Jessica Paquette <jpaquette@apple.com> | 2017-12-18 21:44:52 +0000 |
---|---|---|
committer | Jessica Paquette <jpaquette@apple.com> | 2017-12-18 21:44:52 +0000 |
commit | 8565d3af84a6afd4d7d4be4d8f3f9f39025404b9 (patch) | |
tree | 880b285144da90a0434093a99c0c6a0498d566d0 /llvm | |
parent | 48fff998f672e0469c604f516410f3826ee78e85 (diff) | |
download | bcm5719-llvm-8565d3af84a6afd4d7d4be4d8f3f9f39025404b9.tar.gz bcm5719-llvm-8565d3af84a6afd4d7d4be4d8f3f9f39025404b9.zip |
[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.
llvm-svn: 321028
Diffstat (limited to 'llvm')
-rw-r--r-- | llvm/lib/Target/AArch64/AArch64InstrInfo.cpp | 13 |
1 files changed, 3 insertions, 10 deletions
diff --git a/llvm/lib/Target/AArch64/AArch64InstrInfo.cpp b/llvm/lib/Target/AArch64/AArch64InstrInfo.cpp index c7c560a8132..abbba7d1d5a 100644 --- a/llvm/lib/Target/AArch64/AArch64InstrInfo.cpp +++ b/llvm/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); |