llvm.org GIT mirror llvm / df13080
[PM] Remove the underspecified 'getRoot' method from CallGraph. It's only user was an ancient SCC printing bit of the opt tool which really should be walking the call graph the same way the CGSCC pass manager does. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@195800 91177308-0d34-0410-b5e6-96231b3b80d8 Chandler Carruth 5 years ago
2 changed file(s) with 3 addition(s) and 13 deletion(s). Raw diff Collapse all Expand all
141141
142142 CallGraphNode *getCallsExternalNode() const { return CallsExternalNode; }
143143
144 /// \brief Returns the root/main method in the module, or some other root
145 /// node, such as the externalcallingnode.
146 CallGraphNode *getRoot() { return Root; }
147 const CallGraphNode *getRoot() const { return Root; }
148
149144 //===---------------------------------------------------------------------
150145 // Functions to keep a call graph up to date with a function that has been
151146 // modified.
341336 return G->getCallsExternalNode();
342337 }
343338
344 /// \brief Returns the root/main method in the module, or some other root
345 /// node, such as the externalcallingnode.
346 CallGraphNode *getRoot() { return G->getRoot(); }
347 const CallGraphNode *getRoot() const { return G->getRoot(); }
348
349339 //===---------------------------------------------------------------------
350340 // Functions to keep a call graph up to date with a function that has been
351341 // modified.
9191
9292 // run - Print out SCCs in the call graph for the specified module.
9393 bool CallGraphSCC::runOnModule(Module &M) {
94 CallGraphNode *rootNode = getAnalysis().getRoot();
94 CallGraph &CG = getAnalysis().getCallGraph();
9595 unsigned sccNum = 0;
9696 errs() << "SCCs for the program in PostOrder:";
97 for (scc_iterator SCCI = scc_begin(rootNode),
98 E = scc_end(rootNode); SCCI != E; ++SCCI) {
97 for (scc_iterator SCCI = scc_begin(&CG),
98 E = scc_end(&CG); SCCI != E; ++SCCI) {
9999 const std::vector &nextSCC = *SCCI;
100100 errs() << "\nSCC #" << ++sccNum << " : ";
101101 for (std::vector::const_iterator I = nextSCC.begin(),