aboutsummaryrefslogtreecommitdiff
path: root/gcc/rust/ast/rust-ast-builder.h
diff options
context:
space:
mode:
authorArthur Cohen <arthur.cohen@embecosm.com>2025-01-30 14:56:37 +0100
committerCohenArthur <arthur.cohen@embecosm.com>2025-02-20 09:37:09 +0000
commitf85babd713a141b850eed3b595725ef8d63f3aeb (patch)
tree585c3f72773f9a626827b5d488b968ae7e6cc82e /gcc/rust/ast/rust-ast-builder.h
parente3cebdda0d57e28098dbcc11b45aef85f9c152ae (diff)
downloadgcc-f85babd713a141b850eed3b595725ef8d63f3aeb.zip
gcc-f85babd713a141b850eed3b595725ef8d63f3aeb.tar.gz
gcc-f85babd713a141b850eed3b595725ef8d63f3aeb.tar.bz2
ast-builder: Improve function generation.
gcc/rust/ChangeLog: * ast/rust-ast-builder.cc (Builder::block): Change return type. (Builder::loop): Use new APIs. * ast/rust-ast-builder.h: Change return type of block functions.
Diffstat (limited to 'gcc/rust/ast/rust-ast-builder.h')
-rw-r--r--gcc/rust/ast/rust-ast-builder.h12
1 files changed, 6 insertions, 6 deletions
diff --git a/gcc/rust/ast/rust-ast-builder.h b/gcc/rust/ast/rust-ast-builder.h
index 6e4dfb8..3436244 100644
--- a/gcc/rust/ast/rust-ast-builder.h
+++ b/gcc/rust/ast/rust-ast-builder.h
@@ -82,12 +82,12 @@ public:
std::unique_ptr<Expr> deref (std::unique_ptr<Expr> &&of) const;
/* Create a block with an optional tail expression */
- std::unique_ptr<Expr> block (std::vector<std::unique_ptr<Stmt>> &&stmts,
- std::unique_ptr<Expr> &&tail_expr
- = nullptr) const;
- std::unique_ptr<Expr> block (std::unique_ptr<Stmt> &&stmt,
- std::unique_ptr<Expr> &&tail_expr
- = nullptr) const;
+ std::unique_ptr<BlockExpr> block (std::vector<std::unique_ptr<Stmt>> &&stmts,
+ std::unique_ptr<Expr> &&tail_expr
+ = nullptr) const;
+ std::unique_ptr<BlockExpr> block (tl::optional<std::unique_ptr<Stmt>> &&stmt,
+ std::unique_ptr<Expr> &&tail_expr
+ = nullptr) const;
/* Create an early return expression with an optional expression */
std::unique_ptr<Expr> return_expr (std::unique_ptr<Expr> &&to_return