summaryrefslogtreecommitdiffstats
path: root/llvm/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
commitd4d966f5008202c188addb5573b578a8dbc7e37c (patch)
treeff29a2212869a01177930cbce21bb59e1336cce3 /llvm/lib/Analysis/IPA/CallGraphSCCPass.cpp
parent7cd39e07215159ed749ddd9fc1611008a2addade (diff)
downloadbcm5719-llvm-d4d966f5008202c188addb5573b578a8dbc7e37c.tar.gz
bcm5719-llvm-d4d966f5008202c188addb5573b578a8dbc7e37c.zip
make -debug-pass=Executions show information about what call graph nodes
are in the SCC for each execution of a CGSCC pass. llvm-svn: 81838
Diffstat (limited to 'llvm/lib/Analysis/IPA/CallGraphSCCPass.cpp')
-rw-r--r--llvm/lib/Analysis/IPA/CallGraphSCCPass.cpp15
1 files changed, 14 insertions, 1 deletions
diff --git a/llvm/lib/Analysis/IPA/CallGraphSCCPass.cpp b/llvm/lib/Analysis/IPA/CallGraphSCCPass.cpp
index e4e0ecb2c9a..801ae1952cb 100644
--- a/llvm/lib/Analysis/IPA/CallGraphSCCPass.cpp
+++ b/llvm/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);
OpenPOWER on IntegriCloud