Chromium Code Reviews| 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 "Options.h" | 11 #include "Options.h" |
| 12 #include "clang/AST/ASTConsumer.h" | 12 #include "clang/AST/ASTConsumer.h" |
| 13 #include "clang/AST/TypeLoc.h" | 13 #include "clang/AST/TypeLoc.h" |
| 14 #include "clang/Frontend/CompilerInstance.h" | 14 #include "clang/Frontend/CompilerInstance.h" |
| 15 | 15 |
| 16 // A class on top of ASTConsumer that forwards classes defined in Chromium | 16 // A class on top of ASTConsumer that forwards classes defined in Chromium |
| 17 // headers to subclasses which implement CheckChromeClass(). | 17 // headers to subclasses which implement CheckChromeClass(). |
| 18 // TODO(vmpstr): Remove the clang::ASTConsumer base and fold this class into | |
|
dcheng
2016/02/16 23:03:50
Can we just remove the base class now?
vmpstr
2016/02/16 23:13:27
Yep! Done.
| |
| 19 // FindBadConstructsConsumer. | |
| 18 class ChromeClassTester : public clang::ASTConsumer { | 20 class ChromeClassTester : public clang::ASTConsumer { |
| 19 public: | 21 public: |
| 20 ChromeClassTester(clang::CompilerInstance& instance, | 22 ChromeClassTester(clang::CompilerInstance& instance, |
| 21 const chrome_checker::Options& options); | 23 const chrome_checker::Options& options); |
| 22 virtual ~ChromeClassTester(); | 24 virtual ~ChromeClassTester(); |
| 23 | 25 |
| 24 // clang::ASTConsumer: | 26 // clang::ASTConsumer: |
| 25 virtual void HandleTagDeclDefinition(clang::TagDecl* tag); | 27 virtual void HandleTagDeclDefinition(clang::TagDecl* tag); |
| 26 virtual bool HandleTopLevelDecl(clang::DeclGroupRef group_ref); | 28 virtual bool HandleTopLevelDecl(clang::DeclGroupRef group_ref); |
| 27 | 29 |
| (...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 95 std::set<std::string> banned_directories_; | 97 std::set<std::string> banned_directories_; |
| 96 | 98 |
| 97 // List of types that we don't check. | 99 // List of types that we don't check. |
| 98 std::set<std::string> ignored_record_names_; | 100 std::set<std::string> ignored_record_names_; |
| 99 | 101 |
| 100 // List of decls to check once the current top-level decl is parsed. | 102 // List of decls to check once the current top-level decl is parsed. |
| 101 std::vector<clang::TagDecl*> pending_class_decls_; | 103 std::vector<clang::TagDecl*> pending_class_decls_; |
| 102 }; | 104 }; |
| 103 | 105 |
| 104 #endif // TOOLS_CLANG_PLUGINS_CHROMECLASSTESTER_H_ | 106 #endif // TOOLS_CLANG_PLUGINS_CHROMECLASSTESTER_H_ |
| OLD | NEW |