Index: llvm/lib/Transforms/IPO/Attributor.cpp =================================================================== --- llvm/lib/Transforms/IPO/Attributor.cpp +++ llvm/lib/Transforms/IPO/Attributor.cpp @@ -136,6 +136,12 @@ static cl::opt<int> MaxHeapToStackSize("max-heap-to-stack-size", cl::init(128), cl::Hidden); +static const unsigned CallLikeOpcodes[] = { + Instruction::Invoke, Instruction::CallBr, + Instruction::Call, Instruction::CleanupRet, + Instruction::CatchSwitch, Instruction::Resume +}; + /// Logic operators for the change status enum class. /// ///{ @@ -788,11 +794,6 @@ /// See AbstractAttribute::updateImpl(...). ChangeStatus updateImpl(Attributor &A) override { - auto Opcodes = { - (unsigned)Instruction::Invoke, (unsigned)Instruction::CallBr, - (unsigned)Instruction::Call, (unsigned)Instruction::CleanupRet, - (unsigned)Instruction::CatchSwitch, (unsigned)Instruction::Resume}; - auto CheckForNoUnwind = [&](Instruction &I) { if (!I.mayThrow()) return true; @@ -805,7 +806,7 @@ return false; }; - if (!A.checkForAllInstructions(CheckForNoUnwind, *this, Opcodes)) + if (!A.checkForAllInstructions(CheckForNoUnwind, *this, CallLikeOpcodes)) return indicatePessimisticFixpoint(); return ChangeStatus::UNCHANGED;