diff options
author | Ted Kremenek <kremenek@apple.com> | 2008-03-04 23:50:00 +0000 |
---|---|---|
committer | Ted Kremenek <kremenek@apple.com> | 2008-03-04 23:50:00 +0000 |
commit | f116bd654bcdb5d7c22656f224deeb7a67f7d0cd (patch) | |
tree | 28fa731ab184ea17f8133eb2a5adc41f50e4d28c | |
parent | 5c684c4be01fb98077a9b5e07ca1fdc01d8d97cb (diff) |
Make GRStmtNodeBuilder only depend on StateTy, and not the type definition
of the entire checker.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@47920 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | include/clang/Analysis/PathSensitive/GRCoreEngine.h | 18 | ||||
-rw-r--r-- | include/clang/Analysis/PathSensitive/GRExprEngine.h | 9 | ||||
-rw-r--r-- | include/clang/Analysis/PathSensitive/GRTransferFuncs.h | 1 |
3 files changed, 7 insertions, 21 deletions
diff --git a/include/clang/Analysis/PathSensitive/GRCoreEngine.h b/include/clang/Analysis/PathSensitive/GRCoreEngine.h index b8541309a1..2051850c92 100644 --- a/include/clang/Analysis/PathSensitive/GRCoreEngine.h +++ b/include/clang/Analysis/PathSensitive/GRCoreEngine.h @@ -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); } diff --git a/include/clang/Analysis/PathSensitive/GRExprEngine.h b/include/clang/Analysis/PathSensitive/GRExprEngine.h index 2937dd6129..a6d502f2a3 100644 --- a/include/clang/Analysis/PathSensitive/GRExprEngine.h +++ b/include/clang/Analysis/PathSensitive/GRExprEngine.h @@ -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); diff --git a/include/clang/Analysis/PathSensitive/GRTransferFuncs.h b/include/clang/Analysis/PathSensitive/GRTransferFuncs.h index 01e67ea68d..a91a97b91a 100644 --- a/include/clang/Analysis/PathSensitive/GRTransferFuncs.h +++ b/include/clang/Analysis/PathSensitive/GRTransferFuncs.h @@ -16,6 +16,7 @@ #define LLVM_CLANG_ANALYSIS_GRTF #include "clang/Analysis/PathSensitive/RValues.h" +#include "clang/Analysis/PathSensitive/GRCoreEngine.h" namespace clang { |