From 110eaaceddcec790f7e6a5e3bf1261c9aa1e73ab Mon Sep 17 00:00:00 2001 From: dim Date: Mon, 2 May 2011 19:39:53 +0000 Subject: Vendor import of clang trunk r130700: http://llvm.org/svn/llvm-project/cfe/trunk@130700 --- lib/StaticAnalyzer/Core/CheckerContext.cpp | 33 ++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 lib/StaticAnalyzer/Core/CheckerContext.cpp (limited to 'lib/StaticAnalyzer/Core/CheckerContext.cpp') diff --git a/lib/StaticAnalyzer/Core/CheckerContext.cpp b/lib/StaticAnalyzer/Core/CheckerContext.cpp new file mode 100644 index 0000000..f6fb8f2 --- /dev/null +++ b/lib/StaticAnalyzer/Core/CheckerContext.cpp @@ -0,0 +1,33 @@ +//== CheckerContext.cpp - Context info for path-sensitive checkers-----------=// +// +// The LLVM Compiler Infrastructure +// +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// +// +// This file defines CheckerContext that provides contextual info for +// path-sensitive checkers. +// +//===----------------------------------------------------------------------===// + +#include "clang/StaticAnalyzer/Core/PathSensitive/CheckerContext.h" +using namespace clang; +using namespace ento; + +CheckerContext::~CheckerContext() { + // Do we need to autotransition? 'Dst' can get populated in a variety of + // ways, including 'addTransition()' adding the predecessor node to Dst + // without actually generated a new node. We also shouldn't autotransition + // if we are building sinks or we generated a node and decided to not + // add it as a transition. + if (Dst.size() == size && !B.BuildSinks && !B.hasGeneratedNode) { + if (ST && ST != B.GetState(Pred)) { + static int autoTransitionTag = 0; + addTransition(ST, &autoTransitionTag); + } + else + Dst.Add(Pred); + } +} -- cgit v1.1