summaryrefslogtreecommitdiffstats
path: root/tools/clang
diff options
context:
space:
mode:
authordanakj <danakj@chromium.org>2016-03-09 13:29:59 -0800
committerCommit bot <commit-bot@chromium.org>2016-03-09 21:31:35 +0000
commite27ff645c0bfb460855b825f08beda583d71a8e5 (patch)
treede5df32b1d6e0951972a18019e6eadde245cdd0d /tools/clang
parent64a09998a6930a0e32308b243f7c763c6ece758c (diff)
downloadchromium_src-e27ff645c0bfb460855b825f08beda583d71a8e5.zip
chromium_src-e27ff645c0bfb460855b825f08beda583d71a8e5.tar.gz
chromium_src-e27ff645c0bfb460855b825f08beda583d71a8e5.tar.bz2
rewrite_to_chrome_style: Exclude methods before checking IsBlinkOrWTF
The IsBlinkOrWTFMethod asserts that the method is not doing crazy overrides, but it will fire for destructors which we aren't trying to rename anyways. So exclude those before trying to see if we want to rename it. R=dcheng BUG=593446 Review URL: https://codereview.chromium.org/1778963003 Cr-Commit-Position: refs/heads/master@{#380228}
Diffstat (limited to 'tools/clang')
-rw-r--r--tools/clang/rewrite_to_chrome_style/RewriteToChromeStyle.cpp9
1 files changed, 6 insertions, 3 deletions
diff --git a/tools/clang/rewrite_to_chrome_style/RewriteToChromeStyle.cpp b/tools/clang/rewrite_to_chrome_style/RewriteToChromeStyle.cpp
index d0352ea..3d12b5f 100644
--- a/tools/clang/rewrite_to_chrome_style/RewriteToChromeStyle.cpp
+++ b/tools/clang/rewrite_to_chrome_style/RewriteToChromeStyle.cpp
@@ -640,8 +640,7 @@ int main(int argc, const char* argv[]) {
// matches |g|.
auto method_decl_matcher =
id("decl",
- cxxMethodDecl(isBlinkOrWTFMethod(),
- unless(anyOf(is_generated,
+ cxxMethodDecl(unless(anyOf(is_generated,
// Overloaded operators have special names
// and should never be renamed.
isOverloadedOperator(),
@@ -649,7 +648,11 @@ int main(int argc, const char* argv[]) {
// conversion functions should not be
// considered for renaming.
cxxConstructorDecl(), cxxDestructorDecl(),
- cxxConversionDecl()))));
+ cxxConversionDecl())),
+ // Check this last after excluding things, to avoid
+ // asserts about overriding non-blink and blink for the
+ // same method.
+ isBlinkOrWTFMethod()));
MethodDeclRewriter method_decl_rewriter(&replacements);
match_finder.addMatcher(method_decl_matcher, &method_decl_rewriter);