clang  14.0.0git
Checker.h
Go to the documentation of this file.
1 //== Checker.h - Registration mechanism for checkers -------------*- C++ -*--=//
2 //
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6 //
7 //===----------------------------------------------------------------------===//
8 //
9 // This file defines Checker, used to create and register checkers.
10 //
11 //===----------------------------------------------------------------------===//
12 
13 #ifndef LLVM_CLANG_STATICANALYZER_CORE_CHECKER_H
14 #define LLVM_CLANG_STATICANALYZER_CORE_CHECKER_H
15 
20 #include "llvm/Support/Casting.h"
21 
22 namespace clang {
23 namespace ento {
24  class BugReporter;
25 
26 namespace check {
27 
28 template <typename DECL>
29 class ASTDecl {
30  template <typename CHECKER>
31  static void _checkDecl(void *checker, const Decl *D, AnalysisManager& mgr,
32  BugReporter &BR) {
33  ((const CHECKER *)checker)->checkASTDecl(cast<DECL>(D), mgr, BR);
34  }
35 
36  static bool _handlesDecl(const Decl *D) {
37  return isa<DECL>(D);
38  }
39 public:
40  template <typename CHECKER>
41  static void _register(CHECKER *checker, CheckerManager &mgr) {
43  _checkDecl<CHECKER>),
44  _handlesDecl);
45  }
46 };
47 
48 class ASTCodeBody {
49  template <typename CHECKER>
50  static void _checkBody(void *checker, const Decl *D, AnalysisManager& mgr,
51  BugReporter &BR) {
52  ((const CHECKER *)checker)->checkASTCodeBody(D, mgr, BR);
53  }
54 
55 public:
56  template <typename CHECKER>
57  static void _register(CHECKER *checker, CheckerManager &mgr) {
59  _checkBody<CHECKER>));
60  }
61 };
62 
64  template <typename CHECKER>
65  static void _checkEndOfTranslationUnit(void *checker,
66  const TranslationUnitDecl *TU,
67  AnalysisManager& mgr,
68  BugReporter &BR) {
69  ((const CHECKER *)checker)->checkEndOfTranslationUnit(TU, mgr, BR);
70  }
71 
72 public:
73  template <typename CHECKER>
74  static void _register(CHECKER *checker, CheckerManager &mgr){
77  _checkEndOfTranslationUnit<CHECKER>));
78  }
79 };
80 
81 template <typename STMT>
82 class PreStmt {
83  template <typename CHECKER>
84  static void _checkStmt(void *checker, const Stmt *S, CheckerContext &C) {
85  ((const CHECKER *)checker)->checkPreStmt(cast<STMT>(S), C);
86  }
87 
88  static bool _handlesStmt(const Stmt *S) {
89  return isa<STMT>(S);
90  }
91 public:
92  template <typename CHECKER>
93  static void _register(CHECKER *checker, CheckerManager &mgr) {
95  _checkStmt<CHECKER>),
96  _handlesStmt);
97  }
98 };
99 
100 template <typename STMT>
101 class PostStmt {
102  template <typename CHECKER>
103  static void _checkStmt(void *checker, const Stmt *S, CheckerContext &C) {
104  ((const CHECKER *)checker)->checkPostStmt(cast<STMT>(S), C);
105  }
106 
107  static bool _handlesStmt(const Stmt *S) {
108  return isa<STMT>(S);
109  }
110 public:
111  template <typename CHECKER>
112  static void _register(CHECKER *checker, CheckerManager &mgr) {
114  _checkStmt<CHECKER>),
115  _handlesStmt);
116  }
117 };
118 
120  template <typename CHECKER>
121  static void _checkObjCMessage(void *checker, const ObjCMethodCall &msg,
122  CheckerContext &C) {
123  ((const CHECKER *)checker)->checkPreObjCMessage(msg, C);
124  }
125 
126 public:
127  template <typename CHECKER>
128  static void _register(CHECKER *checker, CheckerManager &mgr) {
130  CheckerManager::CheckObjCMessageFunc(checker, _checkObjCMessage<CHECKER>));
131  }
132 };
133 
135  template <typename CHECKER>
136  static void _checkObjCMessage(void *checker, const ObjCMethodCall &msg,
137  CheckerContext &C) {
138  ((const CHECKER *)checker)->checkObjCMessageNil(msg, C);
139  }
140 
141 public:
142  template <typename CHECKER>
143  static void _register(CHECKER *checker, CheckerManager &mgr) {
145  CheckerManager::CheckObjCMessageFunc(checker, _checkObjCMessage<CHECKER>));
146  }
147 };
148 
150  template <typename CHECKER>
151  static void _checkObjCMessage(void *checker, const ObjCMethodCall &msg,
152  CheckerContext &C) {
153  ((const CHECKER *)checker)->checkPostObjCMessage(msg, C);
154  }
155 
156 public:
157  template <typename CHECKER>
158  static void _register(CHECKER *checker, CheckerManager &mgr) {
160  CheckerManager::CheckObjCMessageFunc(checker, _checkObjCMessage<CHECKER>));
161  }
162 };
163 
164 class PreCall {
165  template <typename CHECKER>
166  static void _checkCall(void *checker, const CallEvent &msg,
167  CheckerContext &C) {
168  ((const CHECKER *)checker)->checkPreCall(msg, C);
169  }
170 
171 public:
172  template <typename CHECKER>
173  static void _register(CHECKER *checker, CheckerManager &mgr) {
175  CheckerManager::CheckCallFunc(checker, _checkCall<CHECKER>));
176  }
177 };
178 
179 class PostCall {
180  template <typename CHECKER>
181  static void _checkCall(void *checker, const CallEvent &msg,
182  CheckerContext &C) {
183  ((const CHECKER *)checker)->checkPostCall(msg, C);
184  }
185 
186 public:
187  template <typename CHECKER>
188  static void _register(CHECKER *checker, CheckerManager &mgr) {
190  CheckerManager::CheckCallFunc(checker, _checkCall<CHECKER>));
191  }
192 };
193 
194 class Location {
195  template <typename CHECKER>
196  static void _checkLocation(void *checker,
197  const SVal &location, bool isLoad, const Stmt *S,
198  CheckerContext &C) {
199  ((const CHECKER *)checker)->checkLocation(location, isLoad, S, C);
200  }
201 
202 public:
203  template <typename CHECKER>
204  static void _register(CHECKER *checker, CheckerManager &mgr) {
206  CheckerManager::CheckLocationFunc(checker, _checkLocation<CHECKER>));
207  }
208 };
209 
210 class Bind {
211  template <typename CHECKER>
212  static void _checkBind(void *checker,
213  const SVal &location, const SVal &val, const Stmt *S,
214  CheckerContext &C) {
215  ((const CHECKER *)checker)->checkBind(location, val, S, C);
216  }
217 
218 public:
219  template <typename CHECKER>
220  static void _register(CHECKER *checker, CheckerManager &mgr) {
221  mgr._registerForBind(
222  CheckerManager::CheckBindFunc(checker, _checkBind<CHECKER>));
223  }
224 };
225 
226 class EndAnalysis {
227  template <typename CHECKER>
228  static void _checkEndAnalysis(void *checker, ExplodedGraph &G,
229  BugReporter &BR, ExprEngine &Eng) {
230  ((const CHECKER *)checker)->checkEndAnalysis(G, BR, Eng);
231  }
232 
233 public:
234  template <typename CHECKER>
235  static void _register(CHECKER *checker, CheckerManager &mgr) {
237  CheckerManager::CheckEndAnalysisFunc(checker, _checkEndAnalysis<CHECKER>));
238  }
239 };
240 
242  template <typename CHECKER>
243  static void _checkBeginFunction(void *checker, CheckerContext &C) {
244  ((const CHECKER *)checker)->checkBeginFunction(C);
245  }
246 
247 public:
248  template <typename CHECKER>
249  static void _register(CHECKER *checker, CheckerManager &mgr) {
251  checker, _checkBeginFunction<CHECKER>));
252  }
253 };
254 
255 class EndFunction {
256  template <typename CHECKER>
257  static void _checkEndFunction(void *checker, const ReturnStmt *RS,
258  CheckerContext &C) {
259  ((const CHECKER *)checker)->checkEndFunction(RS, C);
260  }
261 
262 public:
263  template <typename CHECKER>
264  static void _register(CHECKER *checker, CheckerManager &mgr) {
266  CheckerManager::CheckEndFunctionFunc(checker, _checkEndFunction<CHECKER>));
267  }
268 };
269 
271  template <typename CHECKER>
272  static void _checkBranchCondition(void *checker, const Stmt *Condition,
273  CheckerContext & C) {
274  ((const CHECKER *)checker)->checkBranchCondition(Condition, C);
275  }
276 
277 public:
278  template <typename CHECKER>
279  static void _register(CHECKER *checker, CheckerManager &mgr) {
282  _checkBranchCondition<CHECKER>));
283  }
284 };
285 
287  template <typename CHECKER>
288  static void _checkNewAllocator(void *checker, const CXXAllocatorCall &Call,
289  CheckerContext &C) {
290  ((const CHECKER *)checker)->checkNewAllocator(Call, C);
291  }
292 
293 public:
294  template <typename CHECKER>
295  static void _register(CHECKER *checker, CheckerManager &mgr) {
298  _checkNewAllocator<CHECKER>));
299  }
300 };
301 
302 class LiveSymbols {
303  template <typename CHECKER>
304  static void _checkLiveSymbols(void *checker, ProgramStateRef state,
305  SymbolReaper &SR) {
306  ((const CHECKER *)checker)->checkLiveSymbols(state, SR);
307  }
308 
309 public:
310  template <typename CHECKER>
311  static void _register(CHECKER *checker, CheckerManager &mgr) {
313  CheckerManager::CheckLiveSymbolsFunc(checker, _checkLiveSymbols<CHECKER>));
314  }
315 };
316 
317 class DeadSymbols {
318  template <typename CHECKER>
319  static void _checkDeadSymbols(void *checker,
320  SymbolReaper &SR, CheckerContext &C) {
321  ((const CHECKER *)checker)->checkDeadSymbols(SR, C);
322  }
323 
324 public:
325  template <typename CHECKER>
326  static void _register(CHECKER *checker, CheckerManager &mgr) {
328  CheckerManager::CheckDeadSymbolsFunc(checker, _checkDeadSymbols<CHECKER>));
329  }
330 };
331 
333  template <typename CHECKER>
334  static ProgramStateRef
335  _checkRegionChanges(void *checker,
337  const InvalidatedSymbols *invalidated,
338  ArrayRef<const MemRegion *> Explicits,
340  const LocationContext *LCtx,
341  const CallEvent *Call) {
342  return ((const CHECKER *) checker)->checkRegionChanges(state, invalidated,
343  Explicits, Regions,
344  LCtx, Call);
345  }
346 
347 public:
348  template <typename CHECKER>
349  static void _register(CHECKER *checker, CheckerManager &mgr) {
352  _checkRegionChanges<CHECKER>));
353  }
354 };
355 
357  template <typename CHECKER>
358  static ProgramStateRef
359  _checkPointerEscape(void *Checker,
361  const InvalidatedSymbols &Escaped,
362  const CallEvent *Call,
365 
366  if (!ETraits)
367  return ((const CHECKER *)Checker)->checkPointerEscape(State,
368  Escaped,
369  Call,
370  Kind);
371 
372  InvalidatedSymbols RegularEscape;
373  for (InvalidatedSymbols::const_iterator I = Escaped.begin(),
374  E = Escaped.end(); I != E; ++I)
375  if (!ETraits->hasTrait(*I,
377  !ETraits->hasTrait(*I,
379  RegularEscape.insert(*I);
380 
381  if (RegularEscape.empty())
382  return State;
383 
384  return ((const CHECKER *)Checker)->checkPointerEscape(State,
385  RegularEscape,
386  Call,
387  Kind);
388  }
389 
390 public:
391  template <typename CHECKER>
392  static void _register(CHECKER *checker, CheckerManager &mgr) {
395  _checkPointerEscape<CHECKER>));
396  }
397 };
398 
400  template <typename CHECKER>
401  static ProgramStateRef
402  _checkConstPointerEscape(void *Checker,
404  const InvalidatedSymbols &Escaped,
405  const CallEvent *Call,
408 
409  if (!ETraits)
410  return State;
411 
412  InvalidatedSymbols ConstEscape;
413  for (InvalidatedSymbols::const_iterator I = Escaped.begin(),
414  E = Escaped.end(); I != E; ++I)
415  if (ETraits->hasTrait(*I,
417  !ETraits->hasTrait(*I,
419  ConstEscape.insert(*I);
420 
421  if (ConstEscape.empty())
422  return State;
423 
424  return ((const CHECKER *)Checker)->checkConstPointerEscape(State,
425  ConstEscape,
426  Call,
427  Kind);
428  }
429 
430 public:
431  template <typename CHECKER>
432  static void _register(CHECKER *checker, CheckerManager &mgr) {
435  _checkConstPointerEscape<CHECKER>));
436  }
437 };
438 
439 
440 template <typename EVENT>
441 class Event {
442  template <typename CHECKER>
443  static void _checkEvent(void *checker, const void *event) {
444  ((const CHECKER *)checker)->checkEvent(*(const EVENT *)event);
445  }
446 public:
447  template <typename CHECKER>
448  static void _register(CHECKER *checker, CheckerManager &mgr) {
449  mgr._registerListenerForEvent<EVENT>(
450  CheckerManager::CheckEventFunc(checker, _checkEvent<CHECKER>));
451  }
452 };
453 
454 } // end check namespace
455 
456 namespace eval {
457 
458 class Assume {
459  template <typename CHECKER>
460  static ProgramStateRef _evalAssume(void *checker,
462  const SVal &cond,
463  bool assumption) {
464  return ((const CHECKER *)checker)->evalAssume(state, cond, assumption);
465  }
466 
467 public:
468  template <typename CHECKER>
469  static void _register(CHECKER *checker, CheckerManager &mgr) {
471  CheckerManager::EvalAssumeFunc(checker, _evalAssume<CHECKER>));
472  }
473 };
474 
475 class Call {
476  template <typename CHECKER>
477  static bool _evalCall(void *checker, const CallEvent &Call,
478  CheckerContext &C) {
479  return ((const CHECKER *)checker)->evalCall(Call, C);
480  }
481 
482 public:
483  template <typename CHECKER>
484  static void _register(CHECKER *checker, CheckerManager &mgr) {
486  CheckerManager::EvalCallFunc(checker, _evalCall<CHECKER>));
487  }
488 };
489 
490 } // end eval namespace
491 
492 class CheckerBase : public ProgramPointTag {
493  CheckerNameRef Name;
494  friend class ::clang::ento::CheckerManager;
495 
496 public:
497  StringRef getTagDescription() const override;
499 
500  /// See CheckerManager::runCheckersForPrintState.
501  virtual void printState(raw_ostream &Out, ProgramStateRef State,
502  const char *NL, const char *Sep) const { }
503 };
504 
505 /// Dump checker name to stream.
506 raw_ostream& operator<<(raw_ostream &Out, const CheckerBase &Checker);
507 
508 /// Tag that can use a checker name as a message provider
509 /// (see SimpleProgramPointTag).
511 public:
512  CheckerProgramPointTag(StringRef CheckerName, StringRef Msg);
513  CheckerProgramPointTag(const CheckerBase *Checker, StringRef Msg);
514 };
515 
516 template <typename CHECK1, typename... CHECKs>
517 class Checker : public CHECK1, public CHECKs..., public CheckerBase {
518 public:
519  template <typename CHECKER>
520  static void _register(CHECKER *checker, CheckerManager &mgr) {
521  CHECK1::_register(checker, mgr);
522  Checker<CHECKs...>::_register(checker, mgr);
523  }
524 };
525 
526 template <typename CHECK1>
527 class Checker<CHECK1> : public CHECK1, public CheckerBase {
528 public:
529  template <typename CHECKER>
530  static void _register(CHECKER *checker, CheckerManager &mgr) {
531  CHECK1::_register(checker, mgr);
532  }
533 };
534 
535 template <typename EVENT>
537  CheckerManager *Mgr;
538 public:
539  EventDispatcher() : Mgr(nullptr) { }
540 
541  template <typename CHECKER>
542  static void _register(CHECKER *checker, CheckerManager &mgr) {
543  mgr._registerDispatcherForEvent<EVENT>();
544  static_cast<EventDispatcher<EVENT> *>(checker)->Mgr = &mgr;
545  }
546 
547  void dispatchEvent(const EVENT &event) const {
548  Mgr->_dispatchEvent(event);
549  }
550 };
551 
552 /// We dereferenced a location that may be null.
555  bool IsLoad;
558  // When true, the dereference is in the source code directly. When false, the
559  // dereference might happen later (for example pointer passed to a parameter
560  // that is marked with nonnull attribute.)
562 
563  static int Tag;
564 };
565 
566 /// A helper class which wraps a boolean value set to false by default.
567 ///
568 /// This class should behave exactly like 'bool' except that it doesn't need to
569 /// be explicitly initialized.
570 struct DefaultBool {
571  bool val;
573  /*implicit*/ operator bool&() { return val; }
574  /*implicit*/ operator const bool&() const { return val; }
575  DefaultBool &operator=(bool b) { val = b; return *this; }
576 };
577 
578 } // end ento namespace
579 
580 } // end clang namespace
581 
582 #endif
clang::ento::CheckerProgramPointTag::CheckerProgramPointTag
CheckerProgramPointTag(StringRef CheckerName, StringRef Msg)
Definition: Checker.cpp:27
clang::ento::check::ASTCodeBody::_register
static void _register(CHECKER *checker, CheckerManager &mgr)
Definition: Checker.h:57
clang::ento::check::ASTDecl::_register
static void _register(CHECKER *checker, CheckerManager &mgr)
Definition: Checker.h:41
clang::ento::EventDispatcher::dispatchEvent
void dispatchEvent(const EVENT &event) const
Definition: Checker.h:547
clang::ento::check::Location
Definition: Checker.h:194
clang::ento::check::PostStmt::_register
static void _register(CHECKER *checker, CheckerManager &mgr)
Definition: Checker.h:112
clang::ento::eval::Assume::_register
static void _register(CHECKER *checker, CheckerManager &mgr)
Definition: Checker.h:469
clang::ento::CheckerManager::CheckEventFunc
CheckerFn< void(const void *event)> CheckEventFunc
Definition: CheckerManager.h:592
clang::LocationContext
It wraps the AnalysisDeclContext to represent both the call stack with the help of StackFrameContext ...
Definition: AnalysisDeclContext.h:215
clang::ento::check::EndFunction::_register
static void _register(CHECKER *checker, CheckerManager &mgr)
Definition: Checker.h:264
SVals.h
clang::ento::check::RegionChanges::_register
static void _register(CHECKER *checker, CheckerManager &mgr)
Definition: Checker.h:349
clang::ento::check::RegionChanges
Definition: Checker.h:332
clang::ento::check::PreStmt
Definition: Checker.h:82
clang::ProgramPointTag
ProgramPoints can be "tagged" as representing points specific to a given analysis entity.
Definition: ProgramPoint.h:39
clang::ento::check::EndAnalysis::_register
static void _register(CHECKER *checker, CheckerManager &mgr)
Definition: Checker.h:235
clang::ento::check::PreObjCMessage
Definition: Checker.h:119
clang::ento::CheckerBase::getCheckerName
CheckerNameRef getCheckerName() const
Definition: Checker.cpp:25
clang::ento::RegionAndSymbolInvalidationTraits::TK_SuppressEscape
@ TK_SuppressEscape
Suppress pointer-escaping of a region.
Definition: MemRegion.h:1534
clang::ento::check::PostCall
Definition: Checker.h:179
clang::ento::CheckerManager::_registerForBranchCondition
void _registerForBranchCondition(CheckBranchConditionFunc checkfn)
Definition: CheckerManager.cpp:843
clang::ento::check::EndAnalysis
Definition: Checker.h:226
clang::ento::ExplodedNode
Definition: ExplodedGraph.h:65
clang::ento::check::PostCall::_register
static void _register(CHECKER *checker, CheckerManager &mgr)
Definition: Checker.h:188
clang::ento::CheckerManager::_registerForRegionChanges
void _registerForRegionChanges(CheckRegionChangesFunc checkfn)
Definition: CheckerManager.cpp:860
clang::ento::CheckerManager::_registerForObjCMessageNil
void _registerForObjCMessageNil(CheckObjCMessageFunc checkfn)
Definition: CheckerManager.cpp:808
clang::ento::check::Event
Definition: Checker.h:441
clang::ento::CheckerManager::_registerForBody
void _registerForBody(CheckDeclFunc checkfn)
Definition: CheckerManager.cpp:784
clang::ento::CheckerBase::getTagDescription
StringRef getTagDescription() const override
Definition: Checker.cpp:21
clang::ento::CheckerBase::printState
virtual void printState(raw_ostream &Out, ProgramStateRef State, const char *NL, const char *Sep) const
See CheckerManager::runCheckersForPrintState.
Definition: Checker.h:501
clang::ento::check::Bind
Definition: Checker.h:210
clang::ento::eval::Call
Definition: Checker.h:475
clang::ento::check::PostObjCMessage
Definition: Checker.h:149
clang::ento::check::ASTDecl
Definition: Checker.h:29
b
__device__ __2f16 b
Definition: __clang_hip_libdevice_declares.h:314
clang::ento::CheckerManager::_dispatchEvent
void _dispatchEvent(const EVENT &event) const
Definition: CheckerManager.h:607
clang::ento::DefaultBool::operator=
DefaultBool & operator=(bool b)
Definition: Checker.h:575
clang::ento::CheckerManager::_registerForBind
void _registerForBind(CheckBindFunc checkfn)
Definition: CheckerManager.cpp:827
clang::ento::check::EndOfTranslationUnit::_register
static void _register(CHECKER *checker, CheckerManager &mgr)
Definition: Checker.h:74
clang::ento::check::ObjCMessageNil
Definition: Checker.h:134
clang::ento::check::Event::_register
static void _register(CHECKER *checker, CheckerManager &mgr)
Definition: Checker.h:448
clang::ento::DefaultBool
A helper class which wraps a boolean value set to false by default.
Definition: Checker.h:570
clang::TranslationUnitDecl
The top declaration context.
Definition: Decl.h:82
ProgramPoint.h
clang::ento::check::PreCall
Definition: Checker.h:164
clang::ento::RegionAndSymbolInvalidationTraits::hasTrait
bool hasTrait(SymbolRef Sym, InvalidationKinds IK) const
Definition: MemRegion.cpp:1732
clang::ento::ImplicitNullDerefEvent::SinkNode
ExplodedNode * SinkNode
Definition: Checker.h:556
clang::ento::Checker::_register
static void _register(CHECKER *checker, CheckerManager &mgr)
Definition: Checker.h:520
clang::ento::EventDispatcher::EventDispatcher
EventDispatcher()
Definition: Checker.h:539
CheckerManager.h
clang::ento::eval::Call::_register
static void _register(CHECKER *checker, CheckerManager &mgr)
Definition: Checker.h:484
clang::ento::check::Location::_register
static void _register(CHECKER *checker, CheckerManager &mgr)
Definition: Checker.h:204
clang::ento::CheckerManager::_registerForPointerEscape
void _registerForPointerEscape(CheckPointerEscapeFunc checkfn)
Definition: CheckerManager.cpp:864
CHECKER
#define CHECKER(FULLNAME, CLASS, HELPTEXT, DOC_URI, IS_HIDDEN)
Definition: BuiltinCheckerRegistration.h:29
LangOptions.h
clang::ento::CheckerManager::_registerForEndOfTranslationUnit
void _registerForEndOfTranslationUnit(CheckEndOfTranslationUnit checkfn)
Definition: CheckerManager.cpp:881
clang::ento::ImplicitNullDerefEvent::IsDirectDereference
bool IsDirectDereference
Definition: Checker.h:561
clang::ento::EventDispatcher::_register
static void _register(CHECKER *checker, CheckerManager &mgr)
Definition: Checker.h:542
clang::ento::CheckerManager::_registerForEvalCall
void _registerForEvalCall(EvalCallFunc checkfn)
Definition: CheckerManager.cpp:877
clang::ento::check::LiveSymbols
Definition: Checker.h:302
clang::ento::check::PointerEscape
Definition: Checker.h:356
clang::ento::CheckerNameRef
This wrapper is used to ensure that only StringRefs originating from the CheckerRegistry are used as ...
Definition: CheckerManager.h:107
clang::ento::CheckerManager::_registerForLocation
void _registerForLocation(CheckLocationFunc checkfn)
Definition: CheckerManager.cpp:823
clang::ento::CXXAllocatorCall
Represents the memory allocation call in a C++ new-expression.
Definition: CallEvent.h:1000
clang::ento::CheckerManager::_registerForPreStmt
void _registerForPreStmt(CheckStmtFunc checkfn, HandlesStmtFunc isForStmtFn)
Definition: CheckerManager.cpp:792
clang::ento::SymbolReaper
A class responsible for cleaning up unused symbols.
Definition: SymbolManager.h:505
llvm::DenseSet< SymbolRef >
clang::ento::CheckerManager::_registerForNewAllocator
void _registerForNewAllocator(CheckNewAllocatorFunc checkfn)
Definition: CheckerManager.cpp:848
clang::ento::BugReporter
BugReporter is a utility class for generating PathDiagnostics for analysis.
Definition: BugReporter.h:587
clang::ento::DefaultBool::DefaultBool
DefaultBool()
Definition: Checker.h:572
clang::ento::ExplodedGraph
Definition: ExplodedGraph.h:304
clang::ento::CheckerManager::_registerForPreCall
void _registerForPreCall(CheckCallFunc checkfn)
Definition: CheckerManager.cpp:816
state
and static some checkers Checker The latter are built on top of the former via the Checker and CheckerVisitor and attempts to isolate them from much of the gore of the internal analysis the analyzer is basically a source code simulator that traces out possible paths of execution The state of the and the combination of state and program point is a node in an exploded which has the entry program point and initial state
Definition: README.txt:30
clang::ento::check::NewAllocator::_register
static void _register(CHECKER *checker, CheckerManager &mgr)
Definition: Checker.h:295
clang::ento::CheckerManager::_registerForPostStmt
void _registerForPostStmt(CheckStmtFunc checkfn, HandlesStmtFunc isForStmtFn)
Definition: CheckerManager.cpp:798
clang::ento::Checker< CHECK1 >::_register
static void _register(CHECKER *checker, CheckerManager &mgr)
Definition: Checker.h:530
clang::ento::check::ConstPointerEscape::_register
static void _register(CHECKER *checker, CheckerManager &mgr)
Definition: Checker.h:432
clang::ento::check::EndFunction
Definition: Checker.h:255
clang::ento::check::BranchCondition
Definition: Checker.h:270
clang::ento::check::LiveSymbols::_register
static void _register(CHECKER *checker, CheckerManager &mgr)
Definition: Checker.h:311
clang::ento::check::EndOfTranslationUnit
Definition: Checker.h:63
false
#define false
Definition: stdbool.h:17
clang::ento::check::PostStmt
Definition: Checker.h:101
clang::ento::ImplicitNullDerefEvent
We dereferenced a location that may be null.
Definition: Checker.h:553
clang::ento::CheckerManager::_registerForPostObjCMessage
void _registerForPostObjCMessage(CheckObjCMessageFunc checkfn)
Definition: CheckerManager.cpp:812
clang::ento::check::DeadSymbols
Definition: Checker.h:317
llvm::ArrayRef
Definition: LLVM.h:34
clang::Decl
Decl - This represents one declaration (or definition), e.g.
Definition: DeclBase.h:89
clang::SimpleProgramPointTag
Definition: ProgramPoint.h:52
clang::ento::CheckerBase
Definition: Checker.h:492
clang::ento::CheckerManager::_registerForDeadSymbols
void _registerForDeadSymbols(CheckDeadSymbolsFunc checkfn)
Definition: CheckerManager.cpp:856
clang::ento::ImplicitNullDerefEvent::Location
SVal Location
Definition: Checker.h:554
clang::ento::EventDispatcher
Definition: Checker.h:536
State
LineState State
Definition: UnwrappedLineFormatter.cpp:986
clang::ento::eval::Assume
Definition: Checker.h:458
clang::ento::ObjCMethodCall
Represents any expression that calls an Objective-C method.
Definition: CallEvent.h:1120
clang::ento::AnalysisManager
Definition: AnalysisManager.h:31
clang::ento::check::BeginFunction::_register
static void _register(CHECKER *checker, CheckerManager &mgr)
Definition: Checker.h:249
clang::ento::ImplicitNullDerefEvent::IsLoad
bool IsLoad
Definition: Checker.h:555
clang::ento::CheckerManager::_registerForEvalAssume
void _registerForEvalAssume(EvalAssumeFunc checkfn)
Definition: CheckerManager.cpp:873
clang::ento::check::BeginFunction
Definition: Checker.h:241
clang::ObjCPropertyAttribute::Kind
Kind
Definition: DeclObjCCommon.h:22
clang::ento::ExprEngine
Definition: ExprEngine.h:127
clang::ento::ImplicitNullDerefEvent::Tag
static int Tag
Definition: Checker.h:563
clang::ento::CheckerManager::_registerForEndFunction
void _registerForEndFunction(CheckEndFunctionFunc checkfn)
Definition: CheckerManager.cpp:839
clang::ento::RegionAndSymbolInvalidationTraits::TK_PreserveContents
@ TK_PreserveContents
Tells that a region's contents is not changed.
Definition: MemRegion.h:1531
clang::ento::operator<<
raw_ostream & operator<<(raw_ostream &Out, const CheckerBase &Checker)
Dump checker name to stream.
Definition: Checker.cpp:35
clang::ento::CheckerManager
Definition: CheckerManager.h:127
clang
Definition: CalledOnceCheck.h:17
clang::ento::CheckerProgramPointTag
Tag that can use a checker name as a message provider (see SimpleProgramPointTag).
Definition: Checker.h:510
clang::ento::CheckerManager::_registerForBeginFunction
void _registerForBeginFunction(CheckBeginFunctionFunc checkfn)
Definition: CheckerManager.cpp:835
clang::Stmt
Stmt - This represents one statement.
Definition: Stmt.h:69
clang::ento::check::Bind::_register
static void _register(CHECKER *checker, CheckerManager &mgr)
Definition: Checker.h:220
clang::DeclaratorContext::Condition
@ Condition
clang::ento::CallEvent
Represents an abstract call to a function or method along a particular path.
Definition: CallEvent.h:143
clang::ento::check::PostObjCMessage::_register
static void _register(CHECKER *checker, CheckerManager &mgr)
Definition: Checker.h:158
clang::ento::CheckerManager::_registerDispatcherForEvent
void _registerDispatcherForEvent()
Definition: CheckerManager.h:601
clang::ento::DefaultBool::val
bool val
Definition: Checker.h:571
clang::ento::PointerEscapeKind
PointerEscapeKind
Describes the different reasons a pointer escapes during analysis.
Definition: CheckerManager.h:79
clang::ento::CheckerManager::_registerForPostCall
void _registerForPostCall(CheckCallFunc checkfn)
Definition: CheckerManager.cpp:819
clang::ento::CheckerContext
Definition: CheckerContext.h:23
clang::ento::Checker
Definition: Checker.h:517
clang::ento::SVal
SVal - This represents a symbolic expression, which can be either an L-value or an R-value.
Definition: SVals.h:75
clang::ento::check::PreStmt::_register
static void _register(CHECKER *checker, CheckerManager &mgr)
Definition: Checker.h:93
clang::ento::check::PointerEscape::_register
static void _register(CHECKER *checker, CheckerManager &mgr)
Definition: Checker.h:392
clang::ento::check::NewAllocator
Definition: Checker.h:286
clang::ento::check::DeadSymbols::_register
static void _register(CHECKER *checker, CheckerManager &mgr)
Definition: Checker.h:326
clang::ento::RegionAndSymbolInvalidationTraits
Information about invalidation for a particular region/symbol.
Definition: MemRegion.h:1516
clang::ento::check::BranchCondition::_register
static void _register(CHECKER *checker, CheckerManager &mgr)
Definition: Checker.h:279
clang::ento::check::ObjCMessageNil::_register
static void _register(CHECKER *checker, CheckerManager &mgr)
Definition: Checker.h:143
clang::ento::CheckerManager::_registerListenerForEvent
void _registerListenerForEvent(CheckEventFunc checkfn)
Definition: CheckerManager.h:595
clang::ento::check::PreCall::_register
static void _register(CHECKER *checker, CheckerManager &mgr)
Definition: Checker.h:173
clang::ento::check::PreObjCMessage::_register
static void _register(CHECKER *checker, CheckerManager &mgr)
Definition: Checker.h:128
clang::ento::CheckerManager::_registerForLiveSymbols
void _registerForLiveSymbols(CheckLiveSymbolsFunc checkfn)
Definition: CheckerManager.cpp:852
clang::ento::check::ASTCodeBody
Definition: Checker.h:48
clang::ento::CheckerManager::_registerForEndAnalysis
void _registerForEndAnalysis(CheckEndAnalysisFunc checkfn)
Definition: CheckerManager.cpp:831
clang::ento::ImplicitNullDerefEvent::BR
BugReporter * BR
Definition: Checker.h:557
CHECK1
llvm::IntrusiveRefCntPtr< const ProgramState >
clang::ento::check::ConstPointerEscape
Definition: Checker.h:399
clang::ReturnStmt
ReturnStmt - This represents a return, optionally of an expression: return; return 4;.
Definition: Stmt.h:2760
clang::ento::CheckerManager::_registerForDecl
void _registerForDecl(CheckDeclFunc checkfn, HandlesDeclFunc isForDeclFn)
Definition: CheckerManager.cpp:778
clang::ento::CheckerManager::_registerForPreObjCMessage
void _registerForPreObjCMessage(CheckObjCMessageFunc checkfn)
Definition: CheckerManager.cpp:804
clang::ento::CheckerFn< void(const Decl *, AnalysisManager &, BugReporter &)>