Shih-wei Liao | f8fd82b | 2010-02-10 11:10:31 -0800 | [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 | |
| 15 | #include "clang/Checker/PathSensitive/Checker.h" |
| 16 | using namespace clang; |
| 17 | |
| 18 | Checker::~Checker() {} |
| 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) { |
| 27 | if (ST && ST != B.GetState(Pred)) { |
| 28 | static int autoTransitionTag = 0; |
| 29 | B.Tag = &autoTransitionTag; |
| 30 | addTransition(ST); |
| 31 | } |
| 32 | else |
| 33 | Dst.Add(Pred); |
| 34 | } |
| 35 | } |