[committed,030/103] gccrs: ast: dump: RangeExprs

Message ID 20230221120230.596966-31-arthur.cohen@embecosm.com
State Unresolved
Headers
Series [committed,001/103] gccrs: Fix missing dead code analysis ICE on local enum definition |

Checks

Context Check Description
snail/gcc-patch-check warning Git am fail log

Commit Message

Arthur Cohen Feb. 21, 2023, 12:01 p.m. UTC
  From: David Faust <david.faust@oracle.com>

gcc/rust/ChangeLog:

	* ast/rust-ast-dump.cc (Dump::visit): Add dump for RangeExprs.
---
 gcc/rust/ast/rust-ast-dump.cc | 31 +++++++++++++++++++++++++------
 1 file changed, 25 insertions(+), 6 deletions(-)
  

Patch

diff --git a/gcc/rust/ast/rust-ast-dump.cc b/gcc/rust/ast/rust-ast-dump.cc
index b9e08b59554..8caad987538 100644
--- a/gcc/rust/ast/rust-ast-dump.cc
+++ b/gcc/rust/ast/rust-ast-dump.cc
@@ -622,27 +622,46 @@  Dump::visit (BreakExpr &expr)
 
 void
 Dump::visit (RangeFromToExpr &expr)
-{}
+{
+  expr.get_from_expr ()->accept_vis (*this);
+  stream << "..";
+  expr.get_to_expr ()->accept_vis (*this);
+}
 
 void
 Dump::visit (RangeFromExpr &expr)
-{}
+{
+  expr.get_from_expr ()->accept_vis (*this);
+  stream << "..";
+}
 
 void
 Dump::visit (RangeToExpr &expr)
-{}
+{
+  stream << "..";
+  expr.get_to_expr ()->accept_vis (*this);
+}
 
 void
 Dump::visit (RangeFullExpr &expr)
-{}
+{
+  stream << "..";
+}
 
 void
 Dump::visit (RangeFromToInclExpr &expr)
-{}
+{
+  expr.get_from_expr ()->accept_vis (*this);
+  stream << "..=";
+  expr.get_to_expr ()->accept_vis (*this);
+}
 
 void
 Dump::visit (RangeToInclExpr &expr)
-{}
+{
+  stream << "..=";
+  expr.get_to_expr ()->accept_vis (*this);
+}
 
 void
 Dump::visit (ReturnExpr &expr)