Ted Kremenek | c6e11ff | 2009-11-23 18:53:03 +0000 | [diff] [blame] | 1 | //== Checker.h - Abstract interface for checkers -----------------*- C++ -*--=// |
| 2 | // |
| 3 | // The LLVM Compiler Infrastructure |
| 4 | // |
| 5 | // This file is distributed under the University of Illinois Open Source |
| 6 | // License. See LICENSE.TXT for details. |
| 7 | // |
| 8 | //===----------------------------------------------------------------------===// |
| 9 | // |
| 10 | // This file defines Checker and CheckerVisitor, classes used for creating |
| 11 | // domain-specific checks. |
| 12 | // |
| 13 | //===----------------------------------------------------------------------===// |
| 14 | |
Ted Kremenek | 1309f9a | 2010-01-25 04:41:41 +0000 | [diff] [blame] | 15 | #include "clang/Checker/PathSensitive/Checker.h" |
Ted Kremenek | c6e11ff | 2009-11-23 18:53:03 +0000 | [diff] [blame] | 16 | using namespace clang; |
| 17 | |
| 18 | Checker::~Checker() {} |
Ted Kremenek | 19d67b5 | 2009-11-23 22:22:01 +0000 | [diff] [blame] | 19 | |
| 20 | CheckerContext::~CheckerContext() { |
| 21 | // Do we need to autotransition? 'Dst' can get populated in a variety of |
| 22 | // ways, including 'addTransition()' adding the predecessor node to Dst |
| 23 | // without actually generated a new node. We also shouldn't autotransition |
| 24 | // if we are building sinks or we generated a node and decided to not |
| 25 | // add it as a transition. |
| 26 | if (Dst.size() == size && !B.BuildSinks && !B.HasGeneratedNode) { |
Ted Kremenek | bfb4fc9 | 2009-12-04 06:57:49 +0000 | [diff] [blame] | 27 | if (ST && ST != B.GetState(Pred)) { |
Ted Kremenek | 19d67b5 | 2009-11-23 22:22:01 +0000 | [diff] [blame] | 28 | static int autoTransitionTag = 0; |
| 29 | B.Tag = &autoTransitionTag; |
Ted Kremenek | bfb4fc9 | 2009-12-04 06:57:49 +0000 | [diff] [blame] | 30 | addTransition(ST); |
Ted Kremenek | 19d67b5 | 2009-11-23 22:22:01 +0000 | [diff] [blame] | 31 | } |
| 32 | else |
| 33 | Dst.Add(Pred); |
| 34 | } |
| 35 | } |