2011-03-01 09:16:08 +08:00
|
|
|
//== CheckerContext.cpp - Context info for path-sensitive checkers-----------=//
|
2009-11-24 02:53:03 +08:00
|
|
|
//
|
|
|
|
// The LLVM Compiler Infrastructure
|
|
|
|
//
|
|
|
|
// This file is distributed under the University of Illinois Open Source
|
|
|
|
// License. See LICENSE.TXT for details.
|
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
//
|
2011-03-01 09:16:08 +08:00
|
|
|
// This file defines CheckerContext that provides contextual info for
|
|
|
|
// path-sensitive checkers.
|
2009-11-24 02:53:03 +08:00
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
|
2011-03-01 09:16:08 +08:00
|
|
|
#include "clang/StaticAnalyzer/Core/PathSensitive/CheckerContext.h"
|
2009-11-24 02:53:03 +08:00
|
|
|
using namespace clang;
|
2010-12-23 15:20:52 +08:00
|
|
|
using namespace ento;
|
2009-11-24 02:53:03 +08:00
|
|
|
|
2009-11-24 06:22:01 +08:00
|
|
|
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.
|
2011-01-13 12:36:46 +08:00
|
|
|
if (Dst.size() == size && !B.BuildSinks && !B.hasGeneratedNode) {
|
2011-08-11 08:11:21 +08:00
|
|
|
if (ST && ST != Pred->getState()) {
|
2011-08-13 07:04:46 +08:00
|
|
|
static SimpleProgramPointTag autoTransitionTag("CheckerContext : auto");
|
2011-01-13 12:36:36 +08:00
|
|
|
addTransition(ST, &autoTransitionTag);
|
2009-11-24 06:22:01 +08:00
|
|
|
}
|
|
|
|
else
|
|
|
|
Dst.Add(Pred);
|
|
|
|
}
|
|
|
|
}
|