OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef TOOLS_CLANG_PLUGINS_CHROMECLASSTESTER_H_ | 5 #ifndef TOOLS_CLANG_PLUGINS_CHROMECLASSTESTER_H_ |
6 #define TOOLS_CLANG_PLUGINS_CHROMECLASSTESTER_H_ | 6 #define TOOLS_CLANG_PLUGINS_CHROMECLASSTESTER_H_ |
7 | 7 |
8 #include <set> | 8 #include <set> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
11 #include "clang/AST/ASTConsumer.h" | 11 #include "clang/AST/ASTConsumer.h" |
12 #include "clang/AST/TypeLoc.h" | 12 #include "clang/AST/TypeLoc.h" |
13 #include "clang/Frontend/CompilerInstance.h" | 13 #include "clang/Frontend/CompilerInstance.h" |
14 | 14 |
15 // A class on top of ASTConsumer that forwards classes defined in Chromium | 15 // A class on top of ASTConsumer that forwards classes defined in Chromium |
16 // headers to subclasses which implement CheckChromeClass(). | 16 // headers to subclasses which implement CheckChromeClass(). |
17 class ChromeClassTester : public clang::ASTConsumer { | 17 class ChromeClassTester : public clang::ASTConsumer { |
18 public: | 18 public: |
19 explicit ChromeClassTester(clang::CompilerInstance& instance, | 19 explicit ChromeClassTester(clang::CompilerInstance& instance, |
20 bool check_inner_classes, | |
21 bool check_cc_directory); | 20 bool check_cc_directory); |
22 virtual ~ChromeClassTester(); | 21 virtual ~ChromeClassTester(); |
23 | 22 |
24 // clang::ASTConsumer: | 23 // clang::ASTConsumer: |
25 virtual void HandleTagDeclDefinition(clang::TagDecl* tag); | 24 virtual void HandleTagDeclDefinition(clang::TagDecl* tag); |
26 virtual bool HandleTopLevelDecl(clang::DeclGroupRef group_ref); | 25 virtual bool HandleTopLevelDecl(clang::DeclGroupRef group_ref); |
27 | 26 |
28 protected: | 27 protected: |
29 clang::CompilerInstance& instance() { return instance_; } | 28 clang::CompilerInstance& instance() { return instance_; } |
30 clang::DiagnosticsEngine& diagnostic() { return diagnostic_; } | 29 clang::DiagnosticsEngine& diagnostic() { return diagnostic_; } |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
75 | 74 |
76 // List of banned directories. | 75 // List of banned directories. |
77 std::vector<std::string> banned_directories_; | 76 std::vector<std::string> banned_directories_; |
78 | 77 |
79 // List of types that we don't check. | 78 // List of types that we don't check. |
80 std::set<std::string> ignored_record_names_; | 79 std::set<std::string> ignored_record_names_; |
81 | 80 |
82 // List of decls to check once the current top-level decl is parsed. | 81 // List of decls to check once the current top-level decl is parsed. |
83 std::vector<clang::TagDecl*> pending_class_decls_; | 82 std::vector<clang::TagDecl*> pending_class_decls_; |
84 | 83 |
85 // TODO: Remove once all inner classes are cleaned up. | |
86 bool check_inner_classes_; | |
87 | |
88 // TODO(jamesr): Remove once cc/ directory compiles without warnings. | 84 // TODO(jamesr): Remove once cc/ directory compiles without warnings. |
89 bool check_cc_directory_; | 85 bool check_cc_directory_; |
90 }; | 86 }; |
91 | 87 |
92 #endif // TOOLS_CLANG_PLUGINS_CHROMECLASSTESTER_H_ | 88 #endif // TOOLS_CLANG_PLUGINS_CHROMECLASSTESTER_H_ |
OLD | NEW |