From: Jun Zhang Date: Tue, 9 Aug 2022 15:59:05 +0000 (+0800) Subject: [LLVM] Use range based for loop, NFC X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=0981975ad0df31e3d57ee246607e23be75572eba;p=platform%2Fupstream%2Fllvm.git [LLVM] Use range based for loop, NFC Signed-off-by: Jun Zhang --- diff --git a/llvm/include/llvm/IR/PassManager.h b/llvm/include/llvm/IR/PassManager.h index a001e38..fa6be6a 100644 --- a/llvm/include/llvm/IR/PassManager.h +++ b/llvm/include/llvm/IR/PassManager.h @@ -507,24 +507,22 @@ public: detail::getAnalysisResult( AM, IR, std::tuple(ExtraArgs...)); - for (unsigned Idx = 0, Size = Passes.size(); Idx != Size; ++Idx) { - auto *P = Passes[Idx].get(); - + for (auto &Pass : Passes) { // Check the PassInstrumentation's BeforePass callbacks before running the // pass, skip its execution completely if asked to (callback returns // false). - if (!PI.runBeforePass(*P, IR)) + if (!PI.runBeforePass(*Pass, IR)) continue; PreservedAnalyses PassPA; { - TimeTraceScope TimeScope(P->name(), IR.getName()); - PassPA = P->run(IR, AM, ExtraArgs...); + TimeTraceScope TimeScope(Pass->name(), IR.getName()); + PassPA = Pass->run(IR, AM, ExtraArgs...); } // Call onto PassInstrumentation's AfterPass callbacks immediately after // running the pass. - PI.runAfterPass(*P, IR, PassPA); + PI.runAfterPass(*Pass, IR, PassPA); // Update the analysis manager as each pass runs and potentially // invalidates analyses.