aboutsummaryrefslogtreecommitdiff
path: root/gcc/rust/backend/rust-compile-expr.h
diff options
context:
space:
mode:
authorPhilip Herron <philip.herron@embecosm.com>2021-01-18 14:51:36 +0000
committerPhilip Herron <herron.philip@googlemail.com>2021-01-20 09:59:22 +0000
commit9a942d6fbd0cc087cbc801ce4681a498e59dce2c (patch)
tree5198e76f054e741f5ba9793e111bfd63be88e80d /gcc/rust/backend/rust-compile-expr.h
parent89631998d2ffda0c0c05066c148c6fc19398da5c (diff)
downloadgcc-9a942d6fbd0cc087cbc801ce4681a498e59dce2c.zip
gcc-9a942d6fbd0cc087cbc801ce4681a498e59dce2c.tar.gz
gcc-9a942d6fbd0cc087cbc801ce4681a498e59dce2c.tar.bz2
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.
Diffstat (limited to 'gcc/rust/backend/rust-compile-expr.h')
-rw-r--r--gcc/rust/backend/rust-compile-expr.h19
1 files changed, 1 insertions, 18 deletions
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<Bexpression *> 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)
{