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

Side by Side Diff: tools/clang/rewrite_to_chrome_style/RewriteToChromeStyle.cpp

Issue 2032983002: base::Value cleanup: add simple Clang tool for structured cleanups (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: . Created 4 years, 6 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 unified diff | Download patch
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 // 4 //
5 // Changes Blink-style names to Chrome-style names. Currently transforms: 5 // Changes Blink-style names to Chrome-style names. Currently transforms:
6 // fields: 6 // fields:
7 // int m_operationCount => int operation_count_ 7 // int m_operationCount => int operation_count_
8 // variables (including parameters): 8 // variables (including parameters):
9 // int mySuperVariable => int my_super_variable 9 // int mySuperVariable => int my_super_variable
10 // constants: 10 // constants:
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
46 using clang::tooling::Replacements; 46 using clang::tooling::Replacements;
47 using llvm::StringRef; 47 using llvm::StringRef;
48 48
49 namespace { 49 namespace {
50 50
51 const char kBlinkFieldPrefix[] = "m_"; 51 const char kBlinkFieldPrefix[] = "m_";
52 const char kBlinkStaticMemberPrefix[] = "s_"; 52 const char kBlinkStaticMemberPrefix[] = "s_";
53 const char kGeneratedFileRegex[] = "^gen/|/gen/"; 53 const char kGeneratedFileRegex[] = "^gen/|/gen/";
54 54
55 const clang::ast_matchers::internal:: 55 const clang::ast_matchers::internal::
56 VariadicDynCastAllOfMatcher<clang::Expr, clang::UnresolvedLookupExpr>
57 unresolvedLookupExpr;
dcheng 2016/06/02 08:04:49 Somewhat of an unrelated cleanup, but I noticed th
58
59 const clang::ast_matchers::internal::
60 VariadicDynCastAllOfMatcher<clang::Expr, clang::UnresolvedMemberExpr> 56 VariadicDynCastAllOfMatcher<clang::Expr, clang::UnresolvedMemberExpr>
61 unresolvedMemberExpr; 57 unresolvedMemberExpr;
62 58
63 AST_MATCHER(clang::FunctionDecl, isOverloadedOperator) { 59 AST_MATCHER(clang::FunctionDecl, isOverloadedOperator) {
64 return Node.isOverloadedOperator(); 60 return Node.isOverloadedOperator();
65 } 61 }
66 62
67 AST_MATCHER_P(clang::FunctionTemplateDecl, 63 AST_MATCHER_P(clang::FunctionTemplateDecl,
68 templatedDecl, 64 templatedDecl,
69 clang::ast_matchers::internal::Matcher<clang::FunctionDecl>, 65 clang::ast_matchers::internal::Matcher<clang::FunctionDecl>,
(...skipping 814 matching lines...) Expand 10 before | Expand all | Expand 10 after
884 for (const auto& r : replacements) { 880 for (const auto& r : replacements) {
885 std::string replacement_text = r.getReplacementText().str(); 881 std::string replacement_text = r.getReplacementText().str();
886 std::replace(replacement_text.begin(), replacement_text.end(), '\n', '\0'); 882 std::replace(replacement_text.begin(), replacement_text.end(), '\n', '\0');
887 llvm::outs() << "r:::" << r.getFilePath() << ":::" << r.getOffset() 883 llvm::outs() << "r:::" << r.getFilePath() << ":::" << r.getOffset()
888 << ":::" << r.getLength() << ":::" << replacement_text << "\n"; 884 << ":::" << r.getLength() << ":::" << replacement_text << "\n";
889 } 885 }
890 llvm::outs() << "==== END EDITS ====\n"; 886 llvm::outs() << "==== END EDITS ====\n";
891 887
892 return 0; 888 return 0;
893 } 889 }
OLDNEW
« no previous file with comments | « no previous file | tools/clang/value_cleanup/CMakeLists.txt » ('j') | tools/clang/value_cleanup/ValueCleanup.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698