From e2b761b13e6ccd3a7af4100183bb13e32b5b0da0 Mon Sep 17 00:00:00 2001 From: Philip Herron Date: Tue, 19 Jan 2021 15:48:51 +0000 Subject: Implement CompoundAssignmentExpressions This expands the AST::CompoundAssignmentExpr into and HIR::AssignmentExpr with the asignee being referenced for lhs and a new artificial HIR::ArithmeticOrLogicalExpression with lhs asignee and rhs the rhs of the original CompoundAssignment expr. --- gcc/rust/resolve/rust-ast-resolve-expr.h | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'gcc/rust/resolve') diff --git a/gcc/rust/resolve/rust-ast-resolve-expr.h b/gcc/rust/resolve/rust-ast-resolve-expr.h index 03b3496..229b26a 100644 --- a/gcc/rust/resolve/rust-ast-resolve-expr.h +++ b/gcc/rust/resolve/rust-ast-resolve-expr.h @@ -116,6 +116,12 @@ public: ResolveExpr::go (expr.get_right_expr ().get (), expr.get_node_id ()); } + void visit (AST::CompoundAssignmentExpr &expr) + { + ResolveExpr::go (expr.get_left_expr ().get (), expr.get_node_id ()); + ResolveExpr::go (expr.get_right_expr ().get (), expr.get_node_id ()); + } + void visit (AST::ComparisonExpr &expr) { ResolveExpr::go (expr.get_left_expr ().get (), expr.get_node_id ()); -- cgit v1.1