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 |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
48 private: | 48 private: |
49 void BuildBannedLists(); | 49 void BuildBannedLists(); |
50 | 50 |
51 void CheckTag(clang::TagDecl*); | 51 void CheckTag(clang::TagDecl*); |
52 | 52 |
53 // Filtered versions of tags that are only called with things defined in | 53 // Filtered versions of tags that are only called with things defined in |
54 // chrome header files. | 54 // chrome header files. |
55 virtual void CheckChromeClass(clang::SourceLocation record_location, | 55 virtual void CheckChromeClass(clang::SourceLocation record_location, |
56 clang::CXXRecordDecl* record) = 0; | 56 clang::CXXRecordDecl* record) = 0; |
57 | 57 |
| 58 // Filtered versions of enum type that are only called with things defined |
| 59 // in chrome header files. |
| 60 virtual void CheckChromeEnum(clang::SourceLocation enum_location, |
| 61 clang::EnumDecl* enum_decl) { |
| 62 } |
| 63 |
58 // Utility methods used for filtering out non-chrome classes (and ones we | 64 // Utility methods used for filtering out non-chrome classes (and ones we |
59 // deliberately ignore) in HandleTagDeclDefinition(). | 65 // deliberately ignore) in HandleTagDeclDefinition(). |
60 std::string GetNamespaceImpl(const clang::DeclContext* context, | 66 std::string GetNamespaceImpl(const clang::DeclContext* context, |
61 const std::string& candidate); | 67 const std::string& candidate); |
62 bool InBannedDirectory(clang::SourceLocation loc); | 68 bool InBannedDirectory(clang::SourceLocation loc); |
63 bool IsIgnoredType(const std::string& base_name); | 69 bool IsIgnoredType(const std::string& base_name); |
64 | 70 |
65 // Attempts to determine the filename for the given SourceLocation. | 71 // Attempts to determine the filename for the given SourceLocation. |
66 // Returns false if the filename could not be determined. | 72 // Returns false if the filename could not be determined. |
67 bool GetFilename(clang::SourceLocation loc, std::string* filename); | 73 bool GetFilename(clang::SourceLocation loc, std::string* filename); |
(...skipping 11 matching lines...) Expand all Loading... |
79 std::set<std::string> ignored_record_names_; | 85 std::set<std::string> ignored_record_names_; |
80 | 86 |
81 // List of decls to check once the current top-level decl is parsed. | 87 // List of decls to check once the current top-level decl is parsed. |
82 std::vector<clang::TagDecl*> pending_class_decls_; | 88 std::vector<clang::TagDecl*> pending_class_decls_; |
83 | 89 |
84 // TODO(tfarina): Remove once url/ directory compiles without warnings. | 90 // TODO(tfarina): Remove once url/ directory compiles without warnings. |
85 bool check_url_directory_; | 91 bool check_url_directory_; |
86 }; | 92 }; |
87 | 93 |
88 #endif // TOOLS_CLANG_PLUGINS_CHROMECLASSTESTER_H_ | 94 #endif // TOOLS_CLANG_PLUGINS_CHROMECLASSTESTER_H_ |
OLD | NEW |