diff options
author | Philip Herron <philip.herron@embecosm.com> | 2020-12-20 23:58:33 +0000 |
---|---|---|
committer | Philip Herron <herron.philip@googlemail.com> | 2020-12-23 14:47:34 +0000 |
commit | f701ad5352c7bc8dad53a1ee7f666c8365b35307 (patch) | |
tree | c31ad210626efa0fdfd6f0be109439a1429b003d /gcc/rust/resolve/rust-ast-resolve-expr.h | |
parent | aa2fbb5e48f6218035d7bde1336345cebf120d3e (diff) | |
download | gcc-f701ad5352c7bc8dad53a1ee7f666c8365b35307.zip gcc-f701ad5352c7bc8dad53a1ee7f666c8365b35307.tar.gz gcc-f701ad5352c7bc8dad53a1ee7f666c8365b35307.tar.bz2 |
This brings arrays back into the new framework. It resolves ArrayType
ArrayExpr, ArrayExprElems and ArrayIndexExpr. Still need to do
ArrayElemsCopied.
I expect there to be some changes to cleanup the rust-tyty-resolver
this code is to resolve all ribs within a scope but its getting a bit
hairy in there now.
Diffstat (limited to 'gcc/rust/resolve/rust-ast-resolve-expr.h')
-rw-r--r-- | gcc/rust/resolve/rust-ast-resolve-expr.h | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/gcc/rust/resolve/rust-ast-resolve-expr.h b/gcc/rust/resolve/rust-ast-resolve-expr.h index 3316b2a..54d33a8 100644 --- a/gcc/rust/resolve/rust-ast-resolve-expr.h +++ b/gcc/rust/resolve/rust-ast-resolve-expr.h @@ -129,6 +129,31 @@ public: void visit (AST::BlockExpr &expr); + void visit (AST::ArrayElemsValues &elems) + { + elems.iterate ([&] (AST::Expr *elem) mutable -> bool { + ResolveExpr::go (elem, elems.get_node_id ()); + return true; + }); + } + + void visit (AST::ArrayExpr &expr) + { + expr.get_array_elems ()->accept_vis (*this); + } + + void visit (AST::ArrayIndexExpr &expr) + { + ResolveExpr::go (expr.get_array_expr ().get (), expr.get_node_id ()); + ResolveExpr::go (expr.get_index_expr ().get (), expr.get_node_id ()); + } + + void visit (AST::ArrayElemsCopied &elems) + { + // TODO + gcc_unreachable (); + } + private: ResolveExpr (NodeId parent) : ResolverBase (parent) {} }; |