[cfe-commits] r47920 - in /cfe/trunk/include/clang/Analysis/PathSensitive: GRCoreEngine.h GRExprEngine.h GRTransferFuncs.h
Ted Kremenek
kremenek at apple.com
Tue Mar 4 15:50:00 PST 2008
Author: kremenek
Date: Tue Mar 4 17:50:00 2008
New Revision: 47920
URL: http://llvm.org/viewvc/llvm-project?rev=47920&view=rev
Log:
Make GRStmtNodeBuilder only depend on StateTy, and not the type definition
of the entire checker.
Modified:
cfe/trunk/include/clang/Analysis/PathSensitive/GRCoreEngine.h
cfe/trunk/include/clang/Analysis/PathSensitive/GRExprEngine.h
cfe/trunk/include/clang/Analysis/PathSensitive/GRTransferFuncs.h
Modified: cfe/trunk/include/clang/Analysis/PathSensitive/GRCoreEngine.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Analysis/PathSensitive/GRCoreEngine.h?rev=47920&r1=47919&r2=47920&view=diff
==============================================================================
--- cfe/trunk/include/clang/Analysis/PathSensitive/GRCoreEngine.h (original)
+++ cfe/trunk/include/clang/Analysis/PathSensitive/GRCoreEngine.h Tue Mar 4 17:50:00 2008
@@ -136,8 +136,6 @@
~GRStmtNodeBuilderImpl();
- const ExplodedGraphImpl& getGraph() const { return *Eng.G; }
-
inline ExplodedNodeImpl* getLastNode() {
return LastNode ? (LastNode->isSink() ? NULL : LastNode) : NULL;
}
@@ -156,22 +154,16 @@
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 @@
}
virtual void ProcessStmt(Stmt* S, GRStmtNodeBuilderImpl& BuilderImpl) {
- GRStmtNodeBuilder<CHECKER> Builder(BuilderImpl);
+ GRStmtNodeBuilder<StateTy> Builder(BuilderImpl);
Checker->ProcessStmt(S, Builder);
}
Modified: cfe/trunk/include/clang/Analysis/PathSensitive/GRExprEngine.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Analysis/PathSensitive/GRExprEngine.h?rev=47920&r1=47919&r2=47920&view=diff
==============================================================================
--- cfe/trunk/include/clang/Analysis/PathSensitive/GRExprEngine.h (original)
+++ cfe/trunk/include/clang/Analysis/PathSensitive/GRExprEngine.h Tue Mar 4 17:50:00 2008
@@ -27,7 +27,7 @@
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 @@
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);
Modified: cfe/trunk/include/clang/Analysis/PathSensitive/GRTransferFuncs.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Analysis/PathSensitive/GRTransferFuncs.h?rev=47920&r1=47919&r2=47920&view=diff
==============================================================================
--- cfe/trunk/include/clang/Analysis/PathSensitive/GRTransferFuncs.h (original)
+++ cfe/trunk/include/clang/Analysis/PathSensitive/GRTransferFuncs.h Tue Mar 4 17:50:00 2008
@@ -16,6 +16,7 @@
#define LLVM_CLANG_ANALYSIS_GRTF
#include "clang/Analysis/PathSensitive/RValues.h"
+#include "clang/Analysis/PathSensitive/GRCoreEngine.h"
namespace clang {
More information about the cfe-commits
mailing list