]> CyberLeo.Net >> Repos - FreeBSD/releng/10.2.git/blob - contrib/llvm/tools/clang/include/clang/StaticAnalyzer/Core/CheckerManager.h
- Copy stable/10@285827 to releng/10.2 in preparation for 10.2-RC1
[FreeBSD/releng/10.2.git] / contrib / llvm / tools / clang / include / clang / StaticAnalyzer / Core / CheckerManager.h
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_SA_CORE_CHECKERMANAGER_H
15 #define LLVM_CLANG_SA_CORE_CHECKERMANAGER_H
16
17 #include "clang/Analysis/ProgramPoint.h"
18 #include "clang/Basic/LangOptions.h"
19 #include "clang/StaticAnalyzer/Core/PathSensitive/Store.h"
20 #include "clang/StaticAnalyzer/Core/AnalyzerOptions.h"
21 #include "llvm/ADT/DenseMap.h"
22 #include "llvm/ADT/SmallVector.h"
23 #include <vector>
24
25 namespace clang {
26   class Decl;
27   class Stmt;
28   class CallExpr;
29
30 namespace ento {
31   class CheckerBase;
32   class ExprEngine;
33   class AnalysisManager;
34   class BugReporter;
35   class CheckerContext;
36   class SimpleCall;
37   class ObjCMethodCall;
38   class SVal;
39   class ExplodedNode;
40   class ExplodedNodeSet;
41   class ExplodedGraph;
42   class ProgramState;
43   class NodeBuilder;
44   struct NodeBuilderContext;
45   class MemRegion;
46   class SymbolReaper;
47
48 template <typename T> class CheckerFn;
49
50 template <typename RET, typename P1, typename P2, typename P3, typename P4,
51           typename P5>
52 class CheckerFn<RET(P1, P2, P3, P4, P5)> {
53   typedef RET (*Func)(void *, P1, P2, P3, P4, P5);
54   Func Fn;
55 public:
56   CheckerBase *Checker;
57   CheckerFn(CheckerBase *checker, Func fn) : Fn(fn), Checker(checker) { }
58   RET operator()(P1 p1, P2 p2, P3 p3, P4 p4, P5 p5) const {
59     return Fn(Checker, p1, p2, p3, p4, p5);
60   }
61 };
62
63 template <typename RET, typename P1, typename P2, typename P3, typename P4>
64 class CheckerFn<RET(P1, P2, P3, P4)> {
65   typedef RET (*Func)(void *, P1, P2, P3, P4);
66   Func Fn;
67 public:
68   CheckerBase *Checker;
69   CheckerFn(CheckerBase *checker, Func fn) : Fn(fn), Checker(checker) { }
70   RET operator()(P1 p1, P2 p2, P3 p3, P4 p4) const { 
71     return Fn(Checker, p1, p2, p3, p4);
72   } 
73 };
74
75 template <typename RET, typename P1, typename P2, typename P3>
76 class CheckerFn<RET(P1, P2, P3)> {
77   typedef RET (*Func)(void *, P1, P2, P3);
78   Func Fn;
79 public:
80   CheckerBase *Checker;
81   CheckerFn(CheckerBase *checker, Func fn) : Fn(fn), Checker(checker) { }
82   RET operator()(P1 p1, P2 p2, P3 p3) const { return Fn(Checker, p1, p2, p3); } 
83 };
84
85 template <typename RET, typename P1, typename P2>
86 class CheckerFn<RET(P1, P2)> {
87   typedef RET (*Func)(void *, P1, P2);
88   Func Fn;
89 public:
90   CheckerBase *Checker;
91   CheckerFn(CheckerBase *checker, Func fn) : Fn(fn), Checker(checker) { }
92   RET operator()(P1 p1, P2 p2) const { return Fn(Checker, p1, p2); } 
93 };
94
95 template <typename RET, typename P1>
96 class CheckerFn<RET(P1)> {
97   typedef RET (*Func)(void *, P1);
98   Func Fn;
99 public:
100   CheckerBase *Checker;
101   CheckerFn(CheckerBase *checker, Func fn) : Fn(fn), Checker(checker) { }
102   RET operator()(P1 p1) const { return Fn(Checker, p1); } 
103 };
104
105 template <typename RET>
106 class CheckerFn<RET()> {
107   typedef RET (*Func)(void *);
108   Func Fn;
109 public:
110   CheckerBase *Checker;
111   CheckerFn(CheckerBase *checker, Func fn) : Fn(fn), Checker(checker) { }
112   RET operator()() const { return Fn(Checker); } 
113 };
114
115 /// \brief Describes the different reasons a pointer escapes
116 /// during analysis.
117 enum PointerEscapeKind {
118   /// A pointer escapes due to binding its value to a location
119   /// that the analyzer cannot track.
120   PSK_EscapeOnBind,
121
122   /// The pointer has been passed to a function call directly.
123   PSK_DirectEscapeOnCall,
124
125   /// The pointer has been passed to a function indirectly.
126   /// For example, the pointer is accessible through an
127   /// argument to a function.
128   PSK_IndirectEscapeOnCall,
129
130   /// The reason for pointer escape is unknown. For example, 
131   /// a region containing this pointer is invalidated.
132   PSK_EscapeOther
133 };
134
135 class CheckerManager {
136   const LangOptions LangOpts;
137   AnalyzerOptionsRef AOptions;
138 public:
139   CheckerManager(const LangOptions &langOpts,
140                  AnalyzerOptionsRef AOptions)
141     : LangOpts(langOpts),
142       AOptions(AOptions) {}
143
144   ~CheckerManager();
145
146   bool hasPathSensitiveCheckers() const;
147
148   void finishedCheckerRegistration();
149
150   const LangOptions &getLangOpts() const { return LangOpts; }
151   AnalyzerOptions &getAnalyzerOptions() { return *AOptions; }
152
153   typedef CheckerBase *CheckerRef;
154   typedef const void *CheckerTag;
155   typedef CheckerFn<void ()> CheckerDtor;
156
157 //===----------------------------------------------------------------------===//
158 // registerChecker
159 //===----------------------------------------------------------------------===//
160
161   /// \brief Used to register checkers.
162   ///
163   /// \returns a pointer to the checker object.
164   template <typename CHECKER>
165   CHECKER *registerChecker() {
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();
172     CheckerDtors.push_back(CheckerDtor(checker, destruct<CHECKER>));
173     CHECKER::_register(checker, *this);
174     ref = checker;
175     return checker;
176   }
177
178   template <typename CHECKER>
179   CHECKER *registerChecker(AnalyzerOptions &AOpts) {
180     CheckerTag tag = getTag<CHECKER>();
181     CheckerRef &ref = CheckerTags[tag];
182     if (ref)
183       return static_cast<CHECKER *>(ref); // already registered.
184
185     CHECKER *checker = new CHECKER(AOpts);
186     CheckerDtors.push_back(CheckerDtor(checker, destruct<CHECKER>));
187     CHECKER::_register(checker, *this);
188     ref = checker;
189     return checker;
190   }
191
192 //===----------------------------------------------------------------------===//
193 // Functions for running checkers for AST traversing..
194 //===----------------------------------------------------------------------===//
195
196   /// \brief Run checkers handling Decls.
197   void runCheckersOnASTDecl(const Decl *D, AnalysisManager& mgr,
198                             BugReporter &BR);
199
200   /// \brief Run checkers handling Decls containing a Stmt body.
201   void runCheckersOnASTBody(const Decl *D, AnalysisManager& mgr,
202                             BugReporter &BR);
203
204 //===----------------------------------------------------------------------===//
205 // Functions for running checkers for path-sensitive checking.
206 //===----------------------------------------------------------------------===//
207
208   /// \brief Run checkers for pre-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, runCheckersForPostStmt
214   void runCheckersForPreStmt(ExplodedNodeSet &Dst,
215                              const ExplodedNodeSet &Src,
216                              const Stmt *S,
217                              ExprEngine &Eng) {
218     runCheckersForStmt(/*isPreVisit=*/true, Dst, Src, S, Eng);
219   }
220
221   /// \brief Run checkers for post-visiting Stmts.
222   ///
223   /// The notification is performed for every explored CFGElement, which does
224   /// not include the control flow statements such as IfStmt.
225   ///
226   /// \sa runCheckersForBranchCondition, runCheckersForPreStmt
227   void runCheckersForPostStmt(ExplodedNodeSet &Dst,
228                               const ExplodedNodeSet &Src,
229                               const Stmt *S,
230                               ExprEngine &Eng,
231                               bool wasInlined = false) {
232     runCheckersForStmt(/*isPreVisit=*/false, Dst, Src, S, Eng, wasInlined);
233   }
234
235   /// \brief Run checkers for visiting Stmts.
236   void runCheckersForStmt(bool isPreVisit,
237                           ExplodedNodeSet &Dst, const ExplodedNodeSet &Src,
238                           const Stmt *S, ExprEngine &Eng,
239                           bool wasInlined = false);
240
241   /// \brief Run checkers for pre-visiting obj-c messages.
242   void runCheckersForPreObjCMessage(ExplodedNodeSet &Dst,
243                                     const ExplodedNodeSet &Src,
244                                     const ObjCMethodCall &msg,
245                                     ExprEngine &Eng) {
246     runCheckersForObjCMessage(/*isPreVisit=*/true, Dst, Src, msg, Eng);
247   }
248
249   /// \brief Run checkers for post-visiting obj-c messages.
250   void runCheckersForPostObjCMessage(ExplodedNodeSet &Dst,
251                                      const ExplodedNodeSet &Src,
252                                      const ObjCMethodCall &msg,
253                                      ExprEngine &Eng,
254                                      bool wasInlined = false) {
255     runCheckersForObjCMessage(/*isPreVisit=*/false, Dst, Src, msg, Eng,
256                               wasInlined);
257   }
258
259   /// \brief Run checkers for visiting obj-c messages.
260   void runCheckersForObjCMessage(bool isPreVisit,
261                                  ExplodedNodeSet &Dst,
262                                  const ExplodedNodeSet &Src,
263                                  const ObjCMethodCall &msg, ExprEngine &Eng,
264                                  bool wasInlined = false);
265
266   /// \brief Run checkers for pre-visiting obj-c messages.
267   void runCheckersForPreCall(ExplodedNodeSet &Dst, const ExplodedNodeSet &Src,
268                              const CallEvent &Call, ExprEngine &Eng) {
269     runCheckersForCallEvent(/*isPreVisit=*/true, Dst, Src, Call, Eng);
270   }
271
272   /// \brief Run checkers for post-visiting obj-c messages.
273   void runCheckersForPostCall(ExplodedNodeSet &Dst, const ExplodedNodeSet &Src,
274                               const CallEvent &Call, ExprEngine &Eng,
275                               bool wasInlined = false) {
276     runCheckersForCallEvent(/*isPreVisit=*/false, Dst, Src, Call, Eng,
277                             wasInlined);
278   }
279
280   /// \brief Run checkers for visiting obj-c messages.
281   void runCheckersForCallEvent(bool isPreVisit, ExplodedNodeSet &Dst,
282                                const ExplodedNodeSet &Src,
283                                const CallEvent &Call, ExprEngine &Eng,
284                                bool wasInlined = false);
285
286   /// \brief Run checkers for load/store of a location.
287   void runCheckersForLocation(ExplodedNodeSet &Dst,
288                               const ExplodedNodeSet &Src,
289                               SVal location,
290                               bool isLoad,
291                               const Stmt *NodeEx,
292                               const Stmt *BoundEx,
293                               ExprEngine &Eng);
294
295   /// \brief Run checkers for binding of a value to a location.
296   void runCheckersForBind(ExplodedNodeSet &Dst,
297                           const ExplodedNodeSet &Src,
298                           SVal location, SVal val,
299                           const Stmt *S, ExprEngine &Eng,
300                           const ProgramPoint &PP);
301
302   /// \brief Run checkers for end of analysis.
303   void runCheckersForEndAnalysis(ExplodedGraph &G, BugReporter &BR,
304                                  ExprEngine &Eng);
305
306   /// \brief Run checkers on end of function.
307   void runCheckersForEndFunction(NodeBuilderContext &BC,
308                                  ExplodedNodeSet &Dst,
309                                  ExplodedNode *Pred,
310                                  ExprEngine &Eng);
311
312   /// \brief Run checkers for branch condition.
313   void runCheckersForBranchCondition(const Stmt *condition,
314                                      ExplodedNodeSet &Dst, ExplodedNode *Pred,
315                                      ExprEngine &Eng);
316
317   /// \brief Run checkers for live symbols.
318   ///
319   /// Allows modifying SymbolReaper object. For example, checkers can explicitly
320   /// register symbols of interest as live. These symbols will not be marked
321   /// dead and removed.
322   void runCheckersForLiveSymbols(ProgramStateRef state,
323                                  SymbolReaper &SymReaper);
324
325   /// \brief Run checkers for dead symbols.
326   ///
327   /// Notifies checkers when symbols become dead. For example, this allows
328   /// checkers to aggressively clean up/reduce the checker state and produce
329   /// precise diagnostics.
330   void runCheckersForDeadSymbols(ExplodedNodeSet &Dst,
331                                  const ExplodedNodeSet &Src,
332                                  SymbolReaper &SymReaper, const Stmt *S,
333                                  ExprEngine &Eng,
334                                  ProgramPoint::Kind K);
335
336   /// \brief True if at least one checker wants to check region changes.
337   bool wantsRegionChangeUpdate(ProgramStateRef state);
338
339   /// \brief Run checkers for region changes.
340   ///
341   /// This corresponds to the check::RegionChanges callback.
342   /// \param state The current program state.
343   /// \param invalidated A set of all symbols potentially touched by the change.
344   /// \param ExplicitRegions The regions explicitly requested for invalidation.
345   ///   For example, in the case of a function call, these would be arguments.
346   /// \param Regions The transitive closure of accessible regions,
347   ///   i.e. all regions that may have been touched by this change.
348   /// \param Call The call expression wrapper if the regions are invalidated
349   ///   by a call.
350   ProgramStateRef
351   runCheckersForRegionChanges(ProgramStateRef state,
352                               const InvalidatedSymbols *invalidated,
353                               ArrayRef<const MemRegion *> ExplicitRegions,
354                               ArrayRef<const MemRegion *> Regions,
355                               const CallEvent *Call);
356
357   /// \brief Run checkers when pointers escape.
358   ///
359   /// This notifies the checkers about pointer escape, which occurs whenever
360   /// the analyzer cannot track the symbol any more. For example, as a
361   /// result of assigning a pointer into a global or when it's passed to a 
362   /// function call the analyzer cannot model.
363   /// 
364   /// \param State The state at the point of escape.
365   /// \param Escaped The list of escaped symbols.
366   /// \param Call The corresponding CallEvent, if the symbols escape as 
367   ///        parameters to the given call.
368   /// \param Kind The reason of pointer escape.
369   /// \param ITraits Information about invalidation for a particular 
370   ///        region/symbol.
371   /// \returns Checkers can modify the state by returning a new one.
372   ProgramStateRef 
373   runCheckersForPointerEscape(ProgramStateRef State,
374                               const InvalidatedSymbols &Escaped,
375                               const CallEvent *Call,
376                               PointerEscapeKind Kind,
377                              RegionAndSymbolInvalidationTraits *ITraits);
378
379   /// \brief Run checkers for handling assumptions on symbolic values.
380   ProgramStateRef runCheckersForEvalAssume(ProgramStateRef state,
381                                            SVal Cond, bool Assumption);
382
383   /// \brief Run checkers for evaluating a call.
384   ///
385   /// Warning: Currently, the CallEvent MUST come from a CallExpr!
386   void runCheckersForEvalCall(ExplodedNodeSet &Dst,
387                               const ExplodedNodeSet &Src,
388                               const CallEvent &CE, ExprEngine &Eng);
389   
390   /// \brief Run checkers for the entire Translation Unit.
391   void runCheckersOnEndOfTranslationUnit(const TranslationUnitDecl *TU,
392                                          AnalysisManager &mgr,
393                                          BugReporter &BR);
394
395   /// \brief Run checkers for debug-printing a ProgramState.
396   ///
397   /// Unlike most other callbacks, any checker can simply implement the virtual
398   /// method CheckerBase::printState if it has custom data to print.
399   /// \param Out The output stream
400   /// \param State The state being printed
401   /// \param NL The preferred representation of a newline.
402   /// \param Sep The preferred separator between different kinds of data.
403   void runCheckersForPrintState(raw_ostream &Out, ProgramStateRef State,
404                                 const char *NL, const char *Sep);
405
406 //===----------------------------------------------------------------------===//
407 // Internal registration functions for AST traversing.
408 //===----------------------------------------------------------------------===//
409
410   // Functions used by the registration mechanism, checkers should not touch
411   // these directly.
412
413   typedef CheckerFn<void (const Decl *, AnalysisManager&, BugReporter &)>
414       CheckDeclFunc;
415
416   typedef bool (*HandlesDeclFunc)(const Decl *D);
417   void _registerForDecl(CheckDeclFunc checkfn, HandlesDeclFunc isForDeclFn);
418
419   void _registerForBody(CheckDeclFunc checkfn);
420
421 //===----------------------------------------------------------------------===//
422 // Internal registration functions for path-sensitive checking.
423 //===----------------------------------------------------------------------===//
424
425   typedef CheckerFn<void (const Stmt *, CheckerContext &)> CheckStmtFunc;
426   
427   typedef CheckerFn<void (const ObjCMethodCall &, CheckerContext &)>
428       CheckObjCMessageFunc;
429
430   typedef CheckerFn<void (const CallEvent &, CheckerContext &)>
431       CheckCallFunc;
432   
433   typedef CheckerFn<void (const SVal &location, bool isLoad,
434                           const Stmt *S,
435                           CheckerContext &)>
436       CheckLocationFunc;
437   
438   typedef CheckerFn<void (const SVal &location, const SVal &val, 
439                           const Stmt *S, CheckerContext &)> 
440       CheckBindFunc;
441   
442   typedef CheckerFn<void (ExplodedGraph &, BugReporter &, ExprEngine &)>
443       CheckEndAnalysisFunc;
444   
445   typedef CheckerFn<void (CheckerContext &)>
446       CheckEndFunctionFunc;
447   
448   typedef CheckerFn<void (const Stmt *, CheckerContext &)>
449       CheckBranchConditionFunc;
450   
451   typedef CheckerFn<void (SymbolReaper &, CheckerContext &)>
452       CheckDeadSymbolsFunc;
453   
454   typedef CheckerFn<void (ProgramStateRef,SymbolReaper &)> CheckLiveSymbolsFunc;
455   
456   typedef CheckerFn<ProgramStateRef (ProgramStateRef,
457                                 const InvalidatedSymbols *symbols,
458                                 ArrayRef<const MemRegion *> ExplicitRegions,
459                                 ArrayRef<const MemRegion *> Regions,
460                                 const CallEvent *Call)>
461       CheckRegionChangesFunc;
462   
463   typedef CheckerFn<bool (ProgramStateRef)> WantsRegionChangeUpdateFunc;
464
465   typedef CheckerFn<ProgramStateRef (ProgramStateRef,
466                                      const InvalidatedSymbols &Escaped,
467                                      const CallEvent *Call,
468                                      PointerEscapeKind Kind,
469                                      RegionAndSymbolInvalidationTraits *ITraits)>
470       CheckPointerEscapeFunc;
471   
472   typedef CheckerFn<ProgramStateRef (ProgramStateRef,
473                                           const SVal &cond, bool assumption)>
474       EvalAssumeFunc;
475   
476   typedef CheckerFn<bool (const CallExpr *, CheckerContext &)>
477       EvalCallFunc;
478
479   typedef CheckerFn<void (const TranslationUnitDecl *,
480                           AnalysisManager&, BugReporter &)>
481       CheckEndOfTranslationUnit;
482
483   typedef bool (*HandlesStmtFunc)(const Stmt *D);
484   void _registerForPreStmt(CheckStmtFunc checkfn,
485                            HandlesStmtFunc isForStmtFn);
486   void _registerForPostStmt(CheckStmtFunc checkfn,
487                             HandlesStmtFunc isForStmtFn);
488
489   void _registerForPreObjCMessage(CheckObjCMessageFunc checkfn);
490   void _registerForPostObjCMessage(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 _registerForEndFunction(CheckEndFunctionFunc checkfn);
502
503   void _registerForBranchCondition(CheckBranchConditionFunc checkfn);
504
505   void _registerForLiveSymbols(CheckLiveSymbolsFunc checkfn);
506
507   void _registerForDeadSymbols(CheckDeadSymbolsFunc checkfn);
508
509   void _registerForRegionChanges(CheckRegionChangesFunc checkfn,
510                                  WantsRegionChangeUpdateFunc wantUpdateFn);
511
512   void _registerForPointerEscape(CheckPointerEscapeFunc checkfn);
513
514   void _registerForConstPointerEscape(CheckPointerEscapeFunc checkfn);
515
516   void _registerForEvalAssume(EvalAssumeFunc checkfn);
517
518   void _registerForEvalCall(EvalCallFunc checkfn);
519
520   void _registerForEndOfTranslationUnit(CheckEndOfTranslationUnit checkfn);
521
522 //===----------------------------------------------------------------------===//
523 // Internal registration functions for events.
524 //===----------------------------------------------------------------------===//
525
526   typedef void *EventTag;
527   typedef CheckerFn<void (const void *event)> CheckEventFunc;
528
529   template <typename EVENT>
530   void _registerListenerForEvent(CheckEventFunc checkfn) {
531     EventInfo &info = Events[getTag<EVENT>()];
532     info.Checkers.push_back(checkfn);    
533   }
534
535   template <typename EVENT>
536   void _registerDispatcherForEvent() {
537     EventInfo &info = Events[getTag<EVENT>()];
538     info.HasDispatcher = true;
539   }
540
541   template <typename EVENT>
542   void _dispatchEvent(const EVENT &event) const {
543     EventsTy::const_iterator I = Events.find(getTag<EVENT>());
544     if (I == Events.end())
545       return;
546     const EventInfo &info = I->second;
547     for (unsigned i = 0, e = info.Checkers.size(); i != e; ++i)
548       info.Checkers[i](&event);
549   }
550
551 //===----------------------------------------------------------------------===//
552 // Implementation details.
553 //===----------------------------------------------------------------------===//
554
555 private:
556   template <typename CHECKER>
557   static void destruct(void *obj) { delete static_cast<CHECKER *>(obj); }
558
559   template <typename T>
560   static void *getTag() { static int tag; return &tag; }
561
562   llvm::DenseMap<CheckerTag, CheckerRef> CheckerTags;
563
564   std::vector<CheckerDtor> CheckerDtors;
565
566   struct DeclCheckerInfo {
567     CheckDeclFunc CheckFn;
568     HandlesDeclFunc IsForDeclFn;
569   };
570   std::vector<DeclCheckerInfo> DeclCheckers;
571
572   std::vector<CheckDeclFunc> BodyCheckers;
573
574   typedef SmallVector<CheckDeclFunc, 4> CachedDeclCheckers;
575   typedef llvm::DenseMap<unsigned, CachedDeclCheckers> CachedDeclCheckersMapTy;
576   CachedDeclCheckersMapTy CachedDeclCheckersMap;
577
578   struct StmtCheckerInfo {
579     CheckStmtFunc CheckFn;
580     HandlesStmtFunc IsForStmtFn;
581     bool IsPreVisit;
582   };
583   std::vector<StmtCheckerInfo> StmtCheckers;
584
585   typedef SmallVector<CheckStmtFunc, 4> CachedStmtCheckers;
586   typedef llvm::DenseMap<unsigned, CachedStmtCheckers> CachedStmtCheckersMapTy;
587   CachedStmtCheckersMapTy CachedStmtCheckersMap;
588
589   const CachedStmtCheckers &getCachedStmtCheckersFor(const Stmt *S,
590                                                      bool isPreVisit);
591
592   std::vector<CheckObjCMessageFunc> PreObjCMessageCheckers;
593   std::vector<CheckObjCMessageFunc> PostObjCMessageCheckers;
594
595   std::vector<CheckCallFunc> PreCallCheckers;
596   std::vector<CheckCallFunc> PostCallCheckers;
597
598   std::vector<CheckLocationFunc> LocationCheckers;
599
600   std::vector<CheckBindFunc> BindCheckers;
601
602   std::vector<CheckEndAnalysisFunc> EndAnalysisCheckers;
603
604   std::vector<CheckEndFunctionFunc> EndFunctionCheckers;
605
606   std::vector<CheckBranchConditionFunc> BranchConditionCheckers;
607
608   std::vector<CheckLiveSymbolsFunc> LiveSymbolsCheckers;
609
610   std::vector<CheckDeadSymbolsFunc> DeadSymbolsCheckers;
611
612   struct RegionChangesCheckerInfo {
613     CheckRegionChangesFunc CheckFn;
614     WantsRegionChangeUpdateFunc WantUpdateFn;
615   };
616   std::vector<RegionChangesCheckerInfo> RegionChangesCheckers;
617
618   std::vector<CheckPointerEscapeFunc> PointerEscapeCheckers;
619
620   std::vector<EvalAssumeFunc> EvalAssumeCheckers;
621
622   std::vector<EvalCallFunc> EvalCallCheckers;
623
624   std::vector<CheckEndOfTranslationUnit> EndOfTranslationUnitCheckers;
625
626   struct EventInfo {
627     SmallVector<CheckEventFunc, 4> Checkers;
628     bool HasDispatcher;
629     EventInfo() : HasDispatcher(false) { }
630   };
631   
632   typedef llvm::DenseMap<EventTag, EventInfo> EventsTy;
633   EventsTy Events;
634 };
635
636 } // end ento namespace
637
638 } // end clang namespace
639
640 #endif