]> granicus.if.org Git - clang/commitdiff
Make GRStmtNodeBuilder only depend on StateTy, and not the type definition
authorTed Kremenek <kremenek@apple.com>
Tue, 4 Mar 2008 23:50:00 +0000 (23:50 +0000)
committerTed Kremenek <kremenek@apple.com>
Tue, 4 Mar 2008 23:50:00 +0000 (23:50 +0000)
of the entire checker.

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

include/clang/Analysis/PathSensitive/GRCoreEngine.h
include/clang/Analysis/PathSensitive/GRExprEngine.h
include/clang/Analysis/PathSensitive/GRTransferFuncs.h

index b8541309a1953dddcc39efd3d30bad1a6c1259ed..2051850c920428be3d16da67dc410f994fb97a98 100644 (file)
@@ -136,8 +136,6 @@ public:
   
   ~GRStmtNodeBuilderImpl();
   
-  const ExplodedGraphImpl& getGraph() const { return *Eng.G; }
-  
   inline ExplodedNodeImpl* getLastNode() {
     return LastNode ? (LastNode->isSink() ? NULL : LastNode) : NULL;
   }
@@ -156,22 +154,16 @@ public:
   CFGBlock* getBlock() const { return &B; }
 };
 
-template<typename CHECKER>
+template<typename STATE>
 class GRStmtNodeBuilder  {
-  typedef CHECKER                                CheckerTy; 
-  typedef typename CheckerTy::StateTy            StateTy;
-  typedef ExplodedGraph<CheckerTy>               GraphTy;
-  typedef typename GraphTy::NodeTy               NodeTy;
+  typedef STATE                   StateTy;
+  typedef ExplodedNode<StateTy>   NodeTy;
   
   GRStmtNodeBuilderImpl& NB;
   
 public:
   GRStmtNodeBuilder(GRStmtNodeBuilderImpl& nb) : NB(nb) {}
-  
-  const GraphTy& getGraph() const {
-    return static_cast<const GraphTy&>(NB.getGraph());
-  }
-  
+    
   NodeTy* getLastNode() const {
     return static_cast<NodeTy*>(NB.getLastNode());
   }
@@ -449,7 +441,7 @@ protected:
   }
   
   virtual void ProcessStmt(Stmt* S, GRStmtNodeBuilderImpl& BuilderImpl) {
-    GRStmtNodeBuilder<CHECKER> Builder(BuilderImpl);
+    GRStmtNodeBuilder<StateTy> Builder(BuilderImpl);
     Checker->ProcessStmt(S, Builder);
   }
   
index 2937dd612999013f60656f1db31b42941b31c16a..a6d502f2a306206972d5718522583b5d130632f6 100644 (file)
@@ -27,7 +27,7 @@ public:
   typedef GraphTy::NodeTy             NodeTy;
   
   // Builders.
-  typedef GRStmtNodeBuilder<GRExprEngine>          StmtNodeBuilder;
+  typedef GRStmtNodeBuilder<StateTy>               StmtNodeBuilder;
   typedef GRBranchNodeBuilder<GRExprEngine>        BranchNodeBuilder;
   typedef GRIndirectGotoNodeBuilder<GRExprEngine>  IndirectGotoNodeBuilder;
   typedef GRSwitchNodeBuilder<GRExprEngine>        SwitchNodeBuilder;
@@ -325,13 +325,6 @@ protected:
     return Builder->Nodify(Dst, S, Pred, St);
   }
   
-#if 0
-  /// Nodify - This version of Nodify is used to batch process a set of states.
-  ///  The states are not guaranteed to be unique.
-  void Nodify(NodeSet& Dst, Stmt* S, NodeTy* Pred,
-              const ValueState*::BufferTy& SB);
-#endif
-  
   /// HandleUndefinedStore - Create the necessary sink node to represent
   ///  a store to an "undefined" LVal.
   void HandleUndefinedStore(Stmt* S, NodeTy* Pred);
index 01e67ea68d562ebf4634ea658e1c2c989b0ce1e8..a91a97b91a9cb1416c0d1e7da5efd4fa1af6ab3d 100644 (file)
@@ -16,6 +16,7 @@
 #define LLVM_CLANG_ANALYSIS_GRTF
 
 #include "clang/Analysis/PathSensitive/RValues.h"
+#include "clang/Analysis/PathSensitive/GRCoreEngine.h"
 
 namespace clang {