@@ -33,30 +33,36 @@ namespace ento {
33
33
// / checking.
34
34
// /
35
35
// / \sa CheckerContext
36
- class CheckerDocumentation : public Checker < check::PreStmt<ReturnStmt>,
37
- check::PostStmt<DeclStmt>,
38
- check::PreObjCMessage,
39
- check::PostObjCMessage,
40
- check::ObjCMessageNil,
41
- check::PreCall,
42
- check::PostCall,
43
- check::BranchCondition,
44
- check::NewAllocator,
45
- check::Location,
46
- check::Bind,
47
- check::DeadSymbols,
48
- check::BeginFunction,
49
- check::EndFunction,
50
- check::EndAnalysis,
51
- check::EndOfTranslationUnit,
52
- eval::Call,
53
- eval::Assume,
54
- check::LiveSymbols,
55
- check::RegionChanges,
56
- check::PointerEscape,
57
- check::ConstPointerEscape,
58
- check::Event<ImplicitNullDerefEvent>,
59
- check::ASTDecl<FunctionDecl> > {
36
+ class CheckerDocumentation
37
+ : public Checker<
38
+ // clang-format off
39
+ check::ASTCodeBody,
40
+ check::ASTDecl<FunctionDecl>,
41
+ check::BeginFunction,
42
+ check::Bind,
43
+ check::BranchCondition,
44
+ check::ConstPointerEscape,
45
+ check::DeadSymbols,
46
+ check::EndAnalysis,
47
+ check::EndFunction,
48
+ check::EndOfTranslationUnit,
49
+ check::Event<ImplicitNullDerefEvent>,
50
+ check::LiveSymbols,
51
+ check::Location,
52
+ check::NewAllocator,
53
+ check::ObjCMessageNil,
54
+ check::PointerEscape,
55
+ check::PostCall,
56
+ check::PostObjCMessage,
57
+ check::PostStmt<DeclStmt>,
58
+ check::PreCall,
59
+ check::PreObjCMessage,
60
+ check::PreStmt<ReturnStmt>,
61
+ check::RegionChanges,
62
+ eval::Assume,
63
+ eval::Call
64
+ // clang-format on
65
+ > {
60
66
public:
61
67
// / Pre-visit the Statement.
62
68
// /
@@ -321,6 +327,13 @@ class CheckerDocumentation : public Checker< check::PreStmt<ReturnStmt>,
321
327
void checkASTDecl (const FunctionDecl *D,
322
328
AnalysisManager &Mgr,
323
329
BugReporter &BR) const {}
330
+
331
+ // / Check every declaration that has a statement body in the AST.
332
+ // /
333
+ // / As AST traversal callback, which should only be used when the checker is
334
+ // / not path sensitive. It will be called for every Declaration in the AST.
335
+ void checkASTCodeBody (const Decl *D, AnalysisManager &Mgr,
336
+ BugReporter &BR) const {}
324
337
};
325
338
326
339
void CheckerDocumentation::checkPostStmt (const DeclStmt *DS,
0 commit comments