diff options
author | Chris Lattner <sabre@nondot.org> | 2004-02-07 23:57:26 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2004-02-07 23:57:26 +0000 |
commit | a84c6816375599a996501ce220eefb7939c23310 (patch) | |
tree | 05780d695ce6a6269b168b491e5dbf96b7d41e07 /lib | |
parent | e187d565207682978185624e8fcd8f2c9f31d290 (diff) | |
download | external_llvm-a84c6816375599a996501ce220eefb7939c23310.zip external_llvm-a84c6816375599a996501ce220eefb7939c23310.tar.gz external_llvm-a84c6816375599a996501ce220eefb7939c23310.tar.bz2 |
getNodes() is gone
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11166 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r-- | lib/Analysis/DataStructure/IPModRef.cpp | 42 | ||||
-rw-r--r-- | lib/Analysis/IPA/IPModRef.cpp | 42 |
2 files changed, 42 insertions, 42 deletions
diff --git a/lib/Analysis/DataStructure/IPModRef.cpp b/lib/Analysis/DataStructure/IPModRef.cpp index 01b5bd0..5e36527 100644 --- a/lib/Analysis/DataStructure/IPModRef.cpp +++ b/lib/Analysis/DataStructure/IPModRef.cpp @@ -63,8 +63,10 @@ FunctionModRefInfo::FunctionModRefInfo(const Function& func, funcTDGraph(tdgClone), funcModRefInfo(tdgClone->getGraphSize()) { - for (unsigned i=0, N = funcTDGraph->getGraphSize(); i < N; ++i) - NodeIds[funcTDGraph->getNodes()[i]] = i; + unsigned i = 0; + for (DSGraph::node_iterator NI = funcTDGraph->node_begin(), + E = funcTDGraph->node_end(); NI != E; ++NI) + NodeIds[*NI] = i++; } @@ -95,13 +97,12 @@ void FunctionModRefInfo::computeModRef(const Function &func) { // Mark all nodes in the graph that are marked MOD as being mod // and all those marked REF as being ref. - for (unsigned i = 0, N = funcTDGraph->getGraphSize(); i < N; ++i) - { - if (funcTDGraph->getNodes()[i]->isModified()) - funcModRefInfo.setNodeIsMod(i); - if (funcTDGraph->getNodes()[i]->isRead()) - funcModRefInfo.setNodeIsRef(i); - } + unsigned i = 0; + for (DSGraph::node_iterator NI = funcTDGraph->node_begin(), + E = funcTDGraph->node_end(); NI != E; ++NI, ++i) { + if ((*NI)->isModified()) funcModRefInfo.setNodeIsMod(i); + if ((*NI)->isRead()) funcModRefInfo.setNodeIsRef(i); + } // Compute the Mod/Ref info for all call sites within the function. // The call sites are recorded in the TD graph. @@ -214,18 +215,15 @@ FunctionModRefInfo::computeModRef(CallSite CS) } // For all nodes in the graph, extract the mod/ref information - const std::vector<DSNode*>& csgNodes = csgp->getNodes(); - const std::vector<DSNode*>& origNodes = funcTDGraph->getNodes(); - assert(csgNodes.size() == origNodes.size()); - for (unsigned i=0, N = origNodes.size(); i < N; ++i) - { - DSNode* csgNode = NodeMap[origNodes[i]].getNode(); - assert(csgNode && "Inlined and original graphs do not correspond!"); - if (csgNode->isModified()) - callModRefInfo->setNodeIsMod(getNodeId(origNodes[i])); - if (csgNode->isRead()) - callModRefInfo->setNodeIsRef(getNodeId(origNodes[i])); - } + for (DSGraph::node_iterator NI = funcTDGraph->node_begin(), + E = funcTDGraph->node_end(); NI != E; ++NI) { + DSNode* csgNode = NodeMap[*NI].getNode(); + assert(csgNode && "Inlined and original graphs do not correspond!"); + if (csgNode->isModified()) + callModRefInfo->setNodeIsMod(getNodeId(*NI)); + if (csgNode->isRead()) + callModRefInfo->setNodeIsRef(getNodeId(*NI)); + } // Drop nodemap before we delete the graph... NodeMap.clear(); @@ -295,8 +293,10 @@ public: O << std::string((j < NV-1)? "; " : "\n"); } +#if 0 else tdGraph.getNodes()[i]->print(O, /*graph*/ NULL); +#endif } } }; diff --git a/lib/Analysis/IPA/IPModRef.cpp b/lib/Analysis/IPA/IPModRef.cpp index 01b5bd0..5e36527 100644 --- a/lib/Analysis/IPA/IPModRef.cpp +++ b/lib/Analysis/IPA/IPModRef.cpp @@ -63,8 +63,10 @@ FunctionModRefInfo::FunctionModRefInfo(const Function& func, funcTDGraph(tdgClone), funcModRefInfo(tdgClone->getGraphSize()) { - for (unsigned i=0, N = funcTDGraph->getGraphSize(); i < N; ++i) - NodeIds[funcTDGraph->getNodes()[i]] = i; + unsigned i = 0; + for (DSGraph::node_iterator NI = funcTDGraph->node_begin(), + E = funcTDGraph->node_end(); NI != E; ++NI) + NodeIds[*NI] = i++; } @@ -95,13 +97,12 @@ void FunctionModRefInfo::computeModRef(const Function &func) { // Mark all nodes in the graph that are marked MOD as being mod // and all those marked REF as being ref. - for (unsigned i = 0, N = funcTDGraph->getGraphSize(); i < N; ++i) - { - if (funcTDGraph->getNodes()[i]->isModified()) - funcModRefInfo.setNodeIsMod(i); - if (funcTDGraph->getNodes()[i]->isRead()) - funcModRefInfo.setNodeIsRef(i); - } + unsigned i = 0; + for (DSGraph::node_iterator NI = funcTDGraph->node_begin(), + E = funcTDGraph->node_end(); NI != E; ++NI, ++i) { + if ((*NI)->isModified()) funcModRefInfo.setNodeIsMod(i); + if ((*NI)->isRead()) funcModRefInfo.setNodeIsRef(i); + } // Compute the Mod/Ref info for all call sites within the function. // The call sites are recorded in the TD graph. @@ -214,18 +215,15 @@ FunctionModRefInfo::computeModRef(CallSite CS) } // For all nodes in the graph, extract the mod/ref information - const std::vector<DSNode*>& csgNodes = csgp->getNodes(); - const std::vector<DSNode*>& origNodes = funcTDGraph->getNodes(); - assert(csgNodes.size() == origNodes.size()); - for (unsigned i=0, N = origNodes.size(); i < N; ++i) - { - DSNode* csgNode = NodeMap[origNodes[i]].getNode(); - assert(csgNode && "Inlined and original graphs do not correspond!"); - if (csgNode->isModified()) - callModRefInfo->setNodeIsMod(getNodeId(origNodes[i])); - if (csgNode->isRead()) - callModRefInfo->setNodeIsRef(getNodeId(origNodes[i])); - } + for (DSGraph::node_iterator NI = funcTDGraph->node_begin(), + E = funcTDGraph->node_end(); NI != E; ++NI) { + DSNode* csgNode = NodeMap[*NI].getNode(); + assert(csgNode && "Inlined and original graphs do not correspond!"); + if (csgNode->isModified()) + callModRefInfo->setNodeIsMod(getNodeId(*NI)); + if (csgNode->isRead()) + callModRefInfo->setNodeIsRef(getNodeId(*NI)); + } // Drop nodemap before we delete the graph... NodeMap.clear(); @@ -295,8 +293,10 @@ public: O << std::string((j < NV-1)? "; " : "\n"); } +#if 0 else tdGraph.getNodes()[i]->print(O, /*graph*/ NULL); +#endif } } }; |