From 2f3980d41667cfed6ee6560c16e90efa91cd24c6 Mon Sep 17 00:00:00 2001 From: Philip Herron Date: Sat, 16 May 2020 20:41:30 +0100 Subject: make ArithmeticOrLogicalExpr visitable --- gcc/rust/analysis/rust-resolution.cc | 2 ++ gcc/rust/ast/rust-expr.h | 4 ++++ 2 files changed, 6 insertions(+) (limited to 'gcc') diff --git a/gcc/rust/analysis/rust-resolution.cc b/gcc/rust/analysis/rust-resolution.cc index 6cc47a2..24e1989 100644 --- a/gcc/rust/analysis/rust-resolution.cc +++ b/gcc/rust/analysis/rust-resolution.cc @@ -217,6 +217,8 @@ void TypeResolution::visit (AST::ArithmeticOrLogicalExpr &expr) { printf ("ArithmeticOrLogicalExpr: %s\n", expr.as_string ().c_str ()); + expr.visit_lhs (*this); + expr.visit_rhs (*this); } void diff --git a/gcc/rust/ast/rust-expr.h b/gcc/rust/ast/rust-expr.h index 2362904..7e5d43e 100644 --- a/gcc/rust/ast/rust-expr.h +++ b/gcc/rust/ast/rust-expr.h @@ -620,6 +620,10 @@ public: virtual void accept_vis (ASTVisitor &vis) OVERRIDE; + void visit_lhs (ASTVisitor &vis) { main_or_left_expr->accept_vis (vis); } + + void visit_rhs (ASTVisitor &vis) { right_expr->accept_vis (vis); } + protected: // Use covariance to implement clone function as returning this object rather // than base -- cgit v1.1