aboutsummaryrefslogtreecommitdiff
path: root/lib/Analysis/IPA/CallGraphSCCPass.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2009-09-15 05:03:04 +0000
committerChris Lattner <sabre@nondot.org>2009-09-15 05:03:04 +0000
commit9554c613282c28fbe94bc8b0a5ba736f046643b8 (patch)
tree478d7169a7b8ab7c1adaa975a290c1b5c8297fd3 /lib/Analysis/IPA/CallGraphSCCPass.cpp
parent745c9be986bce1fb99fdbad6b9ae1307586c04a2 (diff)
make -debug-pass=Executions show information about what call graph nodes
are in the SCC for each execution of a CGSCC pass. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81838 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Analysis/IPA/CallGraphSCCPass.cpp')
-rw-r--r--lib/Analysis/IPA/CallGraphSCCPass.cpp15
1 files changed, 14 insertions, 1 deletions
diff --git a/lib/Analysis/IPA/CallGraphSCCPass.cpp b/lib/Analysis/IPA/CallGraphSCCPass.cpp
index e4e0ecb2c9..801ae1952c 100644
--- a/lib/Analysis/IPA/CallGraphSCCPass.cpp
+++ b/lib/Analysis/IPA/CallGraphSCCPass.cpp
@@ -317,7 +317,20 @@ bool CGPassManager::runOnModule(Module &M) {
PassNo != e; ++PassNo) {
Pass *P = getContainedPass(PassNo);
- dumpPassInfo(P, EXECUTION_MSG, ON_CG_MSG, "");
+ // If we're in -debug-pass=Executions mode, construct the SCC node list,
+ // otherwise avoid constructing this string as it is expensive.
+ if (isPassDebuggingExecutionsOrMore()) {
+ std::string Functions;
+#ifndef NDEBUG
+ raw_string_ostream OS(Functions);
+ for (unsigned i = 0, e = CurSCC.size(); i != e; ++i) {
+ if (i) OS << ", ";
+ CurSCC[i]->print(OS);
+ }
+ OS.flush();
+#endif
+ dumpPassInfo(P, EXECUTION_MSG, ON_CG_MSG, Functions);
+ }
dumpRequiredSet(P);
initializeAnalysisImpl(P);