summaryrefslogtreecommitdiffstats
path: root/clang/lib/Analysis/Checker.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'clang/lib/Analysis/Checker.cpp')
-rw-r--r--clang/lib/Analysis/Checker.cpp17
1 files changed, 17 insertions, 0 deletions
diff --git a/clang/lib/Analysis/Checker.cpp b/clang/lib/Analysis/Checker.cpp
index 985b1e0a1d7..0d907e50168 100644
--- a/clang/lib/Analysis/Checker.cpp
+++ b/clang/lib/Analysis/Checker.cpp
@@ -16,3 +16,20 @@
using namespace clang;
Checker::~Checker() {}
+
+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 (state && state != B.GetState(Pred)) {
+ static int autoTransitionTag = 0;
+ B.Tag = &autoTransitionTag;
+ addTransition(state);
+ }
+ else
+ Dst.Add(Pred);
+ }
+}
OpenPOWER on IntegriCloud