2016-02-10 19:11:58 +00:00
|
|
|
//===- CheckerDocumentation.cpp - Documentation checker ---------*- C++ -*-===//
|
2011-11-30 17:12:52 +00:00
|
|
|
//
|
2019-01-19 08:50:56 +00:00
|
|
|
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
|
|
|
|
// See https://llvm.org/LICENSE.txt for license information.
|
|
|
|
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
2011-11-30 17:12:52 +00:00
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
//
|
|
|
|
// This checker lists all the checker callbacks and provides documentation for
|
|
|
|
// checker writers.
|
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
|
[analyzer][NFC] Move CheckerRegistry from the Core directory to Frontend
ClangCheckerRegistry is a very non-obvious, poorly documented, weird concept.
It derives from CheckerRegistry, and is placed in lib/StaticAnalyzer/Frontend,
whereas it's base is located in lib/StaticAnalyzer/Core. It was, from what I can
imagine, used to circumvent the problem that the registry functions of the
checkers are located in the clangStaticAnalyzerCheckers library, but that
library depends on clangStaticAnalyzerCore. However, clangStaticAnalyzerFrontend
depends on both of those libraries.
One can make the observation however, that CheckerRegistry has no place in Core,
it isn't used there at all! The only place where it is used is Frontend, which
is where it ultimately belongs.
This move implies that since
include/clang/StaticAnalyzer/Checkers/ClangCheckers.h only contained a single function:
class CheckerRegistry;
void registerBuiltinCheckers(CheckerRegistry ®istry);
it had to re purposed, as CheckerRegistry is no longer available to
clangStaticAnalyzerCheckers. It was renamed to BuiltinCheckerRegistration.h,
which actually describes it a lot better -- it does not contain the registration
functions for checkers, but only those generated by the tblgen files.
Differential Revision: https://reviews.llvm.org/D54436
llvm-svn: 349275
2018-12-15 16:23:51 +00:00
|
|
|
#include "clang/StaticAnalyzer/Checkers/BuiltinCheckerRegistration.h"
|
2012-12-04 09:13:33 +00:00
|
|
|
#include "clang/StaticAnalyzer/Core/BugReporter/BugType.h"
|
2011-11-30 17:12:52 +00:00
|
|
|
#include "clang/StaticAnalyzer/Core/Checker.h"
|
|
|
|
#include "clang/StaticAnalyzer/Core/CheckerManager.h"
|
|
|
|
#include "clang/StaticAnalyzer/Core/PathSensitive/CheckerContext.h"
|
|
|
|
#include "clang/StaticAnalyzer/Core/PathSensitive/ProgramStateTrait.h"
|
|
|
|
|
|
|
|
using namespace clang;
|
|
|
|
using namespace ento;
|
|
|
|
|
|
|
|
// All checkers should be placed into anonymous namespace.
|
|
|
|
// We place the CheckerDocumentation inside ento namespace to make the
|
|
|
|
// it visible in doxygen.
|
2012-11-07 02:35:02 +00:00
|
|
|
namespace clang {
|
2011-11-30 17:12:52 +00:00
|
|
|
namespace ento {
|
|
|
|
|
|
|
|
/// This checker documents the callback functions checkers can use to implement
|
|
|
|
/// the custom handling of the specific events during path exploration as well
|
|
|
|
/// as reporting bugs. Most of the callbacks are targeted at path-sensitive
|
|
|
|
/// checking.
|
|
|
|
///
|
|
|
|
/// \sa CheckerContext
|
2012-11-02 23:49:33 +00:00
|
|
|
class CheckerDocumentation : public Checker< check::PreStmt<ReturnStmt>,
|
|
|
|
check::PostStmt<DeclStmt>,
|
2011-11-30 17:12:52 +00:00
|
|
|
check::PreObjCMessage,
|
|
|
|
check::PostObjCMessage,
|
2015-09-15 01:13:53 +00:00
|
|
|
check::ObjCMessageNil,
|
2012-07-02 19:28:16 +00:00
|
|
|
check::PreCall,
|
|
|
|
check::PostCall,
|
2011-11-30 17:12:52 +00:00
|
|
|
check::BranchCondition,
|
2018-01-17 23:46:13 +00:00
|
|
|
check::NewAllocator,
|
2011-11-30 17:12:52 +00:00
|
|
|
check::Location,
|
|
|
|
check::Bind,
|
|
|
|
check::DeadSymbols,
|
2016-07-28 00:52:10 +00:00
|
|
|
check::BeginFunction,
|
2013-01-03 00:25:29 +00:00
|
|
|
check::EndFunction,
|
2011-11-30 17:12:52 +00:00
|
|
|
check::EndAnalysis,
|
|
|
|
check::EndOfTranslationUnit,
|
|
|
|
eval::Call,
|
|
|
|
eval::Assume,
|
|
|
|
check::LiveSymbols,
|
|
|
|
check::RegionChanges,
|
2012-12-20 00:38:25 +00:00
|
|
|
check::PointerEscape,
|
2013-03-28 23:15:32 +00:00
|
|
|
check::ConstPointerEscape,
|
2011-11-30 17:12:52 +00:00
|
|
|
check::Event<ImplicitNullDerefEvent>,
|
|
|
|
check::ASTDecl<FunctionDecl> > {
|
|
|
|
public:
|
2018-05-09 01:00:01 +00:00
|
|
|
/// Pre-visit the Statement.
|
2011-11-30 17:12:52 +00:00
|
|
|
///
|
|
|
|
/// The method will be called before the analyzer core processes the
|
|
|
|
/// statement. The notification is performed for every explored CFGElement,
|
|
|
|
/// which does not include the control flow statements such as IfStmt. The
|
|
|
|
/// callback can be specialized to be called with any subclass of Stmt.
|
|
|
|
///
|
|
|
|
/// See checkBranchCondition() callback for performing custom processing of
|
|
|
|
/// the branching statements.
|
|
|
|
///
|
2012-11-02 23:49:33 +00:00
|
|
|
/// check::PreStmt<ReturnStmt>
|
|
|
|
void checkPreStmt(const ReturnStmt *DS, CheckerContext &C) const {}
|
2011-11-30 17:12:52 +00:00
|
|
|
|
2018-05-09 01:00:01 +00:00
|
|
|
/// Post-visit the Statement.
|
2011-11-30 17:12:52 +00:00
|
|
|
///
|
|
|
|
/// The method will be called after the analyzer core processes the
|
|
|
|
/// statement. The notification is performed for every explored CFGElement,
|
|
|
|
/// which does not include the control flow statements such as IfStmt. The
|
|
|
|
/// callback can be specialized to be called with any subclass of Stmt.
|
|
|
|
///
|
2012-11-02 23:49:33 +00:00
|
|
|
/// check::PostStmt<DeclStmt>
|
|
|
|
void checkPostStmt(const DeclStmt *DS, CheckerContext &C) const;
|
2011-11-30 17:12:52 +00:00
|
|
|
|
2018-05-09 01:00:01 +00:00
|
|
|
/// Pre-visit the Objective C message.
|
2012-07-02 19:28:16 +00:00
|
|
|
///
|
|
|
|
/// This will be called before the analyzer core processes the method call.
|
|
|
|
/// This is called for any action which produces an Objective-C message send,
|
2012-07-18 21:59:51 +00:00
|
|
|
/// including explicit message syntax and property access.
|
2012-07-02 19:28:16 +00:00
|
|
|
///
|
|
|
|
/// check::PreObjCMessage
|
2012-07-02 19:28:04 +00:00
|
|
|
void checkPreObjCMessage(const ObjCMethodCall &M, CheckerContext &C) const {}
|
2011-11-30 17:12:52 +00:00
|
|
|
|
2018-05-09 01:00:01 +00:00
|
|
|
/// Post-visit the Objective C message.
|
2012-07-02 19:28:16 +00:00
|
|
|
/// \sa checkPreObjCMessage()
|
|
|
|
///
|
|
|
|
/// check::PostObjCMessage
|
2012-07-02 19:28:04 +00:00
|
|
|
void checkPostObjCMessage(const ObjCMethodCall &M, CheckerContext &C) const {}
|
2011-11-30 17:12:52 +00:00
|
|
|
|
2018-05-09 01:00:01 +00:00
|
|
|
/// Visit an Objective-C message whose receiver is nil.
|
2015-09-15 01:13:53 +00:00
|
|
|
///
|
|
|
|
/// This will be called when the analyzer core processes a method call whose
|
|
|
|
/// receiver is definitely nil. In this case, check{Pre/Post}ObjCMessage and
|
|
|
|
/// check{Pre/Post}Call will not be called.
|
|
|
|
///
|
|
|
|
/// check::ObjCMessageNil
|
|
|
|
void checkObjCMessageNil(const ObjCMethodCall &M, CheckerContext &C) const {}
|
|
|
|
|
2018-05-09 01:00:01 +00:00
|
|
|
/// Pre-visit an abstract "call" event.
|
2012-07-02 19:28:16 +00:00
|
|
|
///
|
|
|
|
/// This is used for checkers that want to check arguments or attributed
|
|
|
|
/// behavior for functions and methods no matter how they are being invoked.
|
|
|
|
///
|
|
|
|
/// Note that this includes ALL cross-body invocations, so if you want to
|
2012-11-02 23:49:33 +00:00
|
|
|
/// limit your checks to, say, function calls, you should test for that at the
|
|
|
|
/// beginning of your callback function.
|
2012-07-02 19:28:16 +00:00
|
|
|
///
|
|
|
|
/// check::PreCall
|
|
|
|
void checkPreCall(const CallEvent &Call, CheckerContext &C) const {}
|
|
|
|
|
2018-05-09 01:00:01 +00:00
|
|
|
/// Post-visit an abstract "call" event.
|
2012-07-02 19:28:16 +00:00
|
|
|
/// \sa checkPreObjCMessage()
|
|
|
|
///
|
|
|
|
/// check::PostCall
|
|
|
|
void checkPostCall(const CallEvent &Call, CheckerContext &C) const {}
|
|
|
|
|
2018-05-09 01:00:01 +00:00
|
|
|
/// Pre-visit of the condition statement of a branch (such as IfStmt).
|
2011-11-30 17:12:52 +00:00
|
|
|
void checkBranchCondition(const Stmt *Condition, CheckerContext &Ctx) const {}
|
|
|
|
|
2018-05-09 01:00:01 +00:00
|
|
|
/// Post-visit the C++ operator new's allocation call.
|
2018-01-17 23:46:13 +00:00
|
|
|
///
|
|
|
|
/// Execution of C++ operator new consists of the following phases: (1) call
|
|
|
|
/// default or overridden operator new() to allocate memory (2) cast the
|
|
|
|
/// return value of operator new() from void pointer type to class pointer
|
|
|
|
/// type, (3) assuming that the value is non-null, call the object's
|
|
|
|
/// constructor over this pointer, (4) declare that the value of the
|
|
|
|
/// new-expression is this pointer. This callback is called between steps
|
|
|
|
/// (2) and (3). Post-call for the allocator is called after step (1).
|
|
|
|
/// Pre-statement for the new-expression is called on step (4) when the value
|
|
|
|
/// of the expression is evaluated.
|
|
|
|
/// \param NE The C++ new-expression that triggered the allocation.
|
|
|
|
/// \param Target The allocated region, casted to the class type.
|
|
|
|
void checkNewAllocator(const CXXNewExpr *NE, SVal Target,
|
|
|
|
CheckerContext &) const {}
|
|
|
|
|
2018-05-09 01:00:01 +00:00
|
|
|
/// Called on a load from and a store to a location.
|
2011-11-30 17:12:52 +00:00
|
|
|
///
|
|
|
|
/// The method will be called each time a location (pointer) value is
|
|
|
|
/// accessed.
|
|
|
|
/// \param Loc The value of the location (pointer).
|
|
|
|
/// \param IsLoad The flag specifying if the location is a store or a load.
|
|
|
|
/// \param S The load is performed while processing the statement.
|
|
|
|
///
|
|
|
|
/// check::Location
|
|
|
|
void checkLocation(SVal Loc, bool IsLoad, const Stmt *S,
|
2012-06-15 07:41:35 +00:00
|
|
|
CheckerContext &) const {}
|
2011-11-30 17:12:52 +00:00
|
|
|
|
2018-05-09 01:00:01 +00:00
|
|
|
/// Called on binding of a value to a location.
|
2011-11-30 17:12:52 +00:00
|
|
|
///
|
|
|
|
/// \param Loc The value of the location (pointer).
|
|
|
|
/// \param Val The value which will be stored at the location Loc.
|
|
|
|
/// \param S The bind is performed while processing the statement S.
|
|
|
|
///
|
|
|
|
/// check::Bind
|
2012-06-15 07:41:35 +00:00
|
|
|
void checkBind(SVal Loc, SVal Val, const Stmt *S, CheckerContext &) const {}
|
2011-11-30 17:12:52 +00:00
|
|
|
|
2018-05-09 01:00:01 +00:00
|
|
|
/// Called whenever a symbol becomes dead.
|
2011-11-30 17:12:52 +00:00
|
|
|
///
|
|
|
|
/// This callback should be used by the checkers to aggressively clean
|
|
|
|
/// up/reduce the checker state, which is important for reducing the overall
|
|
|
|
/// memory usage. Specifically, if a checker keeps symbol specific information
|
Misc typos fixes in ./lib folder
Summary: Found via `codespell -q 3 -I ../clang-whitelist.txt -L uint,importd,crasher,gonna,cant,ue,ons,orign,ned`
Reviewers: teemperor
Reviewed By: teemperor
Subscribers: teemperor, jholewinski, jvesely, nhaehnle, whisperity, jfb, cfe-commits
Differential Revision: https://reviews.llvm.org/D55475
llvm-svn: 348755
2018-12-10 12:37:46 +00:00
|
|
|
/// in the state, it can and should be dropped after the symbol becomes dead.
|
2011-11-30 17:12:52 +00:00
|
|
|
/// In addition, reporting a bug as soon as the checker becomes dead leads to
|
|
|
|
/// more precise diagnostics. (For example, one should report that a malloced
|
|
|
|
/// variable is not freed right after it goes out of scope.)
|
|
|
|
///
|
|
|
|
/// \param SR The SymbolReaper object can be queried to determine which
|
|
|
|
/// symbols are dead.
|
|
|
|
///
|
|
|
|
/// check::DeadSymbols
|
|
|
|
void checkDeadSymbols(SymbolReaper &SR, CheckerContext &C) const {}
|
|
|
|
|
2016-02-19 01:35:10 +00:00
|
|
|
|
2018-05-09 01:00:01 +00:00
|
|
|
/// Called when the analyzer core starts analyzing a function,
|
2016-02-19 01:35:10 +00:00
|
|
|
/// regardless of whether it is analyzed at the top level or is inlined.
|
|
|
|
///
|
|
|
|
/// check::BeginFunction
|
|
|
|
void checkBeginFunction(CheckerContext &Ctx) const {}
|
|
|
|
|
2018-05-09 01:00:01 +00:00
|
|
|
/// Called when the analyzer core reaches the end of a
|
2016-02-19 01:35:10 +00:00
|
|
|
/// function being analyzed regardless of whether it is analyzed at the top
|
|
|
|
/// level or is inlined.
|
2011-11-30 17:12:52 +00:00
|
|
|
///
|
2013-01-03 00:25:29 +00:00
|
|
|
/// check::EndFunction
|
2018-07-16 20:47:45 +00:00
|
|
|
void checkEndFunction(const ReturnStmt *RS, CheckerContext &Ctx) const {}
|
2011-11-30 17:12:52 +00:00
|
|
|
|
2018-05-09 01:00:01 +00:00
|
|
|
/// Called after all the paths in the ExplodedGraph reach end of path
|
2011-11-30 17:12:52 +00:00
|
|
|
/// - the symbolic execution graph is fully explored.
|
|
|
|
///
|
|
|
|
/// This callback should be used in cases when a checker needs to have a
|
|
|
|
/// global view of the information generated on all paths. For example, to
|
|
|
|
/// compare execution summary/result several paths.
|
|
|
|
/// See IdempotentOperationChecker for a usage example.
|
|
|
|
///
|
|
|
|
/// check::EndAnalysis
|
|
|
|
void checkEndAnalysis(ExplodedGraph &G,
|
|
|
|
BugReporter &BR,
|
|
|
|
ExprEngine &Eng) const {}
|
|
|
|
|
2018-05-09 01:00:01 +00:00
|
|
|
/// Called after analysis of a TranslationUnit is complete.
|
2011-11-30 17:12:52 +00:00
|
|
|
///
|
|
|
|
/// check::EndOfTranslationUnit
|
2012-03-23 02:43:24 +00:00
|
|
|
void checkEndOfTranslationUnit(const TranslationUnitDecl *TU,
|
|
|
|
AnalysisManager &Mgr,
|
|
|
|
BugReporter &BR) const {}
|
2011-11-30 17:12:52 +00:00
|
|
|
|
2018-05-09 01:00:01 +00:00
|
|
|
/// Evaluates function call.
|
2011-11-30 17:12:52 +00:00
|
|
|
///
|
2019-01-29 10:15:52 +00:00
|
|
|
/// The analysis core treats all function calls in the same way. However, some
|
2011-11-30 17:12:52 +00:00
|
|
|
/// functions have special meaning, which should be reflected in the program
|
|
|
|
/// state. This callback allows a checker to provide domain specific knowledge
|
|
|
|
/// about the particular functions it knows about.
|
|
|
|
///
|
|
|
|
/// \returns true if the call has been successfully evaluated
|
|
|
|
/// and false otherwise. Note, that only one checker can evaluate a call. If
|
2013-05-25 02:22:10 +00:00
|
|
|
/// more than one checker claims that they can evaluate the same call the
|
2011-11-30 17:12:52 +00:00
|
|
|
/// first one wins.
|
|
|
|
///
|
|
|
|
/// eval::Call
|
|
|
|
bool evalCall(const CallExpr *CE, CheckerContext &C) const { return true; }
|
|
|
|
|
2018-05-09 01:00:01 +00:00
|
|
|
/// Handles assumptions on symbolic values.
|
2011-11-30 17:12:52 +00:00
|
|
|
///
|
|
|
|
/// This method is called when a symbolic expression is assumed to be true or
|
|
|
|
/// false. For example, the assumptions are performed when evaluating a
|
|
|
|
/// condition at a branch. The callback allows checkers track the assumptions
|
|
|
|
/// performed on the symbols of interest and change the state accordingly.
|
|
|
|
///
|
|
|
|
/// eval::Assume
|
2012-01-26 21:29:00 +00:00
|
|
|
ProgramStateRef evalAssume(ProgramStateRef State,
|
2011-11-30 17:12:52 +00:00
|
|
|
SVal Cond,
|
|
|
|
bool Assumption) const { return State; }
|
|
|
|
|
|
|
|
/// Allows modifying SymbolReaper object. For example, checkers can explicitly
|
|
|
|
/// register symbols of interest as live. These symbols will not be marked
|
|
|
|
/// dead and removed.
|
|
|
|
///
|
|
|
|
/// check::LiveSymbols
|
2012-01-26 21:29:00 +00:00
|
|
|
void checkLiveSymbols(ProgramStateRef State, SymbolReaper &SR) const {}
|
2011-11-30 17:12:52 +00:00
|
|
|
|
2018-05-09 01:00:01 +00:00
|
|
|
/// Called when the contents of one or more regions change.
|
2012-11-07 02:35:02 +00:00
|
|
|
///
|
|
|
|
/// This can occur in many different ways: an explicit bind, a blanket
|
|
|
|
/// invalidation of the region contents, or by passing a region to a function
|
|
|
|
/// call whose behavior the analyzer cannot model perfectly.
|
2012-06-15 07:41:35 +00:00
|
|
|
///
|
|
|
|
/// \param State The current program state.
|
|
|
|
/// \param Invalidated A set of all symbols potentially touched by the change.
|
2012-02-14 21:55:24 +00:00
|
|
|
/// \param ExplicitRegions The regions explicitly requested for invalidation.
|
2012-11-07 02:35:02 +00:00
|
|
|
/// For a function call, this would be the arguments. For a bind, this
|
|
|
|
/// would be the region being bound to.
|
|
|
|
/// \param Regions The transitive closure of regions accessible from,
|
|
|
|
/// \p ExplicitRegions, i.e. all regions that may have been touched
|
|
|
|
/// by this change. For a simple bind, this list will be the same as
|
|
|
|
/// \p ExplicitRegions, since a bind does not affect the contents of
|
|
|
|
/// anything accessible through the base region.
|
2017-01-13 00:50:57 +00:00
|
|
|
/// \param LCtx LocationContext that is useful for getting various contextual
|
|
|
|
/// info, like callstack, CFG etc.
|
2012-11-07 02:35:02 +00:00
|
|
|
/// \param Call The opaque call triggering this invalidation. Will be 0 if the
|
|
|
|
/// change was not triggered by a call.
|
|
|
|
///
|
2012-06-15 07:41:35 +00:00
|
|
|
/// check::RegionChanges
|
2015-09-08 03:50:52 +00:00
|
|
|
ProgramStateRef
|
2012-01-26 21:29:00 +00:00
|
|
|
checkRegionChanges(ProgramStateRef State,
|
2012-12-20 00:38:25 +00:00
|
|
|
const InvalidatedSymbols *Invalidated,
|
2011-11-30 17:12:52 +00:00
|
|
|
ArrayRef<const MemRegion *> ExplicitRegions,
|
2012-02-14 21:55:24 +00:00
|
|
|
ArrayRef<const MemRegion *> Regions,
|
2017-01-13 00:50:57 +00:00
|
|
|
const LocationContext *LCtx,
|
2012-07-02 19:27:35 +00:00
|
|
|
const CallEvent *Call) const {
|
2011-11-30 17:12:52 +00:00
|
|
|
return State;
|
|
|
|
}
|
|
|
|
|
2018-05-09 01:00:01 +00:00
|
|
|
/// Called when pointers escape.
|
2012-12-20 00:38:25 +00:00
|
|
|
///
|
|
|
|
/// This notifies the checkers about pointer escape, which occurs whenever
|
2012-12-21 01:50:14 +00:00
|
|
|
/// the analyzer cannot track the symbol any more. For example, as a
|
2015-09-08 03:50:52 +00:00
|
|
|
/// result of assigning a pointer into a global or when it's passed to a
|
2012-12-20 00:38:25 +00:00
|
|
|
/// function call the analyzer cannot model.
|
2015-09-08 03:50:52 +00:00
|
|
|
///
|
2012-12-20 00:38:25 +00:00
|
|
|
/// \param State The state at the point of escape.
|
|
|
|
/// \param Escaped The list of escaped symbols.
|
2015-09-08 03:50:52 +00:00
|
|
|
/// \param Call The corresponding CallEvent, if the symbols escape as
|
2012-12-20 00:38:25 +00:00
|
|
|
/// parameters to the given call.
|
2013-02-07 23:05:43 +00:00
|
|
|
/// \param Kind How the symbols have escaped.
|
2012-12-20 00:38:25 +00:00
|
|
|
/// \returns Checkers can modify the state by returning a new state.
|
|
|
|
ProgramStateRef checkPointerEscape(ProgramStateRef State,
|
|
|
|
const InvalidatedSymbols &Escaped,
|
2013-02-07 23:05:43 +00:00
|
|
|
const CallEvent *Call,
|
|
|
|
PointerEscapeKind Kind) const {
|
2012-12-20 00:38:25 +00:00
|
|
|
return State;
|
|
|
|
}
|
|
|
|
|
2018-05-09 01:00:01 +00:00
|
|
|
/// Called when const pointers escape.
|
2013-03-28 23:15:32 +00:00
|
|
|
///
|
|
|
|
/// Note: in most cases checkPointerEscape callback is sufficient.
|
|
|
|
/// \sa checkPointerEscape
|
|
|
|
ProgramStateRef checkConstPointerEscape(ProgramStateRef State,
|
|
|
|
const InvalidatedSymbols &Escaped,
|
|
|
|
const CallEvent *Call,
|
|
|
|
PointerEscapeKind Kind) const {
|
|
|
|
return State;
|
|
|
|
}
|
2015-09-08 03:50:52 +00:00
|
|
|
|
2011-11-30 17:12:52 +00:00
|
|
|
/// check::Event<ImplicitNullDerefEvent>
|
|
|
|
void checkEvent(ImplicitNullDerefEvent Event) const {}
|
|
|
|
|
2018-05-09 01:00:01 +00:00
|
|
|
/// Check every declaration in the AST.
|
2011-11-30 17:12:52 +00:00
|
|
|
///
|
|
|
|
/// An AST traversal callback, which should only be used when the checker is
|
|
|
|
/// not path sensitive. It will be called for every Declaration in the AST and
|
|
|
|
/// can be specialized to only be called on subclasses of Decl, for example,
|
|
|
|
/// FunctionDecl.
|
|
|
|
///
|
|
|
|
/// check::ASTDecl<FunctionDecl>
|
|
|
|
void checkASTDecl(const FunctionDecl *D,
|
|
|
|
AnalysisManager &Mgr,
|
|
|
|
BugReporter &BR) const {}
|
|
|
|
};
|
|
|
|
|
2012-11-02 23:49:33 +00:00
|
|
|
void CheckerDocumentation::checkPostStmt(const DeclStmt *DS,
|
2011-11-30 17:12:52 +00:00
|
|
|
CheckerContext &C) const {
|
|
|
|
}
|
|
|
|
|
2012-11-07 02:35:02 +00:00
|
|
|
} // end namespace ento
|
|
|
|
} // end namespace clang
|