]> granicus.if.org Git - clang/commitdiff
[StaticAnalysis] Remove unnecessary parameter in CallGraphNode::addCallee.
authorHaojian Wu <hokein@google.com>
Mon, 12 Dec 2016 14:12:10 +0000 (14:12 +0000)
committerHaojian Wu <hokein@google.com>
Mon, 12 Dec 2016 14:12:10 +0000 (14:12 +0000)
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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@289431 91177308-0d34-0410-b5e6-96231b3b80d8

include/clang/Analysis/CallGraph.h
lib/Analysis/CallGraph.cpp

index ea1c4a01e185c1863f7f0df0f6eb259b42512bd1..b8ae67cbba4940f3dbd863eb1eacf9ffd517caf2 100644 (file)
@@ -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);
   }
 
index 0cb5a3fe14ebc150e65561ba9975731299d73c6d..8c126b09d0575b7ea985471818b90fc6162b989d 100644 (file)
@@ -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<CallGraphNode>(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();
 }