Honor the shouldPrintAuxCalls flag

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4678 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Chris Lattner 2002-11-10 06:53:59 +00:00
parent 2a06886759
commit 4f7815f684

View File

@ -112,7 +112,9 @@ struct DOTGraphTraits<const DSGraph*> : public DefaultDOTGraphTraits {
} }
// Output all of the call nodes... // Output all of the call nodes...
const std::vector<DSCallSite> &FCs = G->getFunctionCalls(); const std::vector<DSCallSite> &FCs =
G->shouldPrintAuxCalls() ? G->getAuxFunctionCalls()
: G->getFunctionCalls();
for (unsigned i = 0, e = FCs.size(); i != e; ++i) { for (unsigned i = 0, e = FCs.size(); i != e; ++i) {
const DSCallSite &Call = FCs[i]; const DSCallSite &Call = FCs[i];
GW.emitSimpleNode(&Call, "shape=record", "call", Call.getNumPtrArgs()+2); GW.emitSimpleNode(&Call, "shape=record", "call", Call.getNumPtrArgs()+2);
@ -169,15 +171,18 @@ static void printCollection(const Collection &C, std::ostream &O,
unsigned TotalNumNodes = 0, TotalCallNodes = 0; unsigned TotalNumNodes = 0, TotalCallNodes = 0;
for (Module::const_iterator I = M->begin(), E = M->end(); I != E; ++I) for (Module::const_iterator I = M->begin(), E = M->end(); I != E; ++I)
if (!I->isExternal()) { if (C.hasGraph(*I)) {
DSGraph &Gr = C.getDSGraph((Function&)*I); DSGraph &Gr = C.getDSGraph((Function&)*I);
TotalNumNodes += Gr.getGraphSize(); TotalNumNodes += Gr.getGraphSize();
TotalCallNodes += Gr.getFunctionCalls().size(); unsigned NumCalls = Gr.shouldPrintAuxCalls() ?
Gr.getAuxFunctionCalls().size() : Gr.getFunctionCalls().size();
TotalCallNodes += NumCalls;
if (I->getName() == "main" || !OnlyPrintMain) if (I->getName() == "main" || !OnlyPrintMain)
Gr.writeGraphToFile(O, Prefix+I->getName()); Gr.writeGraphToFile(O, Prefix+I->getName());
else { else {
O << "Skipped Writing '" << Prefix+I->getName() << ".dot'... [" O << "Skipped Writing '" << Prefix+I->getName() << ".dot'... ["
<< Gr.getGraphSize() << "+" << Gr.getFunctionCalls().size() << "]\n"; << Gr.getGraphSize() << "+" << NumCalls << "]\n";
} }
} }