Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(263)

Side by Side Diff: tools/clang/plugins/ChromeClassTester.h

Issue 150943005: Add a check to the FindBadConstructs.cpp clang plugin for bad enum last values. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: 500s Created 6 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | tools/clang/plugins/ChromeClassTester.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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_
OLDNEW
« no previous file with comments | « no previous file | tools/clang/plugins/ChromeClassTester.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698