]> granicus.if.org Git - clang/commitdiff
Move GRStmtNodeBuilder::MakeNode() out of line. No functionality change.
authorZhongxing Xu <xuzhongxing@gmail.com>
Wed, 14 Apr 2010 06:35:09 +0000 (06:35 +0000)
committerZhongxing Xu <xuzhongxing@gmail.com>
Wed, 14 Apr 2010 06:35:09 +0000 (06:35 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101239 91177308-0d34-0410-b5e6-96231b3b80d8

include/clang/Checker/PathSensitive/GRCoreEngine.h
lib/Checker/GRCoreEngine.cpp

index a3ff0dbedc7bfa15327f89112020321b6cee9fc9..2d8afeeb0da616f69fd8e11d377b11c3f6fbde38 100644 (file)
@@ -239,31 +239,7 @@ public:
   }
 
   ExplodedNode* MakeNode(ExplodedNodeSet& Dst, Stmt* S, ExplodedNode* Pred,
-                         const GRState* St, ProgramPoint::Kind K) {
-
-    const GRState* PredState = GetState(Pred);
-
-    // If the state hasn't changed, don't generate a new node.
-    if (!BuildSinks && St == PredState && Auditor == 0) {
-      Dst.Add(Pred);
-      return NULL;
-    }
-
-    ExplodedNode* N = generateNode(S, St, Pred, K);
-
-    if (N) {
-      if (BuildSinks)
-        N->markAsSink();
-      else {
-        if (Auditor && Auditor->Audit(N, Mgr))
-          N->markAsSink();
-
-        Dst.Add(N);
-      }
-    }
-
-    return N;
-  }
+                         const GRState* St, ProgramPoint::Kind K);
 
   ExplodedNode* MakeSinkNode(ExplodedNodeSet& Dst, Stmt* S,
                        ExplodedNode* Pred, const GRState* St) {
@@ -273,7 +249,6 @@ public:
     BuildSinks = Tmp;
     return N;
   }
-
 };
 
 class GRBranchNodeBuilder {
index e4ef6b0e106f40cf9c6ce6c4b99ef7d4284d187d..23a87d303b4d447915fe9c9db2b289356a436108 100644 (file)
@@ -455,6 +455,33 @@ void GRStmtNodeBuilder::GenerateAutoTransition(ExplodedNode* N) {
     Eng.WList->Enqueue(Succ, B, Idx+1);
 }
 
+ExplodedNode* GRStmtNodeBuilder::MakeNode(ExplodedNodeSet& Dst, Stmt* S, 
+                                          ExplodedNode* Pred, const GRState* St,
+                                          ProgramPoint::Kind K) {
+  const GRState* PredState = GetState(Pred);
+
+  // If the state hasn't changed, don't generate a new node.
+  if (!BuildSinks && St == PredState && Auditor == 0) {
+    Dst.Add(Pred);
+    return NULL;
+  }
+
+  ExplodedNode* N = generateNode(S, St, Pred, K);
+
+  if (N) {
+    if (BuildSinks)
+      N->markAsSink();
+    else {
+      if (Auditor && Auditor->Audit(N, Mgr))
+        N->markAsSink();
+      
+      Dst.Add(N);
+    }
+  }
+  
+  return N;
+}
+
 static ProgramPoint GetProgramPoint(const Stmt *S, ProgramPoint::Kind K,
                                     const LocationContext *LC, const void *tag){
   switch (K) {