diff options
author | Chris Lattner <sabre@nondot.org> | 2005-03-15 16:55:04 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2005-03-15 16:55:04 +0000 |
commit | a5f47ea23d274527bdbe461d69bc63c82416d685 (patch) | |
tree | 8e016795cc6bb8fbeeebae13f95dfbce435c2140 /lib/Analysis/DataStructure/Printer.cpp | |
parent | 60cc3e1c4ee03ae6ed6614a58a6001cbcd037963 (diff) |
Start using retnodes_* for iteration.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20618 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Analysis/DataStructure/Printer.cpp')
-rw-r--r-- | lib/Analysis/DataStructure/Printer.cpp | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/lib/Analysis/DataStructure/Printer.cpp b/lib/Analysis/DataStructure/Printer.cpp index ee143f6689..05fba215d5 100644 --- a/lib/Analysis/DataStructure/Printer.cpp +++ b/lib/Analysis/DataStructure/Printer.cpp @@ -44,8 +44,8 @@ static std::string getCaption(const DSNode *N, const DSGraph *G) { if (!G) G = N->getParentGraph(); // Get the module from ONE of the functions in the graph it is available. - if (G && !G->getReturnNodes().empty()) - M = G->getReturnNodes().begin()->first->getParent(); + if (G && G->retnodes_begin() != G->retnodes_end()) + M = G->retnodes_begin()->first->getParent(); if (M == 0 && G) { // If there is a global in the graph, we can use it to find the module. const DSScalarMap &SM = G->getScalarMap(); @@ -126,8 +126,8 @@ struct DOTGraphTraits<const DSGraph*> : public DefaultDOTGraphTraits { static void addCustomGraphFeatures(const DSGraph *G, GraphWriter<const DSGraph*> &GW) { Module *CurMod = 0; - if (!G->getReturnNodes().empty()) - CurMod = G->getReturnNodes().begin()->first->getParent(); + if (G->retnodes_begin() != G->retnodes_end()) + CurMod = G->retnodes_begin()->first->getParent(); else { // If there is a global in the graph, we can use it to find the module. const DSScalarMap &SM = G->getScalarMap(); @@ -154,12 +154,11 @@ struct DOTGraphTraits<const DSGraph*> : public DefaultDOTGraphTraits { // Output the returned value pointer... - const DSGraph::ReturnNodesTy &RetNodes = G->getReturnNodes(); - for (DSGraph::ReturnNodesTy::const_iterator I = RetNodes.begin(), - E = RetNodes.end(); I != E; ++I) + for (DSGraph::retnodes_iterator I = G->retnodes_begin(), + E = G->retnodes_end(); I != E; ++I) if (I->second.getNode()) { std::string Label; - if (RetNodes.size() == 1) + if (G->getReturnNodes().size() == 1) Label = "returning"; else Label = I->first->getName() + " ret node"; @@ -276,7 +275,7 @@ static void printCollection(const Collection &C, std::ostream &O, TotalCallNodes += NumCalls; if (I->getName() == "main" || !OnlyPrintMain) { - Function *SCCFn = Gr.getReturnNodes().begin()->first; + Function *SCCFn = Gr.retnodes_begin()->first; if (&*I == SCCFn) Gr.writeGraphToFile(O, Prefix+I->getName()); else |