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