File tree Expand file tree Collapse file tree 1 file changed +9
-4
lines changed Expand file tree Collapse file tree 1 file changed +9
-4
lines changed Original file line number Diff line number Diff line change @@ -642,11 +642,16 @@ void IGCPassManager::add(Pass *P)
642
642
}
643
643
644
644
// Skip adding a printer pass for analysis passes.
645
- const PassInfo* PI = Pass::lookupPassInfo (P->getPassID ());
646
- bool isAnalysisPass = PI && PI->isAnalysis ();
647
645
std::string pname (P->getPassName ().str ());
646
+ auto isAnalysisPass = [&]() {
647
+ const PassInfo* PI = Pass::lookupPassInfo (P->getPassID ());
648
+ if (PI && PI->isAnalysis ())
649
+ return true ;
650
+ else
651
+ return false ; // unknown or not an analysis pass
652
+ }();
648
653
649
- if (PI && !isAnalysisPass && isPrintBefore (P))
654
+ if (!isAnalysisPass && isPrintBefore (P))
650
655
{
651
656
addPrintPass (P, true );
652
657
}
@@ -663,7 +668,7 @@ void IGCPassManager::add(Pass *P)
663
668
PassManager::add (createTimeStatsIGCPass (m_pContext, m_name + ' _' + pname, STATS_COUNTER_END));
664
669
}
665
670
666
- if (PI && !isAnalysisPass && isPrintAfter (P))
671
+ if (!isAnalysisPass && isPrintAfter (P))
667
672
{
668
673
addPrintPass (P, false );
669
674
}
You can’t perform that action at this time.
0 commit comments