aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorDavid Faust <david.faust@oracle.com>2022-10-13 10:14:38 -0700
committerArthur Cohen <arthur.cohen@embecosm.com>2023-02-21 12:36:34 +0100
commitf26e9ca3e9aa9ba9c03b3e76a0ced8350d8a7b69 (patch)
treed19080bafed2b066495bd43a0926d27993e98d5e /gcc
parentc091fd5f4a2da1d52ae70281e94bc089f706d7b8 (diff)
downloadgcc-f26e9ca3e9aa9ba9c03b3e76a0ced8350d8a7b69.zip
gcc-f26e9ca3e9aa9ba9c03b3e76a0ced8350d8a7b69.tar.gz
gcc-f26e9ca3e9aa9ba9c03b3e76a0ced8350d8a7b69.tar.bz2
gccrs: ast: dump: ArrayExpr
gcc/rust/ChangeLog: * ast/rust-ast-dump.cc (Dump::visit): Add dump code for ArrayExpr.
Diffstat (limited to 'gcc')
-rw-r--r--gcc/rust/ast/rust-ast-dump.cc32
1 files changed, 28 insertions, 4 deletions
diff --git a/gcc/rust/ast/rust-ast-dump.cc b/gcc/rust/ast/rust-ast-dump.cc
index ddc43b3..91e540a 100644
--- a/gcc/rust/ast/rust-ast-dump.cc
+++ b/gcc/rust/ast/rust-ast-dump.cc
@@ -449,19 +449,43 @@ Dump::visit (GroupedExpr &expr)
void
Dump::visit (ArrayElemsValues &elems)
-{}
+{
+ auto &vals = elems.get_values ();
+ if (vals.size () >= 1)
+ {
+ vals[0]->accept_vis (*this);
+ for (size_t i = 1; i < vals.size (); i++)
+ {
+ stream << ", ";
+ vals[i]->accept_vis (*this);
+ }
+ }
+}
void
Dump::visit (ArrayElemsCopied &elems)
-{}
+{
+ elems.get_elem_to_copy ()->accept_vis (*this);
+ stream << "; ";
+ elems.get_num_copies ()->accept_vis (*this);
+}
void
Dump::visit (ArrayExpr &expr)
-{}
+{
+ stream << '[';
+ expr.get_array_elems ()->accept_vis (*this);
+ stream << ']';
+}
void
Dump::visit (ArrayIndexExpr &expr)
-{}
+{
+ expr.get_array_expr ()->accept_vis (*this);
+ stream << '[';
+ expr.get_index_expr ()->accept_vis (*this);
+ stream << ']';
+}
void
Dump::visit (TupleExpr &expr)