aboutsummaryrefslogtreecommitdiff
path: root/include/clang/Analysis/ProgramPoint.h
diff options
context:
space:
mode:
authorTed Kremenek <kremenek@apple.com>2008-06-18 05:34:07 +0000
committerTed Kremenek <kremenek@apple.com>2008-06-18 05:34:07 +0000
commit331b0ac44b9eb0ffcba66b4f3f3f9adb27c2434f (patch)
treeffb6b8127a7735a6996f4777740a1c8a135530a8 /include/clang/Analysis/ProgramPoint.h
parent60c5e4263b5146aa6c82ef1b6c1dbd391a285c95 (diff)
Added a new ProgramPoint: PostPurgeDeadSymbols. This new program point distinguishes between the cases when we just evaluated the transfer function of a Stmt* (PostStmt) or performed a load (PostLoad). This solves a caching bug observed in a recent bug report.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@52443 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/clang/Analysis/ProgramPoint.h')
-rw-r--r--include/clang/Analysis/ProgramPoint.h18
1 files changed, 14 insertions, 4 deletions
diff --git a/include/clang/Analysis/ProgramPoint.h b/include/clang/Analysis/ProgramPoint.h
index efd16b416d..ecb4f742c7 100644
--- a/include/clang/Analysis/ProgramPoint.h
+++ b/include/clang/Analysis/ProgramPoint.h
@@ -25,9 +25,10 @@ namespace clang {
class ProgramPoint {
public:
- enum Kind { BlockEntranceKind=0, PostStmtKind=1, PostLoadKind=2,
- BlockExitKind=3, BlockEdgeSrcKind=4, BlockEdgeDstKind=5,
- BlockEdgeAuxKind=6 };
+ enum Kind { BlockEntranceKind=0,
+ PostStmtKind=1, PostLoadKind=2, PostPurgeDeadSymbolsKind=3,
+ BlockExitKind=4, BlockEdgeSrcKind=5, BlockEdgeDstKind=6,
+ BlockEdgeAuxKind=7 };
protected:
uintptr_t Data;
@@ -110,7 +111,7 @@ public:
static bool classof(const ProgramPoint* Location) {
unsigned k = Location->getKind();
- return k == PostStmtKind || k == PostLoadKind;
+ return k >= PostStmtKind && k <= PostPurgeDeadSymbolsKind;
}
};
@@ -123,6 +124,15 @@ public:
}
};
+class PostPurgeDeadSymbols : public PostStmt {
+public:
+ PostPurgeDeadSymbols(const Stmt* S) : PostStmt(S, PostPurgeDeadSymbolsKind) {}
+
+ static bool classof(const ProgramPoint* Location) {
+ return Location->getKind() == PostPurgeDeadSymbolsKind;
+ }
+};
+
class BlockEdge : public ProgramPoint {
typedef std::pair<CFGBlock*,CFGBlock*> BPair;
public: