detail::getAnalysisResult<PassInstrumentationAnalysis>(
AM, IR, std::tuple<ExtraArgTs...>(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<IRUnitT>(*P, IR))
+ if (!PI.runBeforePass<IRUnitT>(*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<IRUnitT>(*P, IR, PassPA);
+ PI.runAfterPass<IRUnitT>(*Pass, IR, PassPA);
// Update the analysis manager as each pass runs and potentially
// invalidates analyses.