| 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_url_directory); |
| 20 virtual ~ChromeClassTester(); | 21 virtual ~ChromeClassTester(); |
| 21 | 22 |
| 22 // clang::ASTConsumer: | 23 // clang::ASTConsumer: |
| 23 virtual void HandleTagDeclDefinition(clang::TagDecl* tag); | 24 virtual void HandleTagDeclDefinition(clang::TagDecl* tag); |
| 24 virtual bool HandleTopLevelDecl(clang::DeclGroupRef group_ref); | 25 virtual bool HandleTopLevelDecl(clang::DeclGroupRef group_ref); |
| 25 | 26 |
| 26 protected: | 27 protected: |
| 27 clang::CompilerInstance& instance() { return instance_; } | 28 clang::CompilerInstance& instance() { return instance_; } |
| 28 clang::DiagnosticsEngine& diagnostic() { return diagnostic_; } | 29 clang::DiagnosticsEngine& diagnostic() { return diagnostic_; } |
| 29 | 30 |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 72 std::vector<std::string> banned_namespaces_; | 73 std::vector<std::string> banned_namespaces_; |
| 73 | 74 |
| 74 // List of banned directories. | 75 // List of banned directories. |
| 75 std::vector<std::string> banned_directories_; | 76 std::vector<std::string> banned_directories_; |
| 76 | 77 |
| 77 // List of types that we don't check. | 78 // List of types that we don't check. |
| 78 std::set<std::string> ignored_record_names_; | 79 std::set<std::string> ignored_record_names_; |
| 79 | 80 |
| 80 // 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. |
| 81 std::vector<clang::TagDecl*> pending_class_decls_; | 82 std::vector<clang::TagDecl*> pending_class_decls_; |
| 83 |
| 84 // TODO(tfarina): Remove once url/ directory compiles without warnings. |
| 85 bool check_url_directory_; |
| 82 }; | 86 }; |
| 83 | 87 |
| 84 #endif // TOOLS_CLANG_PLUGINS_CHROMECLASSTESTER_H_ | 88 #endif // TOOLS_CLANG_PLUGINS_CHROMECLASSTESTER_H_ |
| OLD | NEW |