diff options
author | Chris Lattner <sabre@nondot.org> | 2005-02-01 19:10:48 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2005-02-01 19:10:48 +0000 |
commit | 63a46cee874b464ea6964eb4b06fc33852ec1548 (patch) | |
tree | 4a16ce81b5144ec9442a94d908afb8a89cf19260 /llvm | |
parent | 4487b2e5a681b9989b21f4d31cc99398a8a58c34 (diff) | |
download | bcm5719-llvm-63a46cee874b464ea6964eb4b06fc33852ec1548.tar.gz bcm5719-llvm-63a46cee874b464ea6964eb4b06fc33852ec1548.zip |
Signficantly speed up printing by not emitting the same file twice with
different names. Large SCC's tend to be big, so this saves a lot of time.
llvm-svn: 19970
Diffstat (limited to 'llvm')
-rw-r--r-- | llvm/lib/Analysis/DataStructure/Printer.cpp | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/llvm/lib/Analysis/DataStructure/Printer.cpp b/llvm/lib/Analysis/DataStructure/Printer.cpp index eb7319df9ce..4d5fa81425e 100644 --- a/llvm/lib/Analysis/DataStructure/Printer.cpp +++ b/llvm/lib/Analysis/DataStructure/Printer.cpp @@ -274,9 +274,15 @@ static void printCollection(const Collection &C, std::ostream &O, Gr.getAuxFunctionCalls().size() : Gr.getFunctionCalls().size(); TotalCallNodes += NumCalls; - if (I->getName() == "main" || !OnlyPrintMain) - Gr.writeGraphToFile(O, Prefix+I->getName()); - else { + if (I->getName() == "main" || !OnlyPrintMain) { + Function *SCCFn = Gr.getReturnNodes().begin()->first; + if (&*I == SCCFn) + Gr.writeGraphToFile(O, Prefix+I->getName()); + else + O << "Didn't write '" << Prefix+I->getName() + << ".dot' - Graph already emitted to '" << Prefix+SCCFn->getName() + << "\n"; + } else { O << "Skipped Writing '" << Prefix+I->getName() << ".dot'... [" << Gr.getGraphSize() << "+" << NumCalls << "]\n"; } |