1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #ifndef TOOLS_BLINK_GC_PLUGIN_COLLECT_VISITOR_H_
6 #define TOOLS_BLINK_GC_PLUGIN_COLLECT_VISITOR_H_
10 #include "clang/AST/AST.h"
11 #include "clang/AST/RecursiveASTVisitor.h"
13 // This visitor collects the entry points for the checker.
14 class CollectVisitor
: public clang::RecursiveASTVisitor
<CollectVisitor
> {
16 typedef std::vector
<clang::CXXRecordDecl
*> RecordVector
;
17 typedef std::vector
<clang::CXXMethodDecl
*> MethodVector
;
21 RecordVector
& record_decls();
22 MethodVector
& trace_decls();
24 // Collect record declarations, including nested declarations.
25 bool VisitCXXRecordDecl(clang::CXXRecordDecl
* record
);
27 // Collect tracing method definitions, but don't traverse method bodies.
28 bool VisitCXXMethodDecl(clang::CXXMethodDecl
* method
);
31 RecordVector record_decls_
;
32 MethodVector trace_decls_
;
35 #endif // TOOLS_BLINK_GC_PLUGIN_COLLECT_VISITOR_H_