diff options
author | Anna Zaks <ganna@apple.com> | 2011-10-18 23:05:58 +0000 |
---|---|---|
committer | Anna Zaks <ganna@apple.com> | 2011-10-18 23:05:58 +0000 |
commit | f05aac8472d8ed081a361a218fd14d59ddc91b85 (patch) | |
tree | bf6e8e58f892f331b983114f4affd22acb28fcc4 /lib/StaticAnalyzer/Core/CheckerContext.cpp | |
parent | 2dde35bc626153492f5f58202506c88a27fbff5b (diff) |
[analyzer] Node Builder refactoring: Introduce a simple Node Builder responsible for generating the node frontier.
Currently we have a bunch of different node builders which provide some common
functionality but are difficult to refactor. Each builder generates nodes of
different kinds and calculates the frontier nodes, which should be propagated
to the next step (after the builder dies).
Introduce a new NodeBuilder which provides very basic node generation facilities
but takes care of the second problem. The idea is that all the other builders
will eventually use it. Use this builder in CheckerContext instead of
StmtNodeBuilder (the way the frontier is propagated to the StmtBuilder
is a hack and will be removed later on).
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@142443 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/StaticAnalyzer/Core/CheckerContext.cpp')
-rw-r--r-- | lib/StaticAnalyzer/Core/CheckerContext.cpp | 20 |
1 files changed, 8 insertions, 12 deletions
diff --git a/lib/StaticAnalyzer/Core/CheckerContext.cpp b/lib/StaticAnalyzer/Core/CheckerContext.cpp index 5356edc752..e380165c2e 100644 --- a/lib/StaticAnalyzer/Core/CheckerContext.cpp +++ b/lib/StaticAnalyzer/Core/CheckerContext.cpp @@ -17,17 +17,13 @@ using namespace clang; using namespace ento; CheckerContext::~CheckerContext() { - // Do we need to autotransition? 'Dst' can get populated in a variety of - // ways, including 'addTransition()' adding the predecessor node to Dst - // without actually generated a new node. We also shouldn't autotransition - // if we are building sinks or we generated a node and decided to not - // add it as a transition. - if (Dst.size() == size && !B.BuildSinks && !B.hasGeneratedNode) { - if (ST && ST != Pred->getState()) { - static SimpleProgramPointTag autoTransitionTag("CheckerContext : auto"); - addTransition(ST, &autoTransitionTag); - } - else - Dst.Add(Pred); + // Copy the results into the Dst set. + for (NodeBuilder::iterator I = NB.results_begin(), + E = NB.results_end(); I != E; ++I) { + Dst.Add(*I); } + + // Copy the results into the StmtNodeBuilder. + //TODO: This will be removed after we completely migrate NodeBuilder. + B.importNodesFromBuilder(NB); } |