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

Unified Diff: tools/clang/rewrite_to_chrome_style/RewriteToChromeStyle.cpp

Issue 2640283003: Look at canonical decl, when deciding whether to rename or not. (Closed)
Patch Set: Fixed handling of function template specializations. Created 3 years, 11 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 side-by-side diff with in-line comments
Download patch
Index: tools/clang/rewrite_to_chrome_style/RewriteToChromeStyle.cpp
diff --git a/tools/clang/rewrite_to_chrome_style/RewriteToChromeStyle.cpp b/tools/clang/rewrite_to_chrome_style/RewriteToChromeStyle.cpp
index 5a0d6442044677623a75f3be9a6d1df929becc8e..0efdd5cd0f4913942363e3249b9b1a04e30c564b 100644
--- a/tools/clang/rewrite_to_chrome_style/RewriteToChromeStyle.cpp
+++ b/tools/clang/rewrite_to_chrome_style/RewriteToChromeStyle.cpp
@@ -88,6 +88,13 @@ AST_MATCHER_P(clang::FunctionTemplateDecl,
return InnerMatcher.matches(*Node.getTemplatedDecl(), Finder, Builder);
}
+AST_MATCHER_P(clang::Decl,
+ hasCanonicalDecl,
+ clang::ast_matchers::internal::Matcher<clang::Decl>,
+ InnerMatcher) {
+ return InnerMatcher.matches(*Node.getCanonicalDecl(), Finder, Builder);
+}
+
// Matches a CXXMethodDecl of a method declared via MOCK_METHODx macro if such
// method mocks a method matched by the InnerMatcher. For example if "foo"
// matcher matches "interfaceMethod", then mocksMethod(foo()) will match
@@ -1439,7 +1446,7 @@ int main(int argc, const char* argv[]) {
auto in_blink_namespace = decl(
anyOf(decl_under_blink_namespace, decl_has_qualifier_to_blink_namespace,
hasAncestor(decl_has_qualifier_to_blink_namespace)),
- unless(isExpansionInFileMatching(kGeneratedFileRegex)));
+ unless(hasCanonicalDecl(isExpansionInFileMatching(kGeneratedFileRegex))));
Łukasz Anforowicz 2017/01/21 01:04:00 These are the only real changes from patchset #1.
// Field, variable, and enum declarations ========
// Given

Powered by Google App Engine
This is Rietveld 408576698