* Make some methods more const correct.
* Change the FunctionCalls and AuxFunctionCalls vectors into std::lists.
This makes many operations on these lists much more natural, and avoids
*exteremely* expensive copying of DSCallSites (e.g. moving nodes around
between lists, erasing a node from not the end of the vector, etc).
With a profile build of analyze, this speeds up BU DS from 25.14s to
12.59s on 176.gcc. I expect that it would help TD even more, but I don't
have data for it.
This effectively eliminates removeIdenticalCalls and children from the
profile, going from 6.53 to 0.27s.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19939 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Analysis/DataStructure/Printer.cpp b/lib/Analysis/DataStructure/Printer.cpp
index 67d5c27..eb7319d 100644
--- a/lib/Analysis/DataStructure/Printer.cpp
+++ b/lib/Analysis/DataStructure/Printer.cpp
@@ -174,11 +174,12 @@
}
// Output all of the call nodes...
- const std::vector<DSCallSite> &FCs =
+ const std::list<DSCallSite> &FCs =
G->shouldPrintAuxCalls() ? G->getAuxFunctionCalls()
: G->getFunctionCalls();
- for (unsigned i = 0, e = FCs.size(); i != e; ++i) {
- const DSCallSite &Call = FCs[i];
+ for (std::list<DSCallSite>::const_iterator I = FCs.begin(), E = FCs.end();
+ I != E; ++I) {
+ const DSCallSite &Call = *I;
std::vector<std::string> EdgeSourceCaptions(Call.getNumPtrArgs()+2);
EdgeSourceCaptions[0] = "r";
if (Call.isDirectCall())