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); | 20 bool check_inner_classes, |
| 21 bool check_cc_directory); |
21 virtual ~ChromeClassTester(); | 22 virtual ~ChromeClassTester(); |
22 | 23 |
23 // clang::ASTConsumer: | 24 // clang::ASTConsumer: |
24 virtual void HandleTagDeclDefinition(clang::TagDecl* tag); | 25 virtual void HandleTagDeclDefinition(clang::TagDecl* tag); |
25 virtual bool HandleTopLevelDecl(clang::DeclGroupRef group_ref); | 26 virtual bool HandleTopLevelDecl(clang::DeclGroupRef group_ref); |
26 | 27 |
27 protected: | 28 protected: |
28 clang::CompilerInstance& instance() { return instance_; } | 29 clang::CompilerInstance& instance() { return instance_; } |
29 clang::DiagnosticsEngine& diagnostic() { return diagnostic_; } | 30 clang::DiagnosticsEngine& diagnostic() { return diagnostic_; } |
30 | 31 |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
76 std::vector<std::string> banned_directories_; | 77 std::vector<std::string> banned_directories_; |
77 | 78 |
78 // List of types that we don't check. | 79 // List of types that we don't check. |
79 std::set<std::string> ignored_record_names_; | 80 std::set<std::string> ignored_record_names_; |
80 | 81 |
81 // List of decls to check once the current top-level decl is parsed. | 82 // List of decls to check once the current top-level decl is parsed. |
82 std::vector<clang::TagDecl*> pending_class_decls_; | 83 std::vector<clang::TagDecl*> pending_class_decls_; |
83 | 84 |
84 // TODO: Remove once all inner classes are cleaned up. | 85 // TODO: Remove once all inner classes are cleaned up. |
85 bool check_inner_classes_; | 86 bool check_inner_classes_; |
| 87 |
| 88 // TODO(jamesr): Remove once cc/ directory compiles without warnings. |
| 89 bool check_cc_directory_; |
86 }; | 90 }; |
87 | 91 |
88 #endif // TOOLS_CLANG_PLUGINS_CHROMECLASSTESTER_H_ | 92 #endif // TOOLS_CLANG_PLUGINS_CHROMECLASSTESTER_H_ |
OLD | NEW |