aboutsummaryrefslogtreecommitdiff
path: root/include/clang/Analysis/PathSensitive
diff options
context:
space:
mode:
authorZhongxing Xu <xuzhongxing@gmail.com>2009-12-09 12:23:28 +0000
committerZhongxing Xu <xuzhongxing@gmail.com>2009-12-09 12:23:28 +0000
commit1ec4e976113ac56c0b3d96f484613d1dc62c3f85 (patch)
treebb98896977316125f8e4b0568451587f9bb5a349 /include/clang/Analysis/PathSensitive
parent78c98fad2cf17629b8659fe680ad92a548d1a5ea (diff)
Refactor OSAtomic evaluation logic into OSAtomicChecker.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90968 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/clang/Analysis/PathSensitive')
-rw-r--r--include/clang/Analysis/PathSensitive/Checker.h24
1 files changed, 22 insertions, 2 deletions
diff --git a/include/clang/Analysis/PathSensitive/Checker.h b/include/clang/Analysis/PathSensitive/Checker.h
index 080f4d334a..9873710976 100644
--- a/include/clang/Analysis/PathSensitive/Checker.h
+++ b/include/clang/Analysis/PathSensitive/Checker.h
@@ -56,7 +56,11 @@ public:
ST(st), statement(stmt), size(Dst.size()) {}
~CheckerContext();
-
+
+ GRExprEngine &getEngine() {
+ return Eng;
+ }
+
ConstraintManager &getConstraintManager() {
return Eng.getConstraintManager();
}
@@ -103,6 +107,15 @@ public:
return N;
}
+ ExplodedNode *GenerateNode(const GRState *state, ExplodedNode *pred,
+ bool autoTransition = true) {
+ assert(statement && "Only transitions with statements currently supported");
+ ExplodedNode *N = GenerateNodeImpl(statement, state, pred, false);
+ if (N && autoTransition)
+ addTransition(N);
+ return N;
+ }
+
ExplodedNode *GenerateNode(const GRState *state, bool autoTransition = true) {
assert(statement && "Only transitions with statements currently supported");
ExplodedNode *N = GenerateNodeImpl(statement, state, false);
@@ -144,7 +157,14 @@ private:
node->markAsSink();
return node;
}
-
+
+ ExplodedNode *GenerateNodeImpl(const Stmt* stmt, const GRState *state,
+ ExplodedNode *pred, bool markAsSink) {
+ ExplodedNode *node = B.generateNode(stmt, state, pred);
+ if (markAsSink && node)
+ node->markAsSink();
+ return node;
+ }
};
class Checker {