Chromium Code Reviews| 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 |