| 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 a268739ccd31eddba1b9f780e521fc96fd8e74d4..4df38c7974592eb7797478fff9e819950ec2864e 100644
|
| --- a/tools/clang/rewrite_to_chrome_style/RewriteToChromeStyle.cpp
|
| +++ b/tools/clang/rewrite_to_chrome_style/RewriteToChromeStyle.cpp
|
| @@ -43,7 +43,6 @@ namespace {
|
|
|
| const char kBlinkFieldPrefix[] = "m_";
|
| const char kBlinkStaticMemberPrefix[] = "s_";
|
| -const char kGeneratedFileRegex[] = "^gen/|/gen/";
|
|
|
| template <typename MatcherType, typename NodeType>
|
| bool IsMatching(const MatcherType& matcher,
|
| @@ -994,12 +993,19 @@ int main(int argc, const char* argv[]) {
|
| namespaceDecl(anyOf(hasName("blink"), hasName("WTF")),
|
| hasParent(translationUnitDecl()));
|
|
|
| + auto protocol_namespace_decl =
|
| + namespaceDecl(hasName("protocol"),
|
| + hasParent(namespaceDecl(hasName("blink"),
|
| + hasParent(translationUnitDecl()))));
|
| +
|
| // Given top-level compilation unit:
|
| // namespace WTF {
|
| // void foo() {}
|
| // }
|
| // matches |foo|.
|
| - auto decl_under_blink_namespace = decl(hasAncestor(blink_namespace_decl));
|
| + auto decl_under_blink_namespace =
|
| + decl(hasAncestor(blink_namespace_decl),
|
| + unless(hasAncestor(protocol_namespace_decl)));
|
|
|
| // Given top-level compilation unit:
|
| // void WTF::function() {}
|
| @@ -1011,8 +1017,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)));
|
| + hasAncestor(decl_has_qualifier_to_blink_namespace)));
|
|
|
| // Field, variable, and enum declarations ========
|
| // Given
|
|
|