aboutsummaryrefslogtreecommitdiff
path: root/gcc/rust/ast/rust-macro.h
diff options
context:
space:
mode:
authorMatthew Jasper <mjjasper1@gmail.com>2023-05-09 12:53:33 +0100
committerArthur Cohen <arthur.cohen@embecosm.com>2024-01-16 18:37:18 +0100
commit9e9ee593cf0507e5b54a556737909a46c6e91319 (patch)
tree69088e01eb6d0a6421cb80f76f7302daf28b7b99 /gcc/rust/ast/rust-macro.h
parent2aeff9ce08576ad33a29ed6fc6a87e9516b0641f (diff)
downloadgcc-9e9ee593cf0507e5b54a556737909a46c6e91319.zip
gcc-9e9ee593cf0507e5b54a556737909a46c6e91319.tar.gz
gcc-9e9ee593cf0507e5b54a556737909a46c6e91319.tar.bz2
gccrs: ast: Remove ExprStmtWithBlock / ExprStmtWithoutBlock distinction
This distinction isn't very helpful and makes correct parsing harder. gcc/rust/ChangeLog: * ast/rust-ast-full-decls.h (class ExprStmtWithoutBlock): Remove. (class ExprStmtWithBlock): Remove. * ast/rust-stmt.h (class ExprStmtWithoutBlock): Remove. (class ExprStmtWithBlock): Remove. (class ExprStmt): Make non-abstract, add common functionality from removed base classes. * ast/rust-ast.h: Move to_stmt to base class. * ast/rust-ast.cc (ExprStmtWithBlock::as_string): Remove. * ast/rust-macro.h: Use new signature for to_stmt. (ExprStmt::as_string): New method. (ExprStmtWithoutBlock::as_string): Remove. (BlockExpr::strip_tail_expr): Update for removed classes. (ExprStmtWithoutBlock::accept_vis): Remove. (ExprStmtWithBlock::accept_vis): Remove. (ExprStmt::accept_vis): New method. * ast/rust-ast-dump.cc (Dump::visit): Update for removed classes. * ast/rust-ast-dump.h: Likewise. * ast/rust-ast-collector.h: Likewise. * ast/rust-ast-collector.cc (TokenStream::visit): Likewise. * ast/rust-ast-visitor.h: Likewise. * checks/errors/rust-feature-gate.h: Likewise. * expand/rust-expand-visitor.cc (ExpandVisitor::visit): Likewise. * expand/rust-expand-visitor.h: Likewise. * expand/rust-cfg-strip.cc (CfgStrip::visit): Likewise. * expand/rust-cfg-strip.h: Likewise. * hir/rust-ast-lower-base.cc (ASTLoweringBase::visit): Likewise. * hir/rust-ast-lower-base.h: Likewise. * hir/rust-ast-lower-stmt.cc (ASTLoweringStmt::visit): Likewise. * hir/rust-ast-lower-stmt.h: Likewise. * util/rust-attributes.cc (AttributeChecker::visit): Likewise. * util/rust-attributes.h: Likewise. * resolve/rust-ast-resolve-base.cc (ResolverBase::visit): Likewise. * resolve/rust-ast-resolve-base.h: Likewise. * resolve/rust-ast-resolve-stmt.h: Likewise. * resolve/rust-early-name-resolver.cc (EarlyNameResolver::visit): Likewise. * resolve/rust-early-name-resolver.h: Likewise. * parse/rust-parse-impl.h (Parser::parse_match_expr): Likewise. (Parser::parse_stmt_or_expr_without_block): Likewise. * parse/rust-parse.h: Likewise. Signed-off-by: Matthew Jasper <mjjasper1@gmail.com>
Diffstat (limited to 'gcc/rust/ast/rust-macro.h')
-rw-r--r--gcc/rust/ast/rust-macro.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/gcc/rust/ast/rust-macro.h b/gcc/rust/ast/rust-macro.h
index b6349a7..c7472de 100644
--- a/gcc/rust/ast/rust-macro.h
+++ b/gcc/rust/ast/rust-macro.h
@@ -802,7 +802,7 @@ protected:
return clone_macro_invocation_impl ();
}
- ExprWithoutBlock *to_stmt () const override
+ Expr *to_stmt () const override
{
auto new_impl = clone_macro_invocation_impl ();