diff options
author | Ted Kremenek <kremenek@apple.com> | 2009-07-22 22:35:28 +0000 |
---|---|---|
committer | Ted Kremenek <kremenek@apple.com> | 2009-07-22 22:35:28 +0000 |
commit | 5f85e17df3f5b0a8021443f2b590daecfb2cbd17 (patch) | |
tree | 27f50e167a2cf236ee16a7aadc89b330a62389a1 /include/clang/Analysis/PathSensitive | |
parent | de99a45c1295ec8e2eea20d35906178ff10722b5 (diff) |
Refactor 'PostStmt' and 'PreStmt' to subclass a common parent 'StmtPoint'.
Educate GRExprEngine::VisitGraph() about 'PreStmt'.
Mark the constructor of 'PostStmt' to be explicit, preventing implicit
conversions and the selection of the wrong 'generateNode' method in
GRStmtNodeBuilder.
Constify a bunch of arguments, which falls out of the changes to ProgramPoint.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@76809 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/clang/Analysis/PathSensitive')
-rw-r--r-- | include/clang/Analysis/PathSensitive/BugReporter.h | 2 | ||||
-rw-r--r-- | include/clang/Analysis/PathSensitive/GRCoreEngine.h | 14 | ||||
-rw-r--r-- | include/clang/Analysis/PathSensitive/GRState.h | 4 |
3 files changed, 10 insertions, 10 deletions
diff --git a/include/clang/Analysis/PathSensitive/BugReporter.h b/include/clang/Analysis/PathSensitive/BugReporter.h index c90e5597b6..042564e0e0 100644 --- a/include/clang/Analysis/PathSensitive/BugReporter.h +++ b/include/clang/Analysis/PathSensitive/BugReporter.h @@ -101,7 +101,7 @@ public: // object. // FIXME: If we do need it, we can probably just make it private to // BugReporter. - Stmt* getStmt(BugReporter& BR) const; + const Stmt* getStmt(BugReporter& BR) const; const std::string& getDescription() const { return Description; } diff --git a/include/clang/Analysis/PathSensitive/GRCoreEngine.h b/include/clang/Analysis/PathSensitive/GRCoreEngine.h index 3d8b0ea18e..8fb2506fa1 100644 --- a/include/clang/Analysis/PathSensitive/GRCoreEngine.h +++ b/include/clang/Analysis/PathSensitive/GRCoreEngine.h @@ -146,12 +146,12 @@ public: ExplodedNodeImpl* Pred); ExplodedNodeImpl* - generateNodeImpl(Stmt* S, const void* State, ExplodedNodeImpl* Pred, + generateNodeImpl(const Stmt* S, const void* State, ExplodedNodeImpl* Pred, ProgramPoint::Kind K = ProgramPoint::PostStmtKind, const void *tag = 0); ExplodedNodeImpl* - generateNodeImpl(Stmt* S, const void* State, + generateNodeImpl(const Stmt* S, const void* State, ProgramPoint::Kind K = ProgramPoint::PostStmtKind, const void *tag = 0) { ExplodedNodeImpl* N = getLastNode(); @@ -160,7 +160,7 @@ public: } ExplodedNodeImpl* - generateNodeImpl(Stmt* S, const void* State, const void *tag = 0) { + generateNodeImpl(const Stmt* S, const void* State, const void *tag = 0) { ExplodedNodeImpl* N = getLastNode(); assert (N && "Predecessor of new node is infeasible."); return generateNodeImpl(S, State, N, ProgramPoint::PostStmtKind, tag); @@ -211,24 +211,24 @@ public: return static_cast<NodeTy*>(NB.generateNodeImpl(PP, St, Pred)); } - NodeTy* generateNode(Stmt* S, const StateTy* St, NodeTy* Pred, + NodeTy* generateNode(const Stmt* S, const StateTy* St, NodeTy* Pred, ProgramPoint::Kind K) { HasGeneratedNode = true; if (PurgingDeadSymbols) K = ProgramPoint::PostPurgeDeadSymbolsKind; return static_cast<NodeTy*>(NB.generateNodeImpl(S, St, Pred, K, Tag)); } - NodeTy* generateNode(Stmt* S, const StateTy* St, NodeTy* Pred) { + NodeTy* generateNode(const Stmt* S, const StateTy* St, NodeTy* Pred) { return generateNode(S, St, Pred, PointKind); } - NodeTy* generateNode(Stmt* S, const StateTy* St, ProgramPoint::Kind K) { + NodeTy* generateNode(const Stmt* S, const StateTy* St, ProgramPoint::Kind K) { HasGeneratedNode = true; if (PurgingDeadSymbols) K = ProgramPoint::PostPurgeDeadSymbolsKind; return static_cast<NodeTy*>(NB.generateNodeImpl(S, St, K, Tag)); } - NodeTy* generateNode(Stmt* S, const StateTy* St) { + NodeTy* generateNode(const Stmt* S, const StateTy* St) { return generateNode(S, St, PointKind); } diff --git a/include/clang/Analysis/PathSensitive/GRState.h b/include/clang/Analysis/PathSensitive/GRState.h index 1551f961cf..e6e7960869 100644 --- a/include/clang/Analysis/PathSensitive/GRState.h +++ b/include/clang/Analysis/PathSensitive/GRState.h @@ -525,8 +525,8 @@ public: const GRState* getPersistentState(GRState& Impl); - bool isEqual(const GRState* state, Expr* Ex, const llvm::APSInt& V); - bool isEqual(const GRState* state, Expr* Ex, uint64_t); + bool isEqual(const GRState* state, const Expr* Ex, const llvm::APSInt& V); + bool isEqual(const GRState* state, const Expr* Ex, uint64_t); //==---------------------------------------------------------------------==// // Generic Data Map methods. |