[gcc r14-7595] gccrs: dump: Dump `TupleIndexExpr`s

Arthur Cohen cohenarthur@gcc.gnu.org
Tue Jan 16 17:43:41 GMT 2024


https://gcc.gnu.org/g:ec43b2ee8f4b92d073d562849022b90221c27f3e

commit r14-7595-gec43b2ee8f4b92d073d562849022b90221c27f3e
Author: Arthur Cohen <arthur.cohen@embecosm.com>
Date:   Fri May 12 14:44:54 2023 +0200

    gccrs: dump: Dump `TupleIndexExpr`s
    
    gcc/rust/ChangeLog:
    
            * ast/rust-ast-dump.cc (Dump::visit): Implement dump for
            `TupleIndexExpr`.

Diff:
---
 gcc/rust/ast/rust-ast-dump.cc | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/gcc/rust/ast/rust-ast-dump.cc b/gcc/rust/ast/rust-ast-dump.cc
index 78c6a083787..8db706920c0 100644
--- a/gcc/rust/ast/rust-ast-dump.cc
+++ b/gcc/rust/ast/rust-ast-dump.cc
@@ -782,8 +782,11 @@ Dump::visit (TupleExpr &)
 {}
 
 void
-Dump::visit (TupleIndexExpr &)
-{}
+Dump::visit (TupleIndexExpr &expr)
+{
+  visit (expr.get_tuple_expr ());
+  stream << '.' << expr.get_tuple_index ();
+}
 
 void
 Dump::visit (StructExprStruct &)


More information about the Gcc-cvs mailing list