summaryrefslogtreecommitdiffstats
path: root/clang/lib/Analysis/GRExprEngine.cpp
diff options
context:
space:
mode:
authorTed Kremenek <kremenek@apple.com>2008-04-24 18:31:42 +0000
committerTed Kremenek <kremenek@apple.com>2008-04-24 18:31:42 +0000
commit3812b7676cfee4f9c4730d425182c4fd201d4946 (patch)
tree2c59c8b6dd2ecebdc46479fa1f0c3b0916cdd50d /clang/lib/Analysis/GRExprEngine.cpp
parent6e06f91085ec0250dc70f3307dfa5481e166f352 (diff)
downloadbcm5719-llvm-3812b7676cfee4f9c4730d425182c4fd201d4946.tar.gz
bcm5719-llvm-3812b7676cfee4f9c4730d425182c4fd201d4946.zip
Added initial boilerplate in GRExprEngine to allow checker-specific transfer
function logic to act when symbols become dead. llvm-svn: 50221
Diffstat (limited to 'clang/lib/Analysis/GRExprEngine.cpp')
-rw-r--r--clang/lib/Analysis/GRExprEngine.cpp29
1 files changed, 25 insertions, 4 deletions
diff --git a/clang/lib/Analysis/GRExprEngine.cpp b/clang/lib/Analysis/GRExprEngine.cpp
index a6d8ef90517..a287e542981 100644
--- a/clang/lib/Analysis/GRExprEngine.cpp
+++ b/clang/lib/Analysis/GRExprEngine.cpp
@@ -188,13 +188,34 @@ void GRExprEngine::ProcessStmt(Stmt* S, StmtNodeBuilder& builder) {
// Create the cleaned state.
CleanedState = StateMgr.RemoveDeadBindings(StmtEntryNode->getState(),
- CurrentStmt, Liveness);
+ CurrentStmt, Liveness,
+ DeadSymbols);
- Builder->SetCleanedState(CleanedState);
+ // Process any special transfer function for dead symbols.
- // Visit the statement.
+ NodeSet Tmp;
- Visit(S, StmtEntryNode, Dst);
+ if (DeadSymbols.empty())
+ Tmp.Add(StmtEntryNode);
+ else {
+ SaveAndRestore<bool> OldSink(Builder->BuildSinks);
+/*
+ FIXME: Will hook this up next.
+
+ TF->EvalDeadSymbols(Tmp, *this, *Builder, StmtEntryNode->getLocation(), Pred,
+ CleanedState, DeadSymbols);
+*/
+ if (!Builder->BuildSinks && Tmp.empty() && !Builder->HasGeneratedNode)
+ Tmp.Add(StmtEntryNode);
+ }
+
+ for (NodeSet::iterator I=Tmp.begin(), E=Tmp.end(); I!=E; ++I) {
+ // Set the cleaned state.
+ Builder->SetCleanedState(*I == StmtEntryNode ? CleanedState : (*I)->getState());
+
+ // Visit the statement.
+ Visit(S, StmtEntryNode, Dst);
+ }
// If no nodes were generated, generate a new node that has all the
// dead mappings removed.
OpenPOWER on IntegriCloud