aboutsummaryrefslogtreecommitdiff
path: root/gcc/rust/backend
diff options
context:
space:
mode:
authorPhilip Herron <philip.herron@embecosm.com>2020-12-03 15:34:15 +0000
committerPhilip Herron <herron.philip@googlemail.com>2020-12-03 17:25:24 +0000
commit064c6e4815b212d72f008082939376f570897c19 (patch)
tree4090d53e54ea8565d9515b3668f432306a2ee697 /gcc/rust/backend
parent03fc0e389fae2576a7f217fb0afb7cb0f18689f8 (diff)
downloadgcc-064c6e4815b212d72f008082939376f570897c19.zip
gcc-064c6e4815b212d72f008082939376f570897c19.tar.gz
gcc-064c6e4815b212d72f008082939376f570897c19.tar.bz2
Type Resolve ReturnExpr's to ensure they match the function type.
This an implementation to check return types for functions it needs work to handle structs and other data structures later on.
Diffstat (limited to 'gcc/rust/backend')
-rw-r--r--gcc/rust/backend/rust-compile.cc6
1 files changed, 3 insertions, 3 deletions
diff --git a/gcc/rust/backend/rust-compile.cc b/gcc/rust/backend/rust-compile.cc
index 2dbce16..820f880 100644
--- a/gcc/rust/backend/rust-compile.cc
+++ b/gcc/rust/backend/rust-compile.cc
@@ -805,10 +805,10 @@ void
Compilation::visit (AST::ReturnExpr &expr)
{
Bexpression *ret = NULL;
- VISIT_POP (expr.return_expr->get_locus_slow (), expr.return_expr, ret, exprs);
+ VISIT_POP (expr.get_expr ()->get_locus_slow (), expr.get_expr (), ret, exprs);
if (ret == NULL)
{
- rust_fatal_error (expr.return_expr->get_locus_slow (),
+ rust_fatal_error (expr.get_expr ()->get_locus_slow (),
"failed to compile");
return;
}
@@ -816,7 +816,7 @@ Compilation::visit (AST::ReturnExpr &expr)
std::vector<Bexpression *> retstmts;
retstmts.push_back (ret);
auto s = backend->return_statement (scope.GetCurrentFndecl (), retstmts,
- expr.locus);
+ expr.get_locus ());
scope.AddStatement (s);
}