clang  7.0.0svn
CheckerManager.h
Go to the documentation of this file.
1 //===- CheckerManager.h - Static Analyzer Checker Manager -------*- C++ -*-===//
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 // Defines the Static Analyzer Checker Manager.
11 //
12 //===----------------------------------------------------------------------===//
13 
14 #ifndef LLVM_CLANG_STATICANALYZER_CORE_CHECKERMANAGER_H
15 #define LLVM_CLANG_STATICANALYZER_CORE_CHECKERMANAGER_H
16 
21 #include "llvm/ADT/ArrayRef.h"
22 #include "llvm/ADT/DenseMap.h"
23 #include "llvm/ADT/SmallVector.h"
24 #include "llvm/ADT/StringRef.h"
25 #include <vector>
26 
27 namespace clang {
28 
29 class AnalyzerOptions;
30 class CallExpr;
31 class CXXNewExpr;
32 class Decl;
33 class LocationContext;
34 class Stmt;
35 class TranslationUnitDecl;
36 
37 namespace ento {
38 
39 class AnalysisManager;
40 class BugReporter;
41 class CallEvent;
42 class CheckerBase;
43 class CheckerContext;
44 class CheckerRegistry;
45 class ExplodedGraph;
46 class ExplodedNode;
47 class ExplodedNodeSet;
48 class ExprEngine;
49 class MemRegion;
50 struct NodeBuilderContext;
51 class ObjCMethodCall;
52 class RegionAndSymbolInvalidationTraits;
53 class SVal;
54 class SymbolReaper;
55 
56 template <typename T> class CheckerFn;
57 
58 template <typename RET, typename... Ps>
59 class CheckerFn<RET(Ps...)> {
60  using Func = RET (*)(void *, Ps...);
61 
62  Func Fn;
63 
64 public:
66 
67  CheckerFn(CheckerBase *checker, Func fn) : Fn(fn), Checker(checker) {}
68 
69  RET operator()(Ps... ps) const {
70  return Fn(Checker, ps...);
71  }
72 };
73 
74 /// Describes the different reasons a pointer escapes
75 /// during analysis.
77  /// A pointer escapes due to binding its value to a location
78  /// that the analyzer cannot track.
80 
81  /// The pointer has been passed to a function call directly.
83 
84  /// The pointer has been passed to a function indirectly.
85  /// For example, the pointer is accessible through an
86  /// argument to a function.
88 
89  /// The reason for pointer escape is unknown. For example,
90  /// a region containing this pointer is invalidated.
92 };
93 
94 // This wrapper is used to ensure that only StringRefs originating from the
95 // CheckerRegistry are used as check names. We want to make sure all check
96 // name strings have a lifetime that keeps them alive at least until the path
97 // diagnostics have been processed.
98 class CheckName {
99  friend class ::clang::ento::CheckerRegistry;
100 
101  StringRef Name;
102 
103  explicit CheckName(StringRef Name) : Name(Name) {}
104 
105 public:
106  CheckName() = default;
107 
108  StringRef getName() const { return Name; }
109 };
110 
112  Pre,
113  Post,
114  MessageNil
115 };
116 
118  const LangOptions LangOpts;
119  AnalyzerOptions &AOptions;
120  CheckName CurrentCheckName;
121 
122 public:
123  CheckerManager(const LangOptions &langOpts, AnalyzerOptions &AOptions)
124  : LangOpts(langOpts), AOptions(AOptions) {}
125 
126  ~CheckerManager();
127 
128  void setCurrentCheckName(CheckName name) { CurrentCheckName = name; }
129  CheckName getCurrentCheckName() const { return CurrentCheckName; }
130 
131  bool hasPathSensitiveCheckers() const;
132 
133  void finishedCheckerRegistration();
134 
135  const LangOptions &getLangOpts() const { return LangOpts; }
136  AnalyzerOptions &getAnalyzerOptions() { return AOptions; }
137 
139  using CheckerTag = const void *;
141 
142 //===----------------------------------------------------------------------===//
143 // registerChecker
144 //===----------------------------------------------------------------------===//
145 
146  /// Used to register checkers.
147  ///
148  /// \returns a pointer to the checker object.
149  template <typename CHECKER>
151  CheckerTag tag = getTag<CHECKER>();
152  CheckerRef &ref = CheckerTags[tag];
153  if (ref)
154  return static_cast<CHECKER *>(ref); // already registered.
155 
156  CHECKER *checker = new CHECKER();
157  checker->Name = CurrentCheckName;
158  CheckerDtors.push_back(CheckerDtor(checker, destruct<CHECKER>));
159  CHECKER::_register(checker, *this);
160  ref = checker;
161  return checker;
162  }
163 
164  template <typename CHECKER>
166  CheckerTag tag = getTag<CHECKER>();
167  CheckerRef &ref = CheckerTags[tag];
168  if (ref)
169  return static_cast<CHECKER *>(ref); // already registered.
170 
171  CHECKER *checker = new CHECKER(AOpts);
172  checker->Name = CurrentCheckName;
173  CheckerDtors.push_back(CheckerDtor(checker, destruct<CHECKER>));
174  CHECKER::_register(checker, *this);
175  ref = checker;
176  return checker;
177  }
178 
179 //===----------------------------------------------------------------------===//
180 // Functions for running checkers for AST traversing..
181 //===----------------------------------------------------------------------===//
182 
183  /// Run checkers handling Decls.
184  void runCheckersOnASTDecl(const Decl *D, AnalysisManager& mgr,
185  BugReporter &BR);
186 
187  /// Run checkers handling Decls containing a Stmt body.
188  void runCheckersOnASTBody(const Decl *D, AnalysisManager& mgr,
189  BugReporter &BR);
190 
191 //===----------------------------------------------------------------------===//
192 // Functions for running checkers for path-sensitive checking.
193 //===----------------------------------------------------------------------===//
194 
195  /// Run checkers for pre-visiting Stmts.
196  ///
197  /// The notification is performed for every explored CFGElement, which does
198  /// not include the control flow statements such as IfStmt.
199  ///
200  /// \sa runCheckersForBranchCondition, runCheckersForPostStmt
202  const ExplodedNodeSet &Src,
203  const Stmt *S,
204  ExprEngine &Eng) {
205  runCheckersForStmt(/*isPreVisit=*/true, Dst, Src, S, Eng);
206  }
207 
208  /// Run checkers for post-visiting Stmts.
209  ///
210  /// The notification is performed for every explored CFGElement, which does
211  /// not include the control flow statements such as IfStmt.
212  ///
213  /// \sa runCheckersForBranchCondition, runCheckersForPreStmt
215  const ExplodedNodeSet &Src,
216  const Stmt *S,
217  ExprEngine &Eng,
218  bool wasInlined = false) {
219  runCheckersForStmt(/*isPreVisit=*/false, Dst, Src, S, Eng, wasInlined);
220  }
221 
222  /// Run checkers for visiting Stmts.
223  void runCheckersForStmt(bool isPreVisit,
224  ExplodedNodeSet &Dst, const ExplodedNodeSet &Src,
225  const Stmt *S, ExprEngine &Eng,
226  bool wasInlined = false);
227 
228  /// Run checkers for pre-visiting obj-c messages.
230  const ExplodedNodeSet &Src,
231  const ObjCMethodCall &msg,
232  ExprEngine &Eng) {
233  runCheckersForObjCMessage(ObjCMessageVisitKind::Pre, Dst, Src, msg, Eng);
234  }
235 
236  /// Run checkers for post-visiting obj-c messages.
238  const ExplodedNodeSet &Src,
239  const ObjCMethodCall &msg,
240  ExprEngine &Eng,
241  bool wasInlined = false) {
242  runCheckersForObjCMessage(ObjCMessageVisitKind::Post, Dst, Src, msg, Eng,
243  wasInlined);
244  }
245 
246  /// Run checkers for visiting an obj-c message to nil.
248  const ExplodedNodeSet &Src,
249  const ObjCMethodCall &msg,
250  ExprEngine &Eng) {
251  runCheckersForObjCMessage(ObjCMessageVisitKind::MessageNil, Dst, Src, msg,
252  Eng);
253  }
254 
255  /// Run checkers for visiting obj-c messages.
256  void runCheckersForObjCMessage(ObjCMessageVisitKind visitKind,
257  ExplodedNodeSet &Dst,
258  const ExplodedNodeSet &Src,
259  const ObjCMethodCall &msg, ExprEngine &Eng,
260  bool wasInlined = false);
261 
262  /// Run checkers for pre-visiting obj-c messages.
264  const CallEvent &Call, ExprEngine &Eng) {
265  runCheckersForCallEvent(/*isPreVisit=*/true, Dst, Src, Call, Eng);
266  }
267 
268  /// Run checkers for post-visiting obj-c messages.
270  const CallEvent &Call, ExprEngine &Eng,
271  bool wasInlined = false) {
272  runCheckersForCallEvent(/*isPreVisit=*/false, Dst, Src, Call, Eng,
273  wasInlined);
274  }
275 
276  /// Run checkers for visiting obj-c messages.
277  void runCheckersForCallEvent(bool isPreVisit, ExplodedNodeSet &Dst,
278  const ExplodedNodeSet &Src,
279  const CallEvent &Call, ExprEngine &Eng,
280  bool wasInlined = false);
281 
282  /// Run checkers for load/store of a location.
283  void runCheckersForLocation(ExplodedNodeSet &Dst,
284  const ExplodedNodeSet &Src,
285  SVal location,
286  bool isLoad,
287  const Stmt *NodeEx,
288  const Stmt *BoundEx,
289  ExprEngine &Eng);
290 
291  /// Run checkers for binding of a value to a location.
292  void runCheckersForBind(ExplodedNodeSet &Dst,
293  const ExplodedNodeSet &Src,
294  SVal location, SVal val,
295  const Stmt *S, ExprEngine &Eng,
296  const ProgramPoint &PP);
297 
298  /// Run checkers for end of analysis.
299  void runCheckersForEndAnalysis(ExplodedGraph &G, BugReporter &BR,
300  ExprEngine &Eng);
301 
302  /// Run checkers on beginning of function.
303  void runCheckersForBeginFunction(ExplodedNodeSet &Dst,
304  const BlockEdge &L,
305  ExplodedNode *Pred,
306  ExprEngine &Eng);
307 
308  /// Run checkers on end of function.
309  void runCheckersForEndFunction(NodeBuilderContext &BC,
310  ExplodedNodeSet &Dst,
311  ExplodedNode *Pred,
312  ExprEngine &Eng);
313 
314  /// Run checkers for branch condition.
315  void runCheckersForBranchCondition(const Stmt *condition,
316  ExplodedNodeSet &Dst, ExplodedNode *Pred,
317  ExprEngine &Eng);
318 
319  /// Run checkers between C++ operator new and constructor calls.
320  void runCheckersForNewAllocator(const CXXNewExpr *NE, SVal Target,
321  ExplodedNodeSet &Dst,
322  ExplodedNode *Pred,
323  ExprEngine &Eng,
324  bool wasInlined = false);
325 
326  /// Run checkers for live symbols.
327  ///
328  /// Allows modifying SymbolReaper object. For example, checkers can explicitly
329  /// register symbols of interest as live. These symbols will not be marked
330  /// dead and removed.
331  void runCheckersForLiveSymbols(ProgramStateRef state,
332  SymbolReaper &SymReaper);
333 
334  /// Run checkers for dead symbols.
335  ///
336  /// Notifies checkers when symbols become dead. For example, this allows
337  /// checkers to aggressively clean up/reduce the checker state and produce
338  /// precise diagnostics.
339  void runCheckersForDeadSymbols(ExplodedNodeSet &Dst,
340  const ExplodedNodeSet &Src,
341  SymbolReaper &SymReaper, const Stmt *S,
342  ExprEngine &Eng,
344 
345  /// Run checkers for region changes.
346  ///
347  /// This corresponds to the check::RegionChanges callback.
348  /// \param state The current program state.
349  /// \param invalidated A set of all symbols potentially touched by the change.
350  /// \param ExplicitRegions The regions explicitly requested for invalidation.
351  /// For example, in the case of a function call, these would be arguments.
352  /// \param Regions The transitive closure of accessible regions,
353  /// i.e. all regions that may have been touched by this change.
354  /// \param Call The call expression wrapper if the regions are invalidated
355  /// by a call.
357  runCheckersForRegionChanges(ProgramStateRef state,
358  const InvalidatedSymbols *invalidated,
359  ArrayRef<const MemRegion *> ExplicitRegions,
361  const LocationContext *LCtx,
362  const CallEvent *Call);
363 
364  /// Run checkers when pointers escape.
365  ///
366  /// This notifies the checkers about pointer escape, which occurs whenever
367  /// the analyzer cannot track the symbol any more. For example, as a
368  /// result of assigning a pointer into a global or when it's passed to a
369  /// function call the analyzer cannot model.
370  ///
371  /// \param State The state at the point of escape.
372  /// \param Escaped The list of escaped symbols.
373  /// \param Call The corresponding CallEvent, if the symbols escape as
374  /// parameters to the given call.
375  /// \param Kind The reason of pointer escape.
376  /// \param ITraits Information about invalidation for a particular
377  /// region/symbol.
378  /// \returns Checkers can modify the state by returning a new one.
380  runCheckersForPointerEscape(ProgramStateRef State,
381  const InvalidatedSymbols &Escaped,
382  const CallEvent *Call,
385 
386  /// Run checkers for handling assumptions on symbolic values.
387  ProgramStateRef runCheckersForEvalAssume(ProgramStateRef state,
388  SVal Cond, bool Assumption);
389 
390  /// Run checkers for evaluating a call.
391  ///
392  /// Warning: Currently, the CallEvent MUST come from a CallExpr!
393  void runCheckersForEvalCall(ExplodedNodeSet &Dst,
394  const ExplodedNodeSet &Src,
395  const CallEvent &CE, ExprEngine &Eng);
396 
397  /// Run checkers for the entire Translation Unit.
398  void runCheckersOnEndOfTranslationUnit(const TranslationUnitDecl *TU,
399  AnalysisManager &mgr,
400  BugReporter &BR);
401 
402  /// Run checkers for debug-printing a ProgramState.
403  ///
404  /// Unlike most other callbacks, any checker can simply implement the virtual
405  /// method CheckerBase::printState if it has custom data to print.
406  /// \param Out The output stream
407  /// \param State The state being printed
408  /// \param NL The preferred representation of a newline.
409  /// \param Sep The preferred separator between different kinds of data.
410  void runCheckersForPrintState(raw_ostream &Out, ProgramStateRef State,
411  const char *NL, const char *Sep);
412 
413 //===----------------------------------------------------------------------===//
414 // Internal registration functions for AST traversing.
415 //===----------------------------------------------------------------------===//
416 
417  // Functions used by the registration mechanism, checkers should not touch
418  // these directly.
419 
420  using CheckDeclFunc =
422 
423  using HandlesDeclFunc = bool (*)(const Decl *D);
424 
425  void _registerForDecl(CheckDeclFunc checkfn, HandlesDeclFunc isForDeclFn);
426 
427  void _registerForBody(CheckDeclFunc checkfn);
428 
429 //===----------------------------------------------------------------------===//
430 // Internal registration functions for path-sensitive checking.
431 //===----------------------------------------------------------------------===//
432 
434 
435  using CheckObjCMessageFunc =
437 
438  using CheckCallFunc =
440 
441  using CheckLocationFunc =
442  CheckerFn<void (const SVal &location, bool isLoad, const Stmt *S,
444 
445  using CheckBindFunc =
446  CheckerFn<void (const SVal &location, const SVal &val, const Stmt *S,
448 
449  using CheckEndAnalysisFunc =
451 
453 
455 
458 
459  using CheckNewAllocatorFunc =
461 
462  using CheckDeadSymbolsFunc =
464 
466 
467  using CheckRegionChangesFunc =
469  const InvalidatedSymbols *symbols,
470  ArrayRef<const MemRegion *> ExplicitRegions,
472  const LocationContext *LCtx,
473  const CallEvent *Call)>;
474 
475  using CheckPointerEscapeFunc =
477  const InvalidatedSymbols &Escaped,
478  const CallEvent *Call, PointerEscapeKind Kind,
480 
481  using EvalAssumeFunc =
483  bool assumption)>;
484 
486 
490 
491  using HandlesStmtFunc = bool (*)(const Stmt *D);
492 
493  void _registerForPreStmt(CheckStmtFunc checkfn,
494  HandlesStmtFunc isForStmtFn);
495  void _registerForPostStmt(CheckStmtFunc checkfn,
496  HandlesStmtFunc isForStmtFn);
497 
498  void _registerForPreObjCMessage(CheckObjCMessageFunc checkfn);
499  void _registerForPostObjCMessage(CheckObjCMessageFunc checkfn);
500 
501  void _registerForObjCMessageNil(CheckObjCMessageFunc checkfn);
502 
503  void _registerForPreCall(CheckCallFunc checkfn);
504  void _registerForPostCall(CheckCallFunc checkfn);
505 
506  void _registerForLocation(CheckLocationFunc checkfn);
507 
508  void _registerForBind(CheckBindFunc checkfn);
509 
510  void _registerForEndAnalysis(CheckEndAnalysisFunc checkfn);
511 
512  void _registerForBeginFunction(CheckEndFunctionFunc checkfn);
513  void _registerForEndFunction(CheckEndFunctionFunc checkfn);
514 
515  void _registerForBranchCondition(CheckBranchConditionFunc checkfn);
516 
517  void _registerForNewAllocator(CheckNewAllocatorFunc checkfn);
518 
519  void _registerForLiveSymbols(CheckLiveSymbolsFunc checkfn);
520 
521  void _registerForDeadSymbols(CheckDeadSymbolsFunc checkfn);
522 
523  void _registerForRegionChanges(CheckRegionChangesFunc checkfn);
524 
525  void _registerForPointerEscape(CheckPointerEscapeFunc checkfn);
526 
527  void _registerForConstPointerEscape(CheckPointerEscapeFunc checkfn);
528 
529  void _registerForEvalAssume(EvalAssumeFunc checkfn);
530 
531  void _registerForEvalCall(EvalCallFunc checkfn);
532 
533  void _registerForEndOfTranslationUnit(CheckEndOfTranslationUnit checkfn);
534 
535 //===----------------------------------------------------------------------===//
536 // Internal registration functions for events.
537 //===----------------------------------------------------------------------===//
538 
539  using EventTag = void *;
541 
542  template <typename EVENT>
544  EventInfo &info = Events[getTag<EVENT>()];
545  info.Checkers.push_back(checkfn);
546  }
547 
548  template <typename EVENT>
550  EventInfo &info = Events[getTag<EVENT>()];
551  info.HasDispatcher = true;
552  }
553 
554  template <typename EVENT>
555  void _dispatchEvent(const EVENT &event) const {
556  EventsTy::const_iterator I = Events.find(getTag<EVENT>());
557  if (I == Events.end())
558  return;
559  const EventInfo &info = I->second;
560  for (const auto Checker : info.Checkers)
561  Checker(&event);
562  }
563 
564 //===----------------------------------------------------------------------===//
565 // Implementation details.
566 //===----------------------------------------------------------------------===//
567 
568 private:
569  template <typename CHECKER>
570  static void destruct(void *obj) { delete static_cast<CHECKER *>(obj); }
571 
572  template <typename T>
573  static void *getTag() { static int tag; return &tag; }
574 
575  llvm::DenseMap<CheckerTag, CheckerRef> CheckerTags;
576 
577  std::vector<CheckerDtor> CheckerDtors;
578 
579  struct DeclCheckerInfo {
580  CheckDeclFunc CheckFn;
581  HandlesDeclFunc IsForDeclFn;
582  };
583  std::vector<DeclCheckerInfo> DeclCheckers;
584 
585  std::vector<CheckDeclFunc> BodyCheckers;
586 
588  using CachedDeclCheckersMapTy = llvm::DenseMap<unsigned, CachedDeclCheckers>;
589  CachedDeclCheckersMapTy CachedDeclCheckersMap;
590 
591  struct StmtCheckerInfo {
592  CheckStmtFunc CheckFn;
593  HandlesStmtFunc IsForStmtFn;
594  bool IsPreVisit;
595  };
596  std::vector<StmtCheckerInfo> StmtCheckers;
597 
599  using CachedStmtCheckersMapTy = llvm::DenseMap<unsigned, CachedStmtCheckers>;
600  CachedStmtCheckersMapTy CachedStmtCheckersMap;
601 
602  const CachedStmtCheckers &getCachedStmtCheckersFor(const Stmt *S,
603  bool isPreVisit);
604 
605  /// Returns the checkers that have registered for callbacks of the
606  /// given \p Kind.
607  const std::vector<CheckObjCMessageFunc> &
608  getObjCMessageCheckers(ObjCMessageVisitKind Kind);
609 
610  std::vector<CheckObjCMessageFunc> PreObjCMessageCheckers;
611  std::vector<CheckObjCMessageFunc> PostObjCMessageCheckers;
612  std::vector<CheckObjCMessageFunc> ObjCMessageNilCheckers;
613 
614  std::vector<CheckCallFunc> PreCallCheckers;
615  std::vector<CheckCallFunc> PostCallCheckers;
616 
617  std::vector<CheckLocationFunc> LocationCheckers;
618 
619  std::vector<CheckBindFunc> BindCheckers;
620 
621  std::vector<CheckEndAnalysisFunc> EndAnalysisCheckers;
622 
623  std::vector<CheckBeginFunctionFunc> BeginFunctionCheckers;
624  std::vector<CheckEndFunctionFunc> EndFunctionCheckers;
625 
626  std::vector<CheckBranchConditionFunc> BranchConditionCheckers;
627 
628  std::vector<CheckNewAllocatorFunc> NewAllocatorCheckers;
629 
630  std::vector<CheckLiveSymbolsFunc> LiveSymbolsCheckers;
631 
632  std::vector<CheckDeadSymbolsFunc> DeadSymbolsCheckers;
633 
634  std::vector<CheckRegionChangesFunc> RegionChangesCheckers;
635 
636  std::vector<CheckPointerEscapeFunc> PointerEscapeCheckers;
637 
638  std::vector<EvalAssumeFunc> EvalAssumeCheckers;
639 
640  std::vector<EvalCallFunc> EvalCallCheckers;
641 
642  std::vector<CheckEndOfTranslationUnit> EndOfTranslationUnitCheckers;
643 
644  struct EventInfo {
646  bool HasDispatcher = false;
647 
648  EventInfo() = default;
649  };
650 
651  using EventsTy = llvm::DenseMap<EventTag, EventInfo>;
652  EventsTy Events;
653 };
654 
655 } // namespace ento
656 
657 } // namespace clang
658 
659 #endif // LLVM_CLANG_STATICANALYZER_CORE_CHECKERMANAGER_H
void _dispatchEvent(const EVENT &event) const
Stmt - This represents one statement.
Definition: Stmt.h:66
Information about invalidation for a particular region/symbol.
Definition: MemRegion.h:1384
Decl - This represents one declaration (or definition), e.g.
Definition: DeclBase.h:86
IntrusiveRefCntPtr< const ProgramState > ProgramStateRef
The pointer has been passed to a function indirectly.
The l-value was an access to a declared entity or something equivalently strong, like the address of ...
void runCheckersForObjCMessageNil(ExplodedNodeSet &Dst, const ExplodedNodeSet &Src, const ObjCMethodCall &msg, ExprEngine &Eng)
Run checkers for visiting an obj-c message to nil.
A pointer escapes due to binding its value to a location that the analyzer cannot track...
LineState State
Keeps track of the various options that can be enabled, which controls the dialect of C or C++ that i...
Definition: LangOptions.h:50
void runCheckersForPostObjCMessage(ExplodedNodeSet &Dst, const ExplodedNodeSet &Src, const ObjCMethodCall &msg, ExprEngine &Eng, bool wasInlined=false)
Run checkers for post-visiting obj-c messages.
i32 captured_struct **param SharedsTy A type which contains references the shared variables *param Shareds Context with the list of shared variables from the p *TaskFunction *param Data Additional data for task generation like final * state
#define CHECKER(FULLNAME, CLASS, DESCFILE, HELPTEXT, GROUPINDEX, HIDDEN)
Represents any expression that calls an Objective-C method.
Definition: CallEvent.h:892
bool(*)(const Stmt *D) HandlesStmtFunc
void runCheckersForPreCall(ExplodedNodeSet &Dst, const ExplodedNodeSet &Src, const CallEvent &Call, ExprEngine &Eng)
Run checkers for pre-visiting obj-c messages.
void setCurrentCheckName(CheckName name)
void runCheckersForPostCall(ExplodedNodeSet &Dst, const ExplodedNodeSet &Src, const CallEvent &Call, ExprEngine &Eng, bool wasInlined=false)
Run checkers for post-visiting obj-c messages.
CheckName getCurrentCheckName() const
CheckerFn(CheckerBase *checker, Func fn)
StringRef getName() const
void runCheckersForPostStmt(ExplodedNodeSet &Dst, const ExplodedNodeSet &Src, const Stmt *S, ExprEngine &Eng, bool wasInlined=false)
Run checkers for post-visiting Stmts.
Defines the clang::LangOptions interface.
void runCheckersForPreObjCMessage(ExplodedNodeSet &Dst, const ExplodedNodeSet &Src, const ObjCMethodCall &msg, ExprEngine &Eng)
Run checkers for pre-visiting obj-c messages.
The pointer has been passed to a function call directly.
#define bool
Definition: stdbool.h:31
The reason for pointer escape is unknown.
BugReporter is a utility class for generating PathDiagnostics for analysis.
Definition: BugReporter.h:409
Kind
CHECKER * registerChecker()
Used to register checkers.
void _registerListenerForEvent(CheckEventFunc checkfn)
Represents a new-expression for memory allocation and constructor calls, e.g: "new CXXNewExpr(foo)"...
Definition: ExprCXX.h:1845
SVal - This represents a symbolic expression, which can be either an L-value or an R-value...
Definition: SVals.h:76
CheckerManager(const LangOptions &langOpts, AnalyzerOptions &AOptions)
A class responsible for cleaning up unused symbols.
void runCheckersForPreStmt(ExplodedNodeSet &Dst, const ExplodedNodeSet &Src, const Stmt *S, ExprEngine &Eng)
Run checkers for pre-visiting Stmts.
Dataflow Directional Tag Classes.
Represents an abstract call to a function or method along a particular path.
Definition: CallEvent.h:164
AnalyzerOptions & getAnalyzerOptions()
PointerEscapeKind
Describes the different reasons a pointer escapes during analysis.
CHECKER * registerChecker(AnalyzerOptions &AOpts)
bool(*)(const Decl *D) HandlesDeclFunc
The top declaration context.
Definition: Decl.h:107
const LangOptions & getLangOpts() const