aboutsummaryrefslogtreecommitdiff
path: root/gcc/rust/backend/rust-compile-expr.h
diff options
context:
space:
mode:
authorPhilip Herron <philip.herron@embecosm.com>2022-10-19 18:02:36 +0100
committerPhilip Herron <philip.herron@embecosm.com>2022-10-20 16:10:15 +0100
commit678bf852435aca6de25704ca417fab257fe03da9 (patch)
tree7eb78257e1d85eb7f2086e06867091f71a22cc34 /gcc/rust/backend/rust-compile-expr.h
parentfeaa40602b7ecad36de8dcb6c387e686d04ce207 (diff)
downloadgcc-678bf852435aca6de25704ca417fab257fe03da9.zip
gcc-678bf852435aca6de25704ca417fab257fe03da9.tar.gz
gcc-678bf852435aca6de25704ca417fab257fe03da9.tar.bz2
Closure support at CallExpr
Closures's need to generate their specific function and setup their argument passing based on the signiture specified in libcore. We can get this information based on the specified bound on the closure. Addresses #195
Diffstat (limited to 'gcc/rust/backend/rust-compile-expr.h')
-rw-r--r--gcc/rust/backend/rust-compile-expr.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/gcc/rust/backend/rust-compile-expr.h b/gcc/rust/backend/rust-compile-expr.h
index fee2ba7..6938c93 100644
--- a/gcc/rust/backend/rust-compile-expr.h
+++ b/gcc/rust/backend/rust-compile-expr.h
@@ -142,6 +142,16 @@ protected:
const TyTy::ArrayType &array_tyty, tree array_type,
HIR::ArrayElemsCopied &elems);
+protected:
+ tree generate_closure_function (HIR::ClosureExpr &expr,
+ TyTy::ClosureType &closure_tyty,
+ tree compiled_closure_tyty);
+
+ tree generate_closure_fntype (HIR::ClosureExpr &expr,
+ const TyTy::ClosureType &closure_tyty,
+ tree compiled_closure_tyty,
+ TyTy::FnType **fn_tyty);
+
private:
CompileExpr (Context *ctx);