[llvm] r195800 - [PM] Remove the underspecified 'getRoot' method from CallGraph. It's

Chandler Carruth chandlerc at gmail.com
Tue Nov 26 17:32:18 PST 2013


Author: chandlerc
Date: Tue Nov 26 19:32:17 2013
New Revision: 195800

URL: http://llvm.org/viewvc/llvm-project?rev=195800&view=rev
Log:
[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.

Modified:
    llvm/trunk/include/llvm/Analysis/CallGraph.h
    llvm/trunk/tools/opt/PrintSCC.cpp

Modified: llvm/trunk/include/llvm/Analysis/CallGraph.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Analysis/CallGraph.h?rev=195800&r1=195799&r2=195800&view=diff
==============================================================================
--- llvm/trunk/include/llvm/Analysis/CallGraph.h (original)
+++ llvm/trunk/include/llvm/Analysis/CallGraph.h Tue Nov 26 19:32:17 2013
@@ -142,11 +142,6 @@ public:
 
   CallGraphNode *getCallsExternalNode() const { return CallsExternalNode; }
 
-  /// \brief Returns the root/main method in the module, or some other root
-  /// node, such as the externalcallingnode.
-  CallGraphNode *getRoot() { return Root; }
-  const CallGraphNode *getRoot() const { return Root; }
-
   //===---------------------------------------------------------------------
   // Functions to keep a call graph up to date with a function that has been
   // modified.
@@ -342,11 +337,6 @@ public:
     return G->getCallsExternalNode();
   }
 
-  /// \brief Returns the root/main method in the module, or some other root
-  /// node, such as the externalcallingnode.
-  CallGraphNode *getRoot() { return G->getRoot(); }
-  const CallGraphNode *getRoot() const { return G->getRoot(); }
-
   //===---------------------------------------------------------------------
   // Functions to keep a call graph up to date with a function that has been
   // modified.

Modified: llvm/trunk/tools/opt/PrintSCC.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/opt/PrintSCC.cpp?rev=195800&r1=195799&r2=195800&view=diff
==============================================================================
--- llvm/trunk/tools/opt/PrintSCC.cpp (original)
+++ llvm/trunk/tools/opt/PrintSCC.cpp Tue Nov 26 19:32:17 2013
@@ -92,11 +92,11 @@ bool CFGSCC::runOnFunction(Function &F)
 
 // run - Print out SCCs in the call graph for the specified module.
 bool CallGraphSCC::runOnModule(Module &M) {
-  CallGraphNode *rootNode = getAnalysis<CallGraphWrapperPass>().getRoot();
+  CallGraph &CG = getAnalysis<CallGraphWrapperPass>().getCallGraph();
   unsigned sccNum = 0;
   errs() << "SCCs for the program in PostOrder:";
-  for (scc_iterator<CallGraphNode*> SCCI = scc_begin(rootNode),
-         E = scc_end(rootNode); SCCI != E; ++SCCI) {
+  for (scc_iterator<CallGraph*> SCCI = scc_begin(&CG),
+         E = scc_end(&CG); SCCI != E; ++SCCI) {
     const std::vector<CallGraphNode*> &nextSCC = *SCCI;
     errs() << "\nSCC #" << ++sccNum << " : ";
     for (std::vector<CallGraphNode*>::const_iterator I = nextSCC.begin(),





More information about the llvm-commits mailing list