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

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

Issue 2749043004: Clang plugin: Support for Blink in web/. (Closed)
Patch Set: namespace approach Created 3 years, 8 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
« 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 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
45 enum class LocationType { 45 enum class LocationType {
46 // Enforce all default checks. 46 // Enforce all default checks.
47 kChrome, 47 kChrome,
48 // Enforces a subset of checks for Blink code. This is hopefully a 48 // Enforces a subset of checks for Blink code. This is hopefully a
49 // transitional stage, as more plugin checks are gradually enabled in Blink. 49 // transitional stage, as more plugin checks are gradually enabled in Blink.
50 kBlink, 50 kBlink,
51 // Skip all checks. Typically, this is third-party or generated code where 51 // Skip all checks. Typically, this is third-party or generated code where
52 // it doesn't make sense to enforce Chrome's custom diagnostics. 52 // it doesn't make sense to enforce Chrome's custom diagnostics.
53 kThirdParty, 53 kThirdParty,
54 }; 54 };
55 LocationType ClassifyLocation(clang::SourceLocation loc); 55 LocationType ClassifyLocation(clang::SourceLocation loc,
56 const clang::Decl* record);
56 57
57 // Utility method for subclasses to determine the namespace of the 58 // Utility method for subclasses to determine the namespace of the
58 // specified record, if any. Unnamed namespaces will be identified as 59 // specified record, if any. Unnamed namespaces will be identified as
59 // "<anonymous namespace>". 60 // "<anonymous namespace>".
60 std::string GetNamespace(const clang::Decl* record); 61 std::string GetNamespace(const clang::Decl* record);
61 62
62 // Utility method to check whether the given record has any of the ignored 63 // Utility method to check whether the given record has any of the ignored
63 // base classes. 64 // base classes.
64 bool HasIgnoredBases(const clang::CXXRecordDecl* record); 65 bool HasIgnoredBases(const clang::CXXRecordDecl* record);
65 66
(...skipping 28 matching lines...) Expand all
94 // Attempts to determine the filename for the given SourceLocation. 95 // Attempts to determine the filename for the given SourceLocation.
95 // Returns false if the filename could not be determined. 96 // Returns false if the filename could not be determined.
96 bool GetFilename(clang::SourceLocation loc, std::string* filename); 97 bool GetFilename(clang::SourceLocation loc, std::string* filename);
97 98
98 clang::CompilerInstance& instance_; 99 clang::CompilerInstance& instance_;
99 clang::DiagnosticsEngine& diagnostic_; 100 clang::DiagnosticsEngine& diagnostic_;
100 101
101 // List of banned namespaces. 102 // List of banned namespaces.
102 std::set<std::string> banned_namespaces_; 103 std::set<std::string> banned_namespaces_;
103 104
104 // List of Blink directories.
105 std::set<std::string> blink_directories_;
106
107 // List of banned directories. 105 // List of banned directories.
108 std::set<std::string> banned_directories_; 106 std::set<std::string> banned_directories_;
109 107
110 // List of types that we don't check. 108 // List of types that we don't check.
111 std::set<std::string> ignored_record_names_; 109 std::set<std::string> ignored_record_names_;
112 110
113 // List of base classes that we skip when checking complex class ctors/dtors. 111 // List of base classes that we skip when checking complex class ctors/dtors.
114 std::set<std::string> ignored_base_classes_; 112 std::set<std::string> ignored_base_classes_;
115 }; 113 };
116 114
117 #endif // TOOLS_CLANG_PLUGINS_CHROMECLASSTESTER_H_ 115 #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