From: Haojian Wu Date: Mon, 12 Dec 2016 14:12:10 +0000 (+0000) Subject: [StaticAnalysis] Remove unnecessary parameter in CallGraphNode::addCallee. X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=053499841a6d9561446de5b52db62a481b73f9a9;p=platform%2Fupstream%2Fllvm.git [StaticAnalysis] Remove unnecessary parameter in CallGraphNode::addCallee. Summary: Remove the CallGraph in addCallee as it is not used in addCallee. It decouples addCallee from CallGraph, so that we can use CallGraphNode within our customized CallGraph. Reviewers: bkramer Subscribers: cfe-commits, ioeric Differential Revision: https://reviews.llvm.org/D27674 llvm-svn: 289431 --- diff --git a/clang/include/clang/Analysis/CallGraph.h b/clang/include/clang/Analysis/CallGraph.h index ea1c4a0..b8ae67c 100644 --- a/clang/include/clang/Analysis/CallGraph.h +++ b/clang/include/clang/Analysis/CallGraph.h @@ -157,7 +157,7 @@ public: inline bool empty() const {return CalledFunctions.empty(); } inline unsigned size() const {return CalledFunctions.size(); } - void addCallee(CallGraphNode *N, CallGraph *CG) { + void addCallee(CallGraphNode *N) { CalledFunctions.push_back(N); } diff --git a/clang/lib/Analysis/CallGraph.cpp b/clang/lib/Analysis/CallGraph.cpp index 0cb5a3f..8c126b0 100644 --- a/clang/lib/Analysis/CallGraph.cpp +++ b/clang/lib/Analysis/CallGraph.cpp @@ -55,7 +55,7 @@ public: void addCalledDecl(Decl *D) { if (G->includeInGraph(D)) { CallGraphNode *CalleeNode = G->getOrInsertNode(D); - CallerNode->addCallee(CalleeNode, G); + CallerNode->addCallee(CalleeNode); } } @@ -154,7 +154,7 @@ CallGraphNode *CallGraph::getOrInsertNode(Decl *F) { Node = llvm::make_unique(F); // Make Root node a parent of all functions to make sure all are reachable. if (F) - Root->addCallee(Node.get(), this); + Root->addCallee(Node.get()); return Node.get(); }