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

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

Issue 2325563005: s/Value/value/g for type trait value field in WebGLImageConversion.cpp (Closed)
Patch Set: Created 4 years, 3 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 626 matching lines...) Expand 10 before | Expand all | Expand 10 after
637 637
638 // Field, variable, and enum declarations ======== 638 // Field, variable, and enum declarations ========
639 // Given 639 // Given
640 // int x; 640 // int x;
641 // struct S { 641 // struct S {
642 // int y; 642 // int y;
643 // enum { VALUE }; 643 // enum { VALUE };
644 // }; 644 // };
645 // matches |x|, |y|, and |VALUE|. 645 // matches |x|, |y|, and |VALUE|.
646 auto field_decl_matcher = id("decl", fieldDecl(in_blink_namespace)); 646 auto field_decl_matcher = id("decl", fieldDecl(in_blink_namespace));
647 auto is_type_trait_value = 647 auto is_type_trait_value = varDecl(
648 varDecl(hasName("value"), hasStaticStorageDuration(), isPublic(), 648 hasStaticStorageDuration(), isPublic(),
649 hasType(isConstQualified()), hasType(type(anyOf( 649 anyOf(hasName("value"), hasName("Value")),
650 booleanType(), enumType()))), 650 hasType(type(anyOf(booleanType(), enumType()))),
651 unless(hasAncestor(recordDecl( 651 hasType(isConstQualified()),
652 has(cxxMethodDecl(isUserProvided(), isInstanceMethod())))))); 652 unless(hasAncestor(recordDecl(
653 has(cxxMethodDecl(isUserProvided(), isInstanceMethod()))))));
653 auto var_decl_matcher = 654 auto var_decl_matcher =
654 id("decl", varDecl(in_blink_namespace, unless(is_type_trait_value))); 655 id("decl", varDecl(in_blink_namespace, unless(is_type_trait_value)));
655 auto enum_member_decl_matcher = 656 auto enum_member_decl_matcher =
656 id("decl", enumConstantDecl(in_blink_namespace)); 657 id("decl", enumConstantDecl(in_blink_namespace));
657 658
658 FieldDeclRewriter field_decl_rewriter(&replacements); 659 FieldDeclRewriter field_decl_rewriter(&replacements);
659 match_finder.addMatcher(field_decl_matcher, &field_decl_rewriter); 660 match_finder.addMatcher(field_decl_matcher, &field_decl_rewriter);
660 661
661 VarDeclRewriter var_decl_rewriter(&replacements); 662 VarDeclRewriter var_decl_rewriter(&replacements);
662 match_finder.addMatcher(var_decl_matcher, &var_decl_rewriter); 663 match_finder.addMatcher(var_decl_matcher, &var_decl_rewriter);
(...skipping 269 matching lines...) Expand 10 before | Expand all | Expand 10 after
932 for (const auto& r : replacements) { 933 for (const auto& r : replacements) {
933 std::string replacement_text = r.getReplacementText().str(); 934 std::string replacement_text = r.getReplacementText().str();
934 std::replace(replacement_text.begin(), replacement_text.end(), '\n', '\0'); 935 std::replace(replacement_text.begin(), replacement_text.end(), '\n', '\0');
935 llvm::outs() << "r:::" << r.getFilePath() << ":::" << r.getOffset() 936 llvm::outs() << "r:::" << r.getFilePath() << ":::" << r.getOffset()
936 << ":::" << r.getLength() << ":::" << replacement_text << "\n"; 937 << ":::" << r.getLength() << ":::" << replacement_text << "\n";
937 } 938 }
938 llvm::outs() << "==== END EDITS ====\n"; 939 llvm::outs() << "==== END EDITS ====\n";
939 940
940 return 0; 941 return 0;
941 } 942 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698