summaryrefslogtreecommitdiffstats
path: root/clang/lib/StaticAnalyzer
diff options
context:
space:
mode:
authorTed Kremenek <kremenek@apple.com>2011-04-03 04:34:49 +0000
committerTed Kremenek <kremenek@apple.com>2011-04-03 04:34:49 +0000
commita95594416e24bcaa4de93a7cb39a0ae5f92bb30b (patch)
tree2714b0abb14da7c818baf18fe2a4d41f8738ec6f /clang/lib/StaticAnalyzer
parent850d35be167477105136175f17ba09bb4f21bf5f (diff)
downloadbcm5719-llvm-a95594416e24bcaa4de93a7cb39a0ae5f92bb30b.tar.gz
bcm5719-llvm-a95594416e24bcaa4de93a7cb39a0ae5f92bb30b.zip
static analyzer: Add a new ProgramPoint PostCondition to represent the post position of a branch condition, and a new generateNode method to BranchNodeBuilder using PostCondition ProgramPoint. This method generates a new ExplodedNode but not a new block edge.
Patch by Lei Zhang! llvm-svn: 128784
Diffstat (limited to 'clang/lib/StaticAnalyzer')
-rw-r--r--clang/lib/StaticAnalyzer/Core/CoreEngine.cpp19
1 files changed, 19 insertions, 0 deletions
diff --git a/clang/lib/StaticAnalyzer/Core/CoreEngine.cpp b/clang/lib/StaticAnalyzer/Core/CoreEngine.cpp
index 73709e39d0d..a161f652a62 100644
--- a/clang/lib/StaticAnalyzer/Core/CoreEngine.cpp
+++ b/clang/lib/StaticAnalyzer/Core/CoreEngine.cpp
@@ -602,6 +602,25 @@ StmtNodeBuilder::generateNodeInternal(const ProgramPoint &Loc,
return NULL;
}
+// This function generate a new ExplodedNode but not a new branch(block edge).
+ExplodedNode* BranchNodeBuilder::generateNode(const Stmt* Condition,
+ const GRState* State) {
+ bool IsNew;
+
+ ExplodedNode* Succ
+ = Eng.G->getNode(PostCondition(Condition, Pred->getLocationContext()), State,
+ &IsNew);
+
+ Succ->addPredecessor(Pred, *Eng.G);
+
+ Pred = Succ;
+
+ if (IsNew)
+ return Succ;
+
+ return NULL;
+}
+
ExplodedNode* BranchNodeBuilder::generateNode(const GRState* State,
bool branch) {
OpenPOWER on IntegriCloud