blob: 36323b9efb61b3f79ea23d1b2b30c6aff8899d50 [file] [log] [blame]
Ted Kremenekc6e11ff2009-11-23 18:53:03 +00001//== 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 Kremenek1309f9a2010-01-25 04:41:41 +000015#include "clang/Checker/PathSensitive/Checker.h"
Ted Kremenekc6e11ff2009-11-23 18:53:03 +000016using namespace clang;
17
18Checker::~Checker() {}
Ted Kremenek19d67b52009-11-23 22:22:01 +000019
20CheckerContext::~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 Kremenekbfb4fc92009-12-04 06:57:49 +000027 if (ST && ST != B.GetState(Pred)) {
Ted Kremenek19d67b52009-11-23 22:22:01 +000028 static int autoTransitionTag = 0;
29 B.Tag = &autoTransitionTag;
Ted Kremenekbfb4fc92009-12-04 06:57:49 +000030 addTransition(ST);
Ted Kremenek19d67b52009-11-23 22:22:01 +000031 }
32 else
33 Dst.Add(Pred);
34 }
35}