diff --git a/llvm/include/llvm/CodeGen/LiveRegUnits.h b/llvm/include/llvm/CodeGen/LiveRegUnits.h index d554493e629ed..e96165d6b3bbf 100644 --- a/llvm/include/llvm/CodeGen/LiveRegUnits.h +++ b/llvm/include/llvm/CodeGen/LiveRegUnits.h @@ -161,15 +161,15 @@ class LiveRegUnits { /// Returns an iterator range over all physical register and mask operands for /// \p MI and bundled instructions. This also skips any debug operands. -inline iterator_range>> +inline iterator_range< + filter_iterator> phys_regs_and_masks(const MachineInstr &MI) { - std::function Pred = - [](const MachineOperand &MOP) { - return MOP.isRegMask() || - (MOP.isReg() && !MOP.isDebug() && MOP.getReg().isPhysical()); - }; - return make_filter_range(const_mi_bundle_ops(MI), Pred); + auto Pred = [](const MachineOperand &MOP) { + return MOP.isRegMask() || + (MOP.isReg() && !MOP.isDebug() && MOP.getReg().isPhysical()); + }; + return make_filter_range(const_mi_bundle_ops(MI), + static_cast(Pred)); } } // end namespace llvm