diff options
author | Philip Herron <philip.herron@embecosm.com> | 2021-06-23 17:22:12 +0100 |
---|---|---|
committer | Philip Herron <philip.herron@embecosm.com> | 2021-06-24 12:36:08 +0100 |
commit | 92a434a33904608f5659cf7b5d4df3d2a99bd5bd (patch) | |
tree | 02daa3d23d04cb9c950b15d5a7a94f171e1241db /gcc/rust/backend/rust-compile-base.h | |
parent | 23e748d7a6855ce132299cfef9692ee9c681de59 (diff) | |
download | gcc-92a434a33904608f5659cf7b5d4df3d2a99bd5bd.zip gcc-92a434a33904608f5659cf7b5d4df3d2a99bd5bd.tar.gz gcc-92a434a33904608f5659cf7b5d4df3d2a99bd5bd.tar.bz2 |
Add support for nested functions
We missed that stmts in rust can be items like functions. This adds support
for resolution and compilation of nested functions. Rust allows nested
functions which are distinct to closures. Nested functions are not allowed
to encapsulate the enclosing scope so they can be extracted as normal functions.
Diffstat (limited to 'gcc/rust/backend/rust-compile-base.h')
-rw-r--r-- | gcc/rust/backend/rust-compile-base.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/gcc/rust/backend/rust-compile-base.h b/gcc/rust/backend/rust-compile-base.h index ed33515..c346af5 100644 --- a/gcc/rust/backend/rust-compile-base.h +++ b/gcc/rust/backend/rust-compile-base.h @@ -210,6 +210,9 @@ protected: void compile_function_body (Bfunction *fndecl, std::unique_ptr<HIR::BlockExpr> &function_body, bool has_return_type); + + bool compile_locals_for_block (Resolver::Rib &rib, Bfunction *fndecl, + std::vector<Bvariable *> &locals); }; } // namespace Compile |