blob: 6867ff5b645ddbc99c689b4062c8423ca819ecf1 [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 Kremenek21142582010-12-23 19:38:26 +000015#include "clang/StaticAnalyzer/PathSensitive/Checker.h"
Ted Kremenekc6e11ff2009-11-23 18:53:03 +000016using namespace clang;
Ted Kremenek9ef65372010-12-23 07:20:52 +000017using namespace ento;
Ted Kremenekc6e11ff2009-11-23 18:53:03 +000018
19Checker::~Checker() {}
Ted Kremenek19d67b52009-11-23 22:22:01 +000020
21CheckerContext::~CheckerContext() {
22 // Do we need to autotransition? 'Dst' can get populated in a variety of
23 // ways, including 'addTransition()' adding the predecessor node to Dst
24 // without actually generated a new node. We also shouldn't autotransition
25 // if we are building sinks or we generated a node and decided to not
26 // add it as a transition.
27 if (Dst.size() == size && !B.BuildSinks && !B.HasGeneratedNode) {
Ted Kremenekbfb4fc92009-12-04 06:57:49 +000028 if (ST && ST != B.GetState(Pred)) {
Ted Kremenek19d67b52009-11-23 22:22:01 +000029 static int autoTransitionTag = 0;
30 B.Tag = &autoTransitionTag;
Ted Kremenekbfb4fc92009-12-04 06:57:49 +000031 addTransition(ST);
Ted Kremenek19d67b52009-11-23 22:22:01 +000032 }
33 else
34 Dst.Add(Pred);
35 }
36}