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 db208abc2f762e0a7848ddb5f3700cb21743c46f..73360705bcdd0aca0ca9185827a8cf72c4727188 100644 |
--- a/tools/clang/rewrite_to_chrome_style/RewriteToChromeStyle.cpp |
+++ b/tools/clang/rewrite_to_chrome_style/RewriteToChromeStyle.cpp |
@@ -60,6 +60,19 @@ bool GetNameForDecl(const clang::FunctionDecl& decl, |
const clang::ASTContext& context, |
std::string& name) { |
name = decl.getNameAsString(); |
+ |
+ if (const auto* method = clang::dyn_cast<const clang::CXXMethodDecl>(&decl)) { |
+ if (!method->isStatic()) { |
+ // Some methods shouldn't be renamed because reasons. |
+ static const std::string kBlacklist[] = {"begin", "end", "rbegin", |
dcheng
2016/01/28 06:58:12
Did you see trace() getting renamed to Trace() in
danakj
2016/01/28 19:47:58
fun:trace:Trace
Ya, I'll add it.
danakj
2016/01/28 19:47:58
Oh, sure, char* it is.
|
+ "rend"}; |
+ for (const auto& b : kBlacklist) { |
+ if (name == b) |
+ return false; |
+ } |
+ } |
+ } |
+ |
name[0] = clang::toUppercase(name[0]); |
return true; |
} |