aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPhilip Herron <phil@nebuloninc.com>2020-05-16 20:41:30 +0100
committerPhilip Herron <philip.herron@embecosm.com>2020-11-28 19:12:31 +0000
commit2f3980d41667cfed6ee6560c16e90efa91cd24c6 (patch)
tree1a8a0394a2f9a0113e991d126bc6dfe1e777faba
parentd0a1fcccb5ddba4bff8acb6a219e1f7b2e96cec1 (diff)
downloadgcc-2f3980d41667cfed6ee6560c16e90efa91cd24c6.zip
gcc-2f3980d41667cfed6ee6560c16e90efa91cd24c6.tar.gz
gcc-2f3980d41667cfed6ee6560c16e90efa91cd24c6.tar.bz2
make ArithmeticOrLogicalExpr visitable
-rw-r--r--gcc/rust/analysis/rust-resolution.cc2
-rw-r--r--gcc/rust/ast/rust-expr.h4
2 files changed, 6 insertions, 0 deletions
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