Skip to content

Commit a99e869

Browse files
Polygonalrphilberty
authored andcommitted
gccrs: Rename get_pattern_to_bind to get_subpattern
gcc/rust/ChangeLog: * ast/rust-ast-collector.cc: Rename get_pattern_to_bind to get_subpattern * ast/rust-ast-visitor.cc: Ditto. * ast/rust-pattern.h: Ditto. * expand/rust-cfg-strip.cc: Ditto. * hir/rust-ast-lower-pattern.cc: Ditto. Signed-off-by: Yap Zhi Heng <[email protected]>
1 parent 4083cae commit a99e869

File tree

5 files changed

+5
-6
lines changed

5 files changed

+5
-6
lines changed

gcc/rust/ast/rust-ast-collector.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2485,7 +2485,7 @@ TokenCollector::visit (IdentifierPattern &pattern)
24852485
if (pattern.has_subpattern ())
24862486
{
24872487
push (Rust::Token::make (PATTERN_BIND, UNDEF_LOCATION));
2488-
visit (pattern.get_pattern_to_bind ());
2488+
visit (pattern.get_subpattern ());
24892489
}
24902490
}
24912491

gcc/rust/ast/rust-ast-visitor.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1200,7 +1200,7 @@ void
12001200
DefaultASTVisitor::visit (AST::IdentifierPattern &pattern)
12011201
{
12021202
if (pattern.has_subpattern ())
1203-
visit (pattern.get_pattern_to_bind ());
1203+
visit (pattern.get_subpattern ());
12041204
}
12051205

12061206
void

gcc/rust/ast/rust-pattern.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -137,8 +137,7 @@ class IdentifierPattern : public Pattern
137137

138138
void accept_vis (ASTVisitor &vis) override;
139139

140-
// TODO: is this better? Or is a "vis_pattern" better?
141-
Pattern &get_pattern_to_bind ()
140+
Pattern &get_subpattern ()
142141
{
143142
rust_assert (has_subpattern ());
144143
return *subpattern;

gcc/rust/expand/rust-cfg-strip.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2267,7 +2267,7 @@ CfgStrip::visit (AST::IdentifierPattern &pattern)
22672267

22682268
AST::DefaultASTVisitor::visit (pattern);
22692269

2270-
auto &sub_pattern = pattern.get_pattern_to_bind ();
2270+
auto &sub_pattern = pattern.get_subpattern ();
22712271
if (sub_pattern.is_marked_for_strip ())
22722272
rust_error_at (sub_pattern.get_locus (),
22732273
"cannot strip pattern in this position");

gcc/rust/hir/rust-ast-lower-pattern.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ ASTLoweringPattern::visit (AST::IdentifierPattern &pattern)
5353
if (pattern.has_subpattern ())
5454
{
5555
subpattern = std::unique_ptr<Pattern> (
56-
ASTLoweringPattern::translate (pattern.get_pattern_to_bind ()));
56+
ASTLoweringPattern::translate (pattern.get_subpattern ()));
5757
}
5858
translated
5959
= new HIR::IdentifierPattern (mapping, pattern.get_ident (),

0 commit comments

Comments
 (0)