| OLD | NEW |
| 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 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 71 cxxDependentScopeMemberExpr; | 71 cxxDependentScopeMemberExpr; |
| 72 | 72 |
| 73 AST_MATCHER(clang::FunctionDecl, isOverloadedOperator) { | 73 AST_MATCHER(clang::FunctionDecl, isOverloadedOperator) { |
| 74 return Node.isOverloadedOperator(); | 74 return Node.isOverloadedOperator(); |
| 75 } | 75 } |
| 76 | 76 |
| 77 AST_MATCHER(clang::CXXMethodDecl, isInstanceMethod) { | 77 AST_MATCHER(clang::CXXMethodDecl, isInstanceMethod) { |
| 78 return Node.isInstance(); | 78 return Node.isInstance(); |
| 79 } | 79 } |
| 80 | 80 |
| 81 // TODO(lukasza): Remove this matcher definition, after we pull | |
| 82 // https://reviews.llvm.org/D27207 (aka rL288366) from upstream clang. | |
| 83 AST_MATCHER_P(clang::Type, | |
| 84 hasUnqualifiedDesugaredType, | |
| 85 clang::ast_matchers::internal::Matcher<clang::Type>, | |
| 86 InnerMatcher) { | |
| 87 const clang::Type* desugaredType = Node.getUnqualifiedDesugaredType(); | |
| 88 return InnerMatcher.matches(*desugaredType, Finder, Builder); | |
| 89 } | |
| 90 | |
| 91 AST_MATCHER_P(clang::FunctionTemplateDecl, | 81 AST_MATCHER_P(clang::FunctionTemplateDecl, |
| 92 templatedDecl, | 82 templatedDecl, |
| 93 clang::ast_matchers::internal::Matcher<clang::FunctionDecl>, | 83 clang::ast_matchers::internal::Matcher<clang::FunctionDecl>, |
| 94 InnerMatcher) { | 84 InnerMatcher) { |
| 95 return InnerMatcher.matches(*Node.getTemplatedDecl(), Finder, Builder); | 85 return InnerMatcher.matches(*Node.getTemplatedDecl(), Finder, Builder); |
| 96 } | 86 } |
| 97 | 87 |
| 98 // If |InnerMatcher| matches |top|, then the returned matcher will match: | 88 // If |InnerMatcher| matches |top|, then the returned matcher will match: |
| 99 // - |top::function| | 89 // - |top::function| |
| 100 // - |top::Class::method| | 90 // - |top::Class::method| |
| (...skipping 1181 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1282 for (const auto& r : replacements) { | 1272 for (const auto& r : replacements) { |
| 1283 std::string replacement_text = r.getReplacementText().str(); | 1273 std::string replacement_text = r.getReplacementText().str(); |
| 1284 std::replace(replacement_text.begin(), replacement_text.end(), '\n', '\0'); | 1274 std::replace(replacement_text.begin(), replacement_text.end(), '\n', '\0'); |
| 1285 llvm::outs() << "r:::" << r.getFilePath() << ":::" << r.getOffset() | 1275 llvm::outs() << "r:::" << r.getFilePath() << ":::" << r.getOffset() |
| 1286 << ":::" << r.getLength() << ":::" << replacement_text << "\n"; | 1276 << ":::" << r.getLength() << ":::" << replacement_text << "\n"; |
| 1287 } | 1277 } |
| 1288 llvm::outs() << "==== END EDITS ====\n"; | 1278 llvm::outs() << "==== END EDITS ====\n"; |
| 1289 | 1279 |
| 1290 return 0; | 1280 return 0; |
| 1291 } | 1281 } |
| OLD | NEW |