]> CyberLeo.Net >> Repos - FreeBSD/releng/9.0.git/blob - contrib/llvm/tools/clang/lib/StaticAnalyzer/Core/CheckerContext.cpp
Copy stable/9 to releng/9.0 as part of the FreeBSD 9.0-RELEASE release
[FreeBSD/releng/9.0.git] / contrib / llvm / tools / clang / lib / StaticAnalyzer / Core / CheckerContext.cpp
1 //== CheckerContext.cpp - Context info for path-sensitive checkers-----------=//
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 CheckerContext that provides contextual info for
11 //  path-sensitive checkers.
12 //
13 //===----------------------------------------------------------------------===//
14
15 #include "clang/StaticAnalyzer/Core/PathSensitive/CheckerContext.h"
16 using namespace clang;
17 using namespace ento;
18
19 CheckerContext::~CheckerContext() {
20   // Do we need to autotransition?  'Dst' can get populated in a variety of
21   // ways, including 'addTransition()' adding the predecessor node to Dst
22   // without actually generated a new node.  We also shouldn't autotransition
23   // if we are building sinks or we generated a node and decided to not
24   // add it as a transition.
25   if (Dst.size() == size && !B.BuildSinks && !B.hasGeneratedNode) {
26     if (ST && ST != Pred->getState()) {
27       static SimpleProgramPointTag autoTransitionTag("CheckerContext : auto");
28       addTransition(ST, &autoTransitionTag);
29     }
30     else
31       Dst.Add(Pred);
32   }
33 }