From 003a559633d2ec060d37b7f6657d82da72f5107d Mon Sep 17 00:00:00 2001 From: Devang Patel Date: Mon, 5 Mar 2007 20:01:30 +0000 Subject: Avoid constructing std::strings unless pass debugging is ON. llvm-svn: 34933 --- llvm/lib/Analysis/IPA/CallGraphSCCPass.cpp | 15 +++++---------- llvm/lib/Analysis/LoopPass.cpp | 10 +++------- 2 files changed, 8 insertions(+), 17 deletions(-) (limited to 'llvm/lib/Analysis') diff --git a/llvm/lib/Analysis/IPA/CallGraphSCCPass.cpp b/llvm/lib/Analysis/IPA/CallGraphSCCPass.cpp index c317a112f5a..fcf42028264 100644 --- a/llvm/lib/Analysis/IPA/CallGraphSCCPass.cpp +++ b/llvm/lib/Analysis/IPA/CallGraphSCCPass.cpp @@ -77,9 +77,6 @@ bool CGPassManager::runOnModule(Module &M) { CallGraph &CG = getAnalysis(); bool Changed = doInitialization(CG); - std::string Msg1 = "Executing Pass '"; - std::string Msg3 = "' Made Modification '"; - // Walk SCC for (scc_iterator I = scc_begin(&CG), E = scc_end(&CG); I != E; ++I) { @@ -91,8 +88,7 @@ bool CGPassManager::runOnModule(Module &M) { AnalysisUsage AnUsage; P->getAnalysisUsage(AnUsage); - std::string Msg2 = "' on Call Graph ...\n'"; - dumpPassInfo(P, Msg1, Msg2); + dumpPassInfo(P, EXECUTION_MSG, ON_CG_MSG, ""); dumpAnalysisSetInfo("Required", P, AnUsage.getRequiredSet()); initializeAnalysisImpl(P); @@ -109,21 +105,20 @@ bool CGPassManager::runOnModule(Module &M) { for (unsigned i = 0, e = SCC.size(); i != e; ++i) { Function *F = SCC[i]->getFunction(); if (F) { - std::string Msg4 = "' on Function '" + F->getName() + "'...\n"; - dumpPassInfo(P, Msg1, Msg4); - Changed |= FPP->runOnFunction(*F); + dumpPassInfo(P, EXECUTION_MSG, ON_FUNCTION_MSG, F->getName()); + Changed |= FPP->runOnFunction(*F); } } } StopPassTimer(P); if (Changed) - dumpPassInfo(P, Msg3, Msg2); + dumpPassInfo(P, MODIFICATION_MSG, ON_CG_MSG, ""); dumpAnalysisSetInfo("Preserved", P, AnUsage.getPreservedSet()); removeNotPreservedAnalysis(P); recordAvailableAnalysis(P); - removeDeadPasses(P, Msg2); + removeDeadPasses(P, "", ON_CG_MSG); } } Changed |= doFinalization(CG); diff --git a/llvm/lib/Analysis/LoopPass.cpp b/llvm/lib/Analysis/LoopPass.cpp index 4d2e2906082..40b38f37930 100644 --- a/llvm/lib/Analysis/LoopPass.cpp +++ b/llvm/lib/Analysis/LoopPass.cpp @@ -91,9 +91,6 @@ bool LPPassManager::runOnFunction(Function &F) { for (LoopInfo::iterator I = LI.begin(), E = LI.end(); I != E; ++I) addLoopIntoQueue(*I, LQ); - std::string Msg1 = "Executing Pass '"; - std::string Msg3 = "' Made Modification '"; - // Walk Loops while (!LQ->empty()) { @@ -108,8 +105,7 @@ bool LPPassManager::runOnFunction(Function &F) { AnalysisUsage AnUsage; P->getAnalysisUsage(AnUsage); - std::string Msg2 = "' on Loop ...\n'"; - dumpPassInfo(P, Msg1, Msg2); + dumpPassInfo(P, EXECUTION_MSG, ON_LOOP_MSG, ""); dumpAnalysisSetInfo("Required", P, AnUsage.getRequiredSet()); initializeAnalysisImpl(P); @@ -121,12 +117,12 @@ bool LPPassManager::runOnFunction(Function &F) { StopPassTimer(P); if (Changed) - dumpPassInfo(P, Msg3, Msg2); + dumpPassInfo(P, MODIFICATION_MSG, ON_LOOP_MSG, ""); dumpAnalysisSetInfo("Preserved", P, AnUsage.getPreservedSet()); removeNotPreservedAnalysis(P); recordAvailableAnalysis(P); - removeDeadPasses(P, Msg2); + removeDeadPasses(P, "", ON_LOOP_MSG); if (skipThisLoop) // Do not run other passes on this loop. -- cgit v1.2.3