From 9a942d6fbd0cc087cbc801ce4681a498e59dce2c Mon Sep 17 00:00:00 2001 From: Philip Herron Date: Mon, 18 Jan 2021 14:51:36 +0000 Subject: Add in TupleStruct support This adds in tuple struct support with name and type resolution. The arguments and number of arguments are validated against. Test cases added for those errors too. --- gcc/rust/backend/rust-compile-expr.h | 19 +------------------ 1 file changed, 1 insertion(+), 18 deletions(-) (limited to 'gcc/rust/backend/rust-compile-expr.h') diff --git a/gcc/rust/backend/rust-compile-expr.h b/gcc/rust/backend/rust-compile-expr.h index 98e8ee1..8b99574 100644 --- a/gcc/rust/backend/rust-compile-expr.h +++ b/gcc/rust/backend/rust-compile-expr.h @@ -86,24 +86,7 @@ public: ctx->add_statement (s); } - void visit (HIR::CallExpr &expr) - { - Bexpression *fn = ResolvePathRef::Compile (expr.get_fnexpr (), ctx); - rust_assert (fn != nullptr); - - std::vector args; - expr.iterate_params ([&] (HIR::Expr *p) mutable -> bool { - Bexpression *compiled_expr = CompileExpr::Compile (p, ctx); - rust_assert (compiled_expr != nullptr); - args.push_back (compiled_expr); - return true; - }); - - auto fncontext = ctx->peek_fn (); - translated - = ctx->get_backend ()->call_expression (fncontext.fndecl, fn, args, - nullptr, expr.get_locus ()); - } + void visit (HIR::CallExpr &expr); void visit (HIR::IdentifierExpr &expr) { -- cgit v1.1