Eugene Zelenko | 0a4f3f4 | 2016-02-10 19:11:58 +0000 | [diff] [blame] | 1 | //===- CheckerDocumentation.cpp - Documentation checker ---------*- C++ -*-===// |
Anna Zaks | 92297f9 | 2011-11-30 17:12:52 +0000 | [diff] [blame] | 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 | // This checker lists all the checker callbacks and provides documentation for |
| 11 | // checker writers. |
| 12 | // |
| 13 | //===----------------------------------------------------------------------===// |
| 14 | |
| 15 | #include "ClangSACheckers.h" |
Chandler Carruth | 3a02247 | 2012-12-04 09:13:33 +0000 | [diff] [blame] | 16 | #include "clang/StaticAnalyzer/Core/BugReporter/BugType.h" |
Anna Zaks | 92297f9 | 2011-11-30 17:12:52 +0000 | [diff] [blame] | 17 | #include "clang/StaticAnalyzer/Core/Checker.h" |
| 18 | #include "clang/StaticAnalyzer/Core/CheckerManager.h" |
| 19 | #include "clang/StaticAnalyzer/Core/PathSensitive/CheckerContext.h" |
Anna Zaks | 92297f9 | 2011-11-30 17:12:52 +0000 | [diff] [blame] | 20 | #include "clang/StaticAnalyzer/Core/PathSensitive/ProgramStateTrait.h" |
| 21 | |
| 22 | using namespace clang; |
| 23 | using namespace ento; |
| 24 | |
| 25 | // All checkers should be placed into anonymous namespace. |
| 26 | // We place the CheckerDocumentation inside ento namespace to make the |
| 27 | // it visible in doxygen. |
Jordan Rose | f684db6 | 2012-11-07 02:35:02 +0000 | [diff] [blame] | 28 | namespace clang { |
Anna Zaks | 92297f9 | 2011-11-30 17:12:52 +0000 | [diff] [blame] | 29 | namespace ento { |
| 30 | |
| 31 | /// This checker documents the callback functions checkers can use to implement |
| 32 | /// the custom handling of the specific events during path exploration as well |
| 33 | /// as reporting bugs. Most of the callbacks are targeted at path-sensitive |
| 34 | /// checking. |
| 35 | /// |
| 36 | /// \sa CheckerContext |
Jordan Rose | 4080b0c | 2012-11-02 23:49:33 +0000 | [diff] [blame] | 37 | class CheckerDocumentation : public Checker< check::PreStmt<ReturnStmt>, |
| 38 | check::PostStmt<DeclStmt>, |
Anna Zaks | 92297f9 | 2011-11-30 17:12:52 +0000 | [diff] [blame] | 39 | check::PreObjCMessage, |
| 40 | check::PostObjCMessage, |
Devin Coughlin | ca5ab2b | 2015-09-15 01:13:53 +0000 | [diff] [blame] | 41 | check::ObjCMessageNil, |
Jordan Rose | afe7c2c | 2012-07-02 19:28:16 +0000 | [diff] [blame] | 42 | check::PreCall, |
| 43 | check::PostCall, |
Anna Zaks | 92297f9 | 2011-11-30 17:12:52 +0000 | [diff] [blame] | 44 | check::BranchCondition, |
Artem Dergachev | 13b2026 | 2018-01-17 23:46:13 +0000 | [diff] [blame] | 45 | check::NewAllocator, |
Anna Zaks | 92297f9 | 2011-11-30 17:12:52 +0000 | [diff] [blame] | 46 | check::Location, |
| 47 | check::Bind, |
| 48 | check::DeadSymbols, |
Devin Coughlin | e434fc4 | 2016-07-28 00:52:10 +0000 | [diff] [blame] | 49 | check::BeginFunction, |
Anna Zaks | 3fdcc0b | 2013-01-03 00:25:29 +0000 | [diff] [blame] | 50 | check::EndFunction, |
Anna Zaks | 92297f9 | 2011-11-30 17:12:52 +0000 | [diff] [blame] | 51 | check::EndAnalysis, |
| 52 | check::EndOfTranslationUnit, |
| 53 | eval::Call, |
| 54 | eval::Assume, |
| 55 | check::LiveSymbols, |
| 56 | check::RegionChanges, |
Anna Zaks | dc15415 | 2012-12-20 00:38:25 +0000 | [diff] [blame] | 57 | check::PointerEscape, |
Anna Zaks | 4b04e66 | 2013-03-28 23:15:32 +0000 | [diff] [blame] | 58 | check::ConstPointerEscape, |
Anna Zaks | 92297f9 | 2011-11-30 17:12:52 +0000 | [diff] [blame] | 59 | check::Event<ImplicitNullDerefEvent>, |
| 60 | check::ASTDecl<FunctionDecl> > { |
| 61 | public: |
Anna Zaks | 92297f9 | 2011-11-30 17:12:52 +0000 | [diff] [blame] | 62 | /// \brief Pre-visit the Statement. |
| 63 | /// |
| 64 | /// The method will be called before the analyzer core processes the |
| 65 | /// statement. The notification is performed for every explored CFGElement, |
| 66 | /// which does not include the control flow statements such as IfStmt. The |
| 67 | /// callback can be specialized to be called with any subclass of Stmt. |
| 68 | /// |
| 69 | /// See checkBranchCondition() callback for performing custom processing of |
| 70 | /// the branching statements. |
| 71 | /// |
Jordan Rose | 4080b0c | 2012-11-02 23:49:33 +0000 | [diff] [blame] | 72 | /// check::PreStmt<ReturnStmt> |
| 73 | void checkPreStmt(const ReturnStmt *DS, CheckerContext &C) const {} |
Anna Zaks | 92297f9 | 2011-11-30 17:12:52 +0000 | [diff] [blame] | 74 | |
| 75 | /// \brief Post-visit the Statement. |
| 76 | /// |
| 77 | /// The method will be called after the analyzer core processes the |
| 78 | /// statement. The notification is performed for every explored CFGElement, |
| 79 | /// which does not include the control flow statements such as IfStmt. The |
| 80 | /// callback can be specialized to be called with any subclass of Stmt. |
| 81 | /// |
Jordan Rose | 4080b0c | 2012-11-02 23:49:33 +0000 | [diff] [blame] | 82 | /// check::PostStmt<DeclStmt> |
| 83 | void checkPostStmt(const DeclStmt *DS, CheckerContext &C) const; |
Anna Zaks | 92297f9 | 2011-11-30 17:12:52 +0000 | [diff] [blame] | 84 | |
Jordan Rose | afe7c2c | 2012-07-02 19:28:16 +0000 | [diff] [blame] | 85 | /// \brief Pre-visit the Objective C message. |
| 86 | /// |
| 87 | /// This will be called before the analyzer core processes the method call. |
| 88 | /// This is called for any action which produces an Objective-C message send, |
Jordan Rose | 627b046 | 2012-07-18 21:59:51 +0000 | [diff] [blame] | 89 | /// including explicit message syntax and property access. |
Jordan Rose | afe7c2c | 2012-07-02 19:28:16 +0000 | [diff] [blame] | 90 | /// |
| 91 | /// check::PreObjCMessage |
Jordan Rose | 547060b | 2012-07-02 19:28:04 +0000 | [diff] [blame] | 92 | void checkPreObjCMessage(const ObjCMethodCall &M, CheckerContext &C) const {} |
Anna Zaks | 92297f9 | 2011-11-30 17:12:52 +0000 | [diff] [blame] | 93 | |
Jordan Rose | afe7c2c | 2012-07-02 19:28:16 +0000 | [diff] [blame] | 94 | /// \brief Post-visit the Objective C message. |
| 95 | /// \sa checkPreObjCMessage() |
| 96 | /// |
| 97 | /// check::PostObjCMessage |
Jordan Rose | 547060b | 2012-07-02 19:28:04 +0000 | [diff] [blame] | 98 | void checkPostObjCMessage(const ObjCMethodCall &M, CheckerContext &C) const {} |
Anna Zaks | 92297f9 | 2011-11-30 17:12:52 +0000 | [diff] [blame] | 99 | |
Devin Coughlin | ca5ab2b | 2015-09-15 01:13:53 +0000 | [diff] [blame] | 100 | /// \brief Visit an Objective-C message whose receiver is nil. |
| 101 | /// |
| 102 | /// This will be called when the analyzer core processes a method call whose |
| 103 | /// receiver is definitely nil. In this case, check{Pre/Post}ObjCMessage and |
| 104 | /// check{Pre/Post}Call will not be called. |
| 105 | /// |
| 106 | /// check::ObjCMessageNil |
| 107 | void checkObjCMessageNil(const ObjCMethodCall &M, CheckerContext &C) const {} |
| 108 | |
Jordan Rose | afe7c2c | 2012-07-02 19:28:16 +0000 | [diff] [blame] | 109 | /// \brief Pre-visit an abstract "call" event. |
| 110 | /// |
| 111 | /// This is used for checkers that want to check arguments or attributed |
| 112 | /// behavior for functions and methods no matter how they are being invoked. |
| 113 | /// |
| 114 | /// Note that this includes ALL cross-body invocations, so if you want to |
Jordan Rose | 4080b0c | 2012-11-02 23:49:33 +0000 | [diff] [blame] | 115 | /// limit your checks to, say, function calls, you should test for that at the |
| 116 | /// beginning of your callback function. |
Jordan Rose | afe7c2c | 2012-07-02 19:28:16 +0000 | [diff] [blame] | 117 | /// |
| 118 | /// check::PreCall |
| 119 | void checkPreCall(const CallEvent &Call, CheckerContext &C) const {} |
| 120 | |
| 121 | /// \brief Post-visit an abstract "call" event. |
| 122 | /// \sa checkPreObjCMessage() |
| 123 | /// |
| 124 | /// check::PostCall |
| 125 | void checkPostCall(const CallEvent &Call, CheckerContext &C) const {} |
| 126 | |
Anna Zaks | 92297f9 | 2011-11-30 17:12:52 +0000 | [diff] [blame] | 127 | /// \brief Pre-visit of the condition statement of a branch (such as IfStmt). |
| 128 | void checkBranchCondition(const Stmt *Condition, CheckerContext &Ctx) const {} |
| 129 | |
Artem Dergachev | 13b2026 | 2018-01-17 23:46:13 +0000 | [diff] [blame] | 130 | /// \brief Post-visit the C++ operator new's allocation call. |
| 131 | /// |
| 132 | /// Execution of C++ operator new consists of the following phases: (1) call |
| 133 | /// default or overridden operator new() to allocate memory (2) cast the |
| 134 | /// return value of operator new() from void pointer type to class pointer |
| 135 | /// type, (3) assuming that the value is non-null, call the object's |
| 136 | /// constructor over this pointer, (4) declare that the value of the |
| 137 | /// new-expression is this pointer. This callback is called between steps |
| 138 | /// (2) and (3). Post-call for the allocator is called after step (1). |
| 139 | /// Pre-statement for the new-expression is called on step (4) when the value |
| 140 | /// of the expression is evaluated. |
| 141 | /// \param NE The C++ new-expression that triggered the allocation. |
| 142 | /// \param Target The allocated region, casted to the class type. |
| 143 | void checkNewAllocator(const CXXNewExpr *NE, SVal Target, |
| 144 | CheckerContext &) const {} |
| 145 | |
Anna Zaks | 92297f9 | 2011-11-30 17:12:52 +0000 | [diff] [blame] | 146 | /// \brief Called on a load from and a store to a location. |
| 147 | /// |
| 148 | /// The method will be called each time a location (pointer) value is |
| 149 | /// accessed. |
| 150 | /// \param Loc The value of the location (pointer). |
| 151 | /// \param IsLoad The flag specifying if the location is a store or a load. |
| 152 | /// \param S The load is performed while processing the statement. |
| 153 | /// |
| 154 | /// check::Location |
| 155 | void checkLocation(SVal Loc, bool IsLoad, const Stmt *S, |
James Dennett | 845619a | 2012-06-15 07:41:35 +0000 | [diff] [blame] | 156 | CheckerContext &) const {} |
Anna Zaks | 92297f9 | 2011-11-30 17:12:52 +0000 | [diff] [blame] | 157 | |
| 158 | /// \brief Called on binding of a value to a location. |
| 159 | /// |
| 160 | /// \param Loc The value of the location (pointer). |
| 161 | /// \param Val The value which will be stored at the location Loc. |
| 162 | /// \param S The bind is performed while processing the statement S. |
| 163 | /// |
| 164 | /// check::Bind |
James Dennett | 845619a | 2012-06-15 07:41:35 +0000 | [diff] [blame] | 165 | void checkBind(SVal Loc, SVal Val, const Stmt *S, CheckerContext &) const {} |
Anna Zaks | 92297f9 | 2011-11-30 17:12:52 +0000 | [diff] [blame] | 166 | |
Anna Zaks | 92297f9 | 2011-11-30 17:12:52 +0000 | [diff] [blame] | 167 | /// \brief Called whenever a symbol becomes dead. |
| 168 | /// |
| 169 | /// This callback should be used by the checkers to aggressively clean |
| 170 | /// up/reduce the checker state, which is important for reducing the overall |
| 171 | /// memory usage. Specifically, if a checker keeps symbol specific information |
| 172 | /// in the sate, it can and should be dropped after the symbol becomes dead. |
| 173 | /// In addition, reporting a bug as soon as the checker becomes dead leads to |
| 174 | /// more precise diagnostics. (For example, one should report that a malloced |
| 175 | /// variable is not freed right after it goes out of scope.) |
| 176 | /// |
| 177 | /// \param SR The SymbolReaper object can be queried to determine which |
| 178 | /// symbols are dead. |
| 179 | /// |
| 180 | /// check::DeadSymbols |
| 181 | void checkDeadSymbols(SymbolReaper &SR, CheckerContext &C) const {} |
| 182 | |
Devin Coughlin | 8d922aa | 2016-02-19 01:35:10 +0000 | [diff] [blame] | 183 | |
| 184 | /// \brief Called when the analyzer core starts analyzing a function, |
| 185 | /// regardless of whether it is analyzed at the top level or is inlined. |
| 186 | /// |
| 187 | /// check::BeginFunction |
| 188 | void checkBeginFunction(CheckerContext &Ctx) const {} |
| 189 | |
Anna Zaks | 3fdcc0b | 2013-01-03 00:25:29 +0000 | [diff] [blame] | 190 | /// \brief Called when the analyzer core reaches the end of a |
Devin Coughlin | 8d922aa | 2016-02-19 01:35:10 +0000 | [diff] [blame] | 191 | /// function being analyzed regardless of whether it is analyzed at the top |
| 192 | /// level or is inlined. |
Anna Zaks | 92297f9 | 2011-11-30 17:12:52 +0000 | [diff] [blame] | 193 | /// |
Anna Zaks | 3fdcc0b | 2013-01-03 00:25:29 +0000 | [diff] [blame] | 194 | /// check::EndFunction |
| 195 | void checkEndFunction(CheckerContext &Ctx) const {} |
Anna Zaks | 92297f9 | 2011-11-30 17:12:52 +0000 | [diff] [blame] | 196 | |
| 197 | /// \brief Called after all the paths in the ExplodedGraph reach end of path |
| 198 | /// - the symbolic execution graph is fully explored. |
| 199 | /// |
| 200 | /// This callback should be used in cases when a checker needs to have a |
| 201 | /// global view of the information generated on all paths. For example, to |
| 202 | /// compare execution summary/result several paths. |
| 203 | /// See IdempotentOperationChecker for a usage example. |
| 204 | /// |
| 205 | /// check::EndAnalysis |
| 206 | void checkEndAnalysis(ExplodedGraph &G, |
| 207 | BugReporter &BR, |
| 208 | ExprEngine &Eng) const {} |
| 209 | |
| 210 | /// \brief Called after analysis of a TranslationUnit is complete. |
| 211 | /// |
| 212 | /// check::EndOfTranslationUnit |
Anton Yartsev | edb0628 | 2012-03-23 02:43:24 +0000 | [diff] [blame] | 213 | void checkEndOfTranslationUnit(const TranslationUnitDecl *TU, |
| 214 | AnalysisManager &Mgr, |
| 215 | BugReporter &BR) const {} |
Anna Zaks | 92297f9 | 2011-11-30 17:12:52 +0000 | [diff] [blame] | 216 | |
Anna Zaks | 92297f9 | 2011-11-30 17:12:52 +0000 | [diff] [blame] | 217 | /// \brief Evaluates function call. |
| 218 | /// |
| 219 | /// The analysis core threats all function calls in the same way. However, some |
| 220 | /// functions have special meaning, which should be reflected in the program |
| 221 | /// state. This callback allows a checker to provide domain specific knowledge |
| 222 | /// about the particular functions it knows about. |
| 223 | /// |
| 224 | /// \returns true if the call has been successfully evaluated |
| 225 | /// and false otherwise. Note, that only one checker can evaluate a call. If |
Duncan Sands | f3dcb68 | 2013-05-25 02:22:10 +0000 | [diff] [blame] | 226 | /// more than one checker claims that they can evaluate the same call the |
Anna Zaks | 92297f9 | 2011-11-30 17:12:52 +0000 | [diff] [blame] | 227 | /// first one wins. |
| 228 | /// |
| 229 | /// eval::Call |
| 230 | bool evalCall(const CallExpr *CE, CheckerContext &C) const { return true; } |
| 231 | |
| 232 | /// \brief Handles assumptions on symbolic values. |
| 233 | /// |
| 234 | /// This method is called when a symbolic expression is assumed to be true or |
| 235 | /// false. For example, the assumptions are performed when evaluating a |
| 236 | /// condition at a branch. The callback allows checkers track the assumptions |
| 237 | /// performed on the symbols of interest and change the state accordingly. |
| 238 | /// |
| 239 | /// eval::Assume |
Ted Kremenek | 49b1e38 | 2012-01-26 21:29:00 +0000 | [diff] [blame] | 240 | ProgramStateRef evalAssume(ProgramStateRef State, |
Anna Zaks | 92297f9 | 2011-11-30 17:12:52 +0000 | [diff] [blame] | 241 | SVal Cond, |
| 242 | bool Assumption) const { return State; } |
| 243 | |
| 244 | /// Allows modifying SymbolReaper object. For example, checkers can explicitly |
| 245 | /// register symbols of interest as live. These symbols will not be marked |
| 246 | /// dead and removed. |
| 247 | /// |
| 248 | /// check::LiveSymbols |
Ted Kremenek | 49b1e38 | 2012-01-26 21:29:00 +0000 | [diff] [blame] | 249 | void checkLiveSymbols(ProgramStateRef State, SymbolReaper &SR) const {} |
Anna Zaks | 92297f9 | 2011-11-30 17:12:52 +0000 | [diff] [blame] | 250 | |
Jordan Rose | f684db6 | 2012-11-07 02:35:02 +0000 | [diff] [blame] | 251 | /// \brief Called when the contents of one or more regions change. |
| 252 | /// |
| 253 | /// This can occur in many different ways: an explicit bind, a blanket |
| 254 | /// invalidation of the region contents, or by passing a region to a function |
| 255 | /// call whose behavior the analyzer cannot model perfectly. |
James Dennett | 845619a | 2012-06-15 07:41:35 +0000 | [diff] [blame] | 256 | /// |
| 257 | /// \param State The current program state. |
| 258 | /// \param Invalidated A set of all symbols potentially touched by the change. |
Anna Zaks | 3d34834 | 2012-02-14 21:55:24 +0000 | [diff] [blame] | 259 | /// \param ExplicitRegions The regions explicitly requested for invalidation. |
Jordan Rose | f684db6 | 2012-11-07 02:35:02 +0000 | [diff] [blame] | 260 | /// For a function call, this would be the arguments. For a bind, this |
| 261 | /// would be the region being bound to. |
| 262 | /// \param Regions The transitive closure of regions accessible from, |
| 263 | /// \p ExplicitRegions, i.e. all regions that may have been touched |
| 264 | /// by this change. For a simple bind, this list will be the same as |
| 265 | /// \p ExplicitRegions, since a bind does not affect the contents of |
| 266 | /// anything accessible through the base region. |
Anna Zaks | b570195 | 2017-01-13 00:50:57 +0000 | [diff] [blame] | 267 | /// \param LCtx LocationContext that is useful for getting various contextual |
| 268 | /// info, like callstack, CFG etc. |
Jordan Rose | f684db6 | 2012-11-07 02:35:02 +0000 | [diff] [blame] | 269 | /// \param Call The opaque call triggering this invalidation. Will be 0 if the |
| 270 | /// change was not triggered by a call. |
| 271 | /// |
James Dennett | 845619a | 2012-06-15 07:41:35 +0000 | [diff] [blame] | 272 | /// check::RegionChanges |
Ted Kremenek | 3a0678e | 2015-09-08 03:50:52 +0000 | [diff] [blame] | 273 | ProgramStateRef |
Ted Kremenek | 49b1e38 | 2012-01-26 21:29:00 +0000 | [diff] [blame] | 274 | checkRegionChanges(ProgramStateRef State, |
Anna Zaks | dc15415 | 2012-12-20 00:38:25 +0000 | [diff] [blame] | 275 | const InvalidatedSymbols *Invalidated, |
Anna Zaks | 92297f9 | 2011-11-30 17:12:52 +0000 | [diff] [blame] | 276 | ArrayRef<const MemRegion *> ExplicitRegions, |
Anna Zaks | 3d34834 | 2012-02-14 21:55:24 +0000 | [diff] [blame] | 277 | ArrayRef<const MemRegion *> Regions, |
Anna Zaks | b570195 | 2017-01-13 00:50:57 +0000 | [diff] [blame] | 278 | const LocationContext *LCtx, |
Jordan Rose | 742920c | 2012-07-02 19:27:35 +0000 | [diff] [blame] | 279 | const CallEvent *Call) const { |
Anna Zaks | 92297f9 | 2011-11-30 17:12:52 +0000 | [diff] [blame] | 280 | return State; |
| 281 | } |
| 282 | |
Anna Zaks | dc15415 | 2012-12-20 00:38:25 +0000 | [diff] [blame] | 283 | /// \brief Called when pointers escape. |
| 284 | /// |
| 285 | /// This notifies the checkers about pointer escape, which occurs whenever |
Anna Zaks | 9747feb | 2012-12-21 01:50:14 +0000 | [diff] [blame] | 286 | /// the analyzer cannot track the symbol any more. For example, as a |
Ted Kremenek | 3a0678e | 2015-09-08 03:50:52 +0000 | [diff] [blame] | 287 | /// result of assigning a pointer into a global or when it's passed to a |
Anna Zaks | dc15415 | 2012-12-20 00:38:25 +0000 | [diff] [blame] | 288 | /// function call the analyzer cannot model. |
Ted Kremenek | 3a0678e | 2015-09-08 03:50:52 +0000 | [diff] [blame] | 289 | /// |
Anna Zaks | dc15415 | 2012-12-20 00:38:25 +0000 | [diff] [blame] | 290 | /// \param State The state at the point of escape. |
| 291 | /// \param Escaped The list of escaped symbols. |
Ted Kremenek | 3a0678e | 2015-09-08 03:50:52 +0000 | [diff] [blame] | 292 | /// \param Call The corresponding CallEvent, if the symbols escape as |
Anna Zaks | dc15415 | 2012-12-20 00:38:25 +0000 | [diff] [blame] | 293 | /// parameters to the given call. |
Anna Zaks | acdc13c | 2013-02-07 23:05:43 +0000 | [diff] [blame] | 294 | /// \param Kind How the symbols have escaped. |
Anna Zaks | dc15415 | 2012-12-20 00:38:25 +0000 | [diff] [blame] | 295 | /// \returns Checkers can modify the state by returning a new state. |
| 296 | ProgramStateRef checkPointerEscape(ProgramStateRef State, |
| 297 | const InvalidatedSymbols &Escaped, |
Anna Zaks | acdc13c | 2013-02-07 23:05:43 +0000 | [diff] [blame] | 298 | const CallEvent *Call, |
| 299 | PointerEscapeKind Kind) const { |
Anna Zaks | dc15415 | 2012-12-20 00:38:25 +0000 | [diff] [blame] | 300 | return State; |
| 301 | } |
| 302 | |
Anna Zaks | 4b04e66 | 2013-03-28 23:15:32 +0000 | [diff] [blame] | 303 | /// \brief Called when const pointers escape. |
| 304 | /// |
| 305 | /// Note: in most cases checkPointerEscape callback is sufficient. |
| 306 | /// \sa checkPointerEscape |
| 307 | ProgramStateRef checkConstPointerEscape(ProgramStateRef State, |
| 308 | const InvalidatedSymbols &Escaped, |
| 309 | const CallEvent *Call, |
| 310 | PointerEscapeKind Kind) const { |
| 311 | return State; |
| 312 | } |
Ted Kremenek | 3a0678e | 2015-09-08 03:50:52 +0000 | [diff] [blame] | 313 | |
Anna Zaks | 92297f9 | 2011-11-30 17:12:52 +0000 | [diff] [blame] | 314 | /// check::Event<ImplicitNullDerefEvent> |
| 315 | void checkEvent(ImplicitNullDerefEvent Event) const {} |
| 316 | |
| 317 | /// \brief Check every declaration in the AST. |
| 318 | /// |
| 319 | /// An AST traversal callback, which should only be used when the checker is |
| 320 | /// not path sensitive. It will be called for every Declaration in the AST and |
| 321 | /// can be specialized to only be called on subclasses of Decl, for example, |
| 322 | /// FunctionDecl. |
| 323 | /// |
| 324 | /// check::ASTDecl<FunctionDecl> |
| 325 | void checkASTDecl(const FunctionDecl *D, |
| 326 | AnalysisManager &Mgr, |
| 327 | BugReporter &BR) const {} |
Anna Zaks | 92297f9 | 2011-11-30 17:12:52 +0000 | [diff] [blame] | 328 | }; |
| 329 | |
Jordan Rose | 4080b0c | 2012-11-02 23:49:33 +0000 | [diff] [blame] | 330 | void CheckerDocumentation::checkPostStmt(const DeclStmt *DS, |
Anna Zaks | 92297f9 | 2011-11-30 17:12:52 +0000 | [diff] [blame] | 331 | CheckerContext &C) const { |
Anna Zaks | 92297f9 | 2011-11-30 17:12:52 +0000 | [diff] [blame] | 332 | } |
| 333 | |
Jordan Rose | f684db6 | 2012-11-07 02:35:02 +0000 | [diff] [blame] | 334 | } // end namespace ento |
| 335 | } // end namespace clang |