[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

llvm-svn: 289431

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

index ea1c4a0..b8ae67c 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 0cb5a3f..8c126b0 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();
 }