diff --git a/include/llvm/Analysis/CallGraph.h b/include/llvm/Analysis/CallGraph.h index 803c0dfaaba2..e80501555b2c 100644 --- a/include/llvm/Analysis/CallGraph.h +++ b/include/llvm/Analysis/CallGraph.h @@ -142,11 +142,6 @@ class CallGraph { 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 @@ class CallGraphWrapperPass : public ModulePass { 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. diff --git a/tools/opt/PrintSCC.cpp b/tools/opt/PrintSCC.cpp index 348b5f21ce4e..9322cbceec32 100644 --- a/tools/opt/PrintSCC.cpp +++ b/tools/opt/PrintSCC.cpp @@ -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().getRoot(); + CallGraph &CG = getAnalysis().getCallGraph(); unsigned sccNum = 0; errs() << "SCCs for the program in PostOrder:"; - for (scc_iterator SCCI = scc_begin(rootNode), - E = scc_end(rootNode); SCCI != E; ++SCCI) { + for (scc_iterator SCCI = scc_begin(&CG), + E = scc_end(&CG); SCCI != E; ++SCCI) { const std::vector &nextSCC = *SCCI; errs() << "\nSCC #" << ++sccNum << " : "; for (std::vector::const_iterator I = nextSCC.begin(),