clang  7.0.0
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  /// All arguments are automatically passed through to the checker
148  /// constructor.
149  ///
150  /// \returns a pointer to the checker object.
151  template <typename CHECKER, typename... AT>
152  CHECKER *registerChecker(AT... Args) {
153  CheckerTag tag = getTag<CHECKER>();
154  CheckerRef &ref = CheckerTags[tag];
155  if (ref)
156  return static_cast<CHECKER *>(ref); // already registered.
157 
158  CHECKER *checker = new CHECKER(Args...);
159  checker->Name = CurrentCheckName;
160  CheckerDtors.push_back(CheckerDtor(checker, destruct<CHECKER>));
161  CHECKER::_register(checker, *this);
162  ref = checker;
163  return checker;
164  }
165 
166 //===----------------------------------------------------------------------===//
167 // Functions for running checkers for AST traversing..
168 //===----------------------------------------------------------------------===//
169 
170  /// Run checkers handling Decls.
171  void runCheckersOnASTDecl(const Decl *D, AnalysisManager& mgr,
172  BugReporter &BR);
173 
174  /// Run checkers handling Decls containing a Stmt body.
175  void runCheckersOnASTBody(const Decl *D, AnalysisManager& mgr,
176  BugReporter &BR);
177 
178 //===----------------------------------------------------------------------===//
179 // Functions for running checkers for path-sensitive checking.
180 //===----------------------------------------------------------------------===//
181 
182  /// Run checkers for pre-visiting Stmts.
183  ///
184  /// The notification is performed for every explored CFGElement, which does
185  /// not include the control flow statements such as IfStmt.
186  ///
187  /// \sa runCheckersForBranchCondition, runCheckersForPostStmt
189  const ExplodedNodeSet &Src,
190  const Stmt *S,
191  ExprEngine &Eng) {
192  runCheckersForStmt(/*isPreVisit=*/true, Dst, Src, S, Eng);
193  }
194 
195  /// Run checkers for post-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, runCheckersForPreStmt
202  const ExplodedNodeSet &Src,
203  const Stmt *S,
204  ExprEngine &Eng,
205  bool wasInlined = false) {
206  runCheckersForStmt(/*isPreVisit=*/false, Dst, Src, S, Eng, wasInlined);
207  }
208 
209  /// Run checkers for visiting Stmts.
210  void runCheckersForStmt(bool isPreVisit,
211  ExplodedNodeSet &Dst, const ExplodedNodeSet &Src,
212  const Stmt *S, ExprEngine &Eng,
213  bool wasInlined = false);
214 
215  /// Run checkers for pre-visiting obj-c messages.
217  const ExplodedNodeSet &Src,
218  const ObjCMethodCall &msg,
219  ExprEngine &Eng) {
220  runCheckersForObjCMessage(ObjCMessageVisitKind::Pre, Dst, Src, msg, Eng);
221  }
222 
223  /// Run checkers for post-visiting obj-c messages.
225  const ExplodedNodeSet &Src,
226  const ObjCMethodCall &msg,
227  ExprEngine &Eng,
228  bool wasInlined = false) {
229  runCheckersForObjCMessage(ObjCMessageVisitKind::Post, Dst, Src, msg, Eng,
230  wasInlined);
231  }
232 
233  /// Run checkers for visiting an obj-c message to nil.
235  const ExplodedNodeSet &Src,
236  const ObjCMethodCall &msg,
237  ExprEngine &Eng) {
238  runCheckersForObjCMessage(ObjCMessageVisitKind::MessageNil, Dst, Src, msg,
239  Eng);
240  }
241 
242  /// Run checkers for visiting obj-c messages.
243  void runCheckersForObjCMessage(ObjCMessageVisitKind visitKind,
244  ExplodedNodeSet &Dst,
245  const ExplodedNodeSet &Src,
246  const ObjCMethodCall &msg, ExprEngine &Eng,
247  bool wasInlined = false);
248 
249  /// Run checkers for pre-visiting obj-c messages.
251  const CallEvent &Call, ExprEngine &Eng) {
252  runCheckersForCallEvent(/*isPreVisit=*/true, Dst, Src, Call, Eng);
253  }
254 
255  /// Run checkers for post-visiting obj-c messages.
257  const CallEvent &Call, ExprEngine &Eng,
258  bool wasInlined = false) {
259  runCheckersForCallEvent(/*isPreVisit=*/false, Dst, Src, Call, Eng,
260  wasInlined);
261  }
262 
263  /// Run checkers for visiting obj-c messages.
264  void runCheckersForCallEvent(bool isPreVisit, ExplodedNodeSet &Dst,
265  const ExplodedNodeSet &Src,
266  const CallEvent &Call, ExprEngine &Eng,
267  bool wasInlined = false);
268 
269  /// Run checkers for load/store of a location.
270  void runCheckersForLocation(ExplodedNodeSet &Dst,
271  const ExplodedNodeSet &Src,
272  SVal location,
273  bool isLoad,
274  const Stmt *NodeEx,
275  const Stmt *BoundEx,
276  ExprEngine &Eng);
277 
278  /// Run checkers for binding of a value to a location.
279  void runCheckersForBind(ExplodedNodeSet &Dst,
280  const ExplodedNodeSet &Src,
281  SVal location, SVal val,
282  const Stmt *S, ExprEngine &Eng,
283  const ProgramPoint &PP);
284 
285  /// Run checkers for end of analysis.
286  void runCheckersForEndAnalysis(ExplodedGraph &G, BugReporter &BR,
287  ExprEngine &Eng);
288 
289  /// Run checkers on beginning of function.
290  void runCheckersForBeginFunction(ExplodedNodeSet &Dst,
291  const BlockEdge &L,
292  ExplodedNode *Pred,
293  ExprEngine &Eng);
294 
295  /// Run checkers on end of function.
296  void runCheckersForEndFunction(NodeBuilderContext &BC,
297  ExplodedNodeSet &Dst,
298  ExplodedNode *Pred,
299  ExprEngine &Eng,
300  const ReturnStmt *RS);
301 
302  /// Run checkers for branch condition.
303  void runCheckersForBranchCondition(const Stmt *condition,
304  ExplodedNodeSet &Dst, ExplodedNode *Pred,
305  ExprEngine &Eng);
306 
307  /// Run checkers between C++ operator new and constructor calls.
308  void runCheckersForNewAllocator(const CXXNewExpr *NE, SVal Target,
309  ExplodedNodeSet &Dst,
310  ExplodedNode *Pred,
311  ExprEngine &Eng,
312  bool wasInlined = false);
313 
314  /// Run checkers for live symbols.
315  ///
316  /// Allows modifying SymbolReaper object. For example, checkers can explicitly
317  /// register symbols of interest as live. These symbols will not be marked
318  /// dead and removed.
319  void runCheckersForLiveSymbols(ProgramStateRef state,
320  SymbolReaper &SymReaper);
321 
322  /// Run checkers for dead symbols.
323  ///
324  /// Notifies checkers when symbols become dead. For example, this allows
325  /// checkers to aggressively clean up/reduce the checker state and produce
326  /// precise diagnostics.
327  void runCheckersForDeadSymbols(ExplodedNodeSet &Dst,
328  const ExplodedNodeSet &Src,
329  SymbolReaper &SymReaper, const Stmt *S,
330  ExprEngine &Eng,
332 
333  /// Run checkers for region changes.
334  ///
335  /// This corresponds to the check::RegionChanges callback.
336  /// \param state The current program state.
337  /// \param invalidated A set of all symbols potentially touched by the change.
338  /// \param ExplicitRegions The regions explicitly requested for invalidation.
339  /// For example, in the case of a function call, these would be arguments.
340  /// \param Regions The transitive closure of accessible regions,
341  /// i.e. all regions that may have been touched by this change.
342  /// \param Call The call expression wrapper if the regions are invalidated
343  /// by a call.
345  runCheckersForRegionChanges(ProgramStateRef state,
346  const InvalidatedSymbols *invalidated,
347  ArrayRef<const MemRegion *> ExplicitRegions,
349  const LocationContext *LCtx,
350  const CallEvent *Call);
351 
352  /// Run checkers when pointers escape.
353  ///
354  /// This notifies the checkers about pointer escape, which occurs whenever
355  /// the analyzer cannot track the symbol any more. For example, as a
356  /// result of assigning a pointer into a global or when it's passed to a
357  /// function call the analyzer cannot model.
358  ///
359  /// \param State The state at the point of escape.
360  /// \param Escaped The list of escaped symbols.
361  /// \param Call The corresponding CallEvent, if the symbols escape as
362  /// parameters to the given call.
363  /// \param Kind The reason of pointer escape.
364  /// \param ITraits Information about invalidation for a particular
365  /// region/symbol.
366  /// \returns Checkers can modify the state by returning a new one.
368  runCheckersForPointerEscape(ProgramStateRef State,
369  const InvalidatedSymbols &Escaped,
370  const CallEvent *Call,
373 
374  /// Run checkers for handling assumptions on symbolic values.
375  ProgramStateRef runCheckersForEvalAssume(ProgramStateRef state,
376  SVal Cond, bool Assumption);
377 
378  /// Run checkers for evaluating a call.
379  ///
380  /// Warning: Currently, the CallEvent MUST come from a CallExpr!
381  void runCheckersForEvalCall(ExplodedNodeSet &Dst,
382  const ExplodedNodeSet &Src,
383  const CallEvent &CE, ExprEngine &Eng);
384 
385  /// Run checkers for the entire Translation Unit.
386  void runCheckersOnEndOfTranslationUnit(const TranslationUnitDecl *TU,
387  AnalysisManager &mgr,
388  BugReporter &BR);
389 
390  /// Run checkers for debug-printing a ProgramState.
391  ///
392  /// Unlike most other callbacks, any checker can simply implement the virtual
393  /// method CheckerBase::printState if it has custom data to print.
394  /// \param Out The output stream
395  /// \param State The state being printed
396  /// \param NL The preferred representation of a newline.
397  /// \param Sep The preferred separator between different kinds of data.
398  void runCheckersForPrintState(raw_ostream &Out, ProgramStateRef State,
399  const char *NL, const char *Sep);
400 
401 //===----------------------------------------------------------------------===//
402 // Internal registration functions for AST traversing.
403 //===----------------------------------------------------------------------===//
404 
405  // Functions used by the registration mechanism, checkers should not touch
406  // these directly.
407 
408  using CheckDeclFunc =
410 
411  using HandlesDeclFunc = bool (*)(const Decl *D);
412 
413  void _registerForDecl(CheckDeclFunc checkfn, HandlesDeclFunc isForDeclFn);
414 
415  void _registerForBody(CheckDeclFunc checkfn);
416 
417 //===----------------------------------------------------------------------===//
418 // Internal registration functions for path-sensitive checking.
419 //===----------------------------------------------------------------------===//
420 
422 
423  using CheckObjCMessageFunc =
425 
426  using CheckCallFunc =
428 
429  using CheckLocationFunc =
430  CheckerFn<void (const SVal &location, bool isLoad, const Stmt *S,
432 
433  using CheckBindFunc =
434  CheckerFn<void (const SVal &location, const SVal &val, const Stmt *S,
436 
437  using CheckEndAnalysisFunc =
439 
441 
442  using CheckEndFunctionFunc =
444 
447 
448  using CheckNewAllocatorFunc =
450 
451  using CheckDeadSymbolsFunc =
453 
455 
456  using CheckRegionChangesFunc =
458  const InvalidatedSymbols *symbols,
459  ArrayRef<const MemRegion *> ExplicitRegions,
461  const LocationContext *LCtx,
462  const CallEvent *Call)>;
463 
464  using CheckPointerEscapeFunc =
466  const InvalidatedSymbols &Escaped,
467  const CallEvent *Call, PointerEscapeKind Kind,
469 
470  using EvalAssumeFunc =
472  bool assumption)>;
473 
475 
479 
480  using HandlesStmtFunc = bool (*)(const Stmt *D);
481 
482  void _registerForPreStmt(CheckStmtFunc checkfn,
483  HandlesStmtFunc isForStmtFn);
484  void _registerForPostStmt(CheckStmtFunc checkfn,
485  HandlesStmtFunc isForStmtFn);
486 
487  void _registerForPreObjCMessage(CheckObjCMessageFunc checkfn);
488  void _registerForPostObjCMessage(CheckObjCMessageFunc checkfn);
489 
490  void _registerForObjCMessageNil(CheckObjCMessageFunc checkfn);
491 
492  void _registerForPreCall(CheckCallFunc checkfn);
493  void _registerForPostCall(CheckCallFunc checkfn);
494 
495  void _registerForLocation(CheckLocationFunc checkfn);
496 
497  void _registerForBind(CheckBindFunc checkfn);
498 
499  void _registerForEndAnalysis(CheckEndAnalysisFunc checkfn);
500 
501  void _registerForBeginFunction(CheckBeginFunctionFunc checkfn);
502  void _registerForEndFunction(CheckEndFunctionFunc checkfn);
503 
504  void _registerForBranchCondition(CheckBranchConditionFunc checkfn);
505 
506  void _registerForNewAllocator(CheckNewAllocatorFunc checkfn);
507 
508  void _registerForLiveSymbols(CheckLiveSymbolsFunc checkfn);
509 
510  void _registerForDeadSymbols(CheckDeadSymbolsFunc checkfn);
511 
512  void _registerForRegionChanges(CheckRegionChangesFunc checkfn);
513 
514  void _registerForPointerEscape(CheckPointerEscapeFunc checkfn);
515 
516  void _registerForConstPointerEscape(CheckPointerEscapeFunc checkfn);
517 
518  void _registerForEvalAssume(EvalAssumeFunc checkfn);
519 
520  void _registerForEvalCall(EvalCallFunc checkfn);
521 
522  void _registerForEndOfTranslationUnit(CheckEndOfTranslationUnit checkfn);
523 
524 //===----------------------------------------------------------------------===//
525 // Internal registration functions for events.
526 //===----------------------------------------------------------------------===//
527 
528  using EventTag = void *;
530 
531  template <typename EVENT>
533  EventInfo &info = Events[getTag<EVENT>()];
534  info.Checkers.push_back(checkfn);
535  }
536 
537  template <typename EVENT>
539  EventInfo &info = Events[getTag<EVENT>()];
540  info.HasDispatcher = true;
541  }
542 
543  template <typename EVENT>
544  void _dispatchEvent(const EVENT &event) const {
545  EventsTy::const_iterator I = Events.find(getTag<EVENT>());
546  if (I == Events.end())
547  return;
548  const EventInfo &info = I->second;
549  for (const auto Checker : info.Checkers)
550  Checker(&event);
551  }
552 
553 //===----------------------------------------------------------------------===//
554 // Implementation details.
555 //===----------------------------------------------------------------------===//
556 
557 private:
558  template <typename CHECKER>
559  static void destruct(void *obj) { delete static_cast<CHECKER *>(obj); }
560 
561  template <typename T>
562  static void *getTag() { static int tag; return &tag; }
563 
564  llvm::DenseMap<CheckerTag, CheckerRef> CheckerTags;
565 
566  std::vector<CheckerDtor> CheckerDtors;
567 
568  struct DeclCheckerInfo {
569  CheckDeclFunc CheckFn;
570  HandlesDeclFunc IsForDeclFn;
571  };
572  std::vector<DeclCheckerInfo> DeclCheckers;
573 
574  std::vector<CheckDeclFunc> BodyCheckers;
575 
577  using CachedDeclCheckersMapTy = llvm::DenseMap<unsigned, CachedDeclCheckers>;
578  CachedDeclCheckersMapTy CachedDeclCheckersMap;
579 
580  struct StmtCheckerInfo {
581  CheckStmtFunc CheckFn;
582  HandlesStmtFunc IsForStmtFn;
583  bool IsPreVisit;
584  };
585  std::vector<StmtCheckerInfo> StmtCheckers;
586 
588  using CachedStmtCheckersMapTy = llvm::DenseMap<unsigned, CachedStmtCheckers>;
589  CachedStmtCheckersMapTy CachedStmtCheckersMap;
590 
591  const CachedStmtCheckers &getCachedStmtCheckersFor(const Stmt *S,
592  bool isPreVisit);
593 
594  /// Returns the checkers that have registered for callbacks of the
595  /// given \p Kind.
596  const std::vector<CheckObjCMessageFunc> &
597  getObjCMessageCheckers(ObjCMessageVisitKind Kind);
598 
599  std::vector<CheckObjCMessageFunc> PreObjCMessageCheckers;
600  std::vector<CheckObjCMessageFunc> PostObjCMessageCheckers;
601  std::vector<CheckObjCMessageFunc> ObjCMessageNilCheckers;
602 
603  std::vector<CheckCallFunc> PreCallCheckers;
604  std::vector<CheckCallFunc> PostCallCheckers;
605 
606  std::vector<CheckLocationFunc> LocationCheckers;
607 
608  std::vector<CheckBindFunc> BindCheckers;
609 
610  std::vector<CheckEndAnalysisFunc> EndAnalysisCheckers;
611 
612  std::vector<CheckBeginFunctionFunc> BeginFunctionCheckers;
613  std::vector<CheckEndFunctionFunc> EndFunctionCheckers;
614 
615  std::vector<CheckBranchConditionFunc> BranchConditionCheckers;
616 
617  std::vector<CheckNewAllocatorFunc> NewAllocatorCheckers;
618 
619  std::vector<CheckLiveSymbolsFunc> LiveSymbolsCheckers;
620 
621  std::vector<CheckDeadSymbolsFunc> DeadSymbolsCheckers;
622 
623  std::vector<CheckRegionChangesFunc> RegionChangesCheckers;
624 
625  std::vector<CheckPointerEscapeFunc> PointerEscapeCheckers;
626 
627  std::vector<EvalAssumeFunc> EvalAssumeCheckers;
628 
629  std::vector<EvalCallFunc> EvalCallCheckers;
630 
631  std::vector<CheckEndOfTranslationUnit> EndOfTranslationUnitCheckers;
632 
633  struct EventInfo {
635  bool HasDispatcher = false;
636 
637  EventInfo() = default;
638  };
639 
640  using EventsTy = llvm::DenseMap<EventTag, EventInfo>;
641  EventsTy Events;
642 };
643 
644 } // namespace ento
645 
646 } // namespace clang
647 
648 #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:933
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.
ReturnStmt - This represents a return, optionally of an expression: return; return 4;...
Definition: Stmt.h:1476
CHECKER * registerChecker(AT... Args)
Used to register checkers.
BugReporter is a utility class for generating PathDiagnostics for analysis.
Definition: BugReporter.h:412
Kind
void _registerListenerForEvent(CheckEventFunc checkfn)
Represents a new-expression for memory allocation and constructor calls, e.g: "new CXXNewExpr(foo)"...
Definition: ExprCXX.h:1915
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:165
AnalyzerOptions & getAnalyzerOptions()
PointerEscapeKind
Describes the different reasons a pointer escapes during analysis.
bool(*)(const Decl *D) HandlesDeclFunc
The top declaration context.
Definition: Decl.h:107
const LangOptions & getLangOpts() const