From 9880d8eb9c4886c092991a2142490746faf956ea Mon Sep 17 00:00:00 2001 From: Erik Eckstein Date: Mon, 25 Sep 2017 12:57:43 -0700 Subject: [PATCH] Fix output of function name in crash trace. In the crash output 'While running pass #x SILFunctionTransform "T" on SILFunction "@F".' we printed the previous function which was handled by the pass instead of the current one. --- lib/SILOptimizer/PassManager/PassManager.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/lib/SILOptimizer/PassManager/PassManager.cpp b/lib/SILOptimizer/PassManager/PassManager.cpp index cf413e4553dfb..736ca5462800a 100644 --- a/lib/SILOptimizer/PassManager/PassManager.cpp +++ b/lib/SILOptimizer/PassManager/PassManager.cpp @@ -291,12 +291,12 @@ void SILPassManager::runPassOnFunction(SILFunctionTransform *SFT, assert(analysesUnlocked() && "Expected all analyses to be unlocked!"); - PrettyStackTraceSILFunctionTransform X(SFT, NumPassesRun); - DebugPrintEnabler DebugPrint(NumPassesRun); - SFT->injectPassManager(this); SFT->injectFunction(F); + PrettyStackTraceSILFunctionTransform X(SFT, NumPassesRun); + DebugPrintEnabler DebugPrint(NumPassesRun); + // If nothing changed since the last run of this pass, we can skip this // pass. CompletedPasses &completedPasses = CompletedPassesMap[F]; @@ -440,12 +440,12 @@ void SILPassManager::runModulePass(SILModuleTransform *SMT) { const SILOptions &Options = getOptions(); - PrettyStackTraceSILModuleTransform X(SMT, NumPassesRun); - DebugPrintEnabler DebugPrint(NumPassesRun); - SMT->injectPassManager(this); SMT->injectModule(Mod); + PrettyStackTraceSILModuleTransform X(SMT, NumPassesRun); + DebugPrintEnabler DebugPrint(NumPassesRun); + updateSILModuleStatsBeforeTransform(*Mod, SMT, *this, NumPassesRun); CurrentPassHasInvalidated = false;