diff options
author | Arthur Cohen <arthur.cohen@embecosm.com> | 2025-07-21 10:12:13 +0200 |
---|---|---|
committer | Arthur Cohen <arthur.cohen@embecosm.com> | 2025-08-05 16:36:57 +0200 |
commit | d8224f0222d8b6d99d98fe5038183f6d369ce286 (patch) | |
tree | 6bf6e01f903af6d5ee46899711590967b8a6b9cb | |
parent | 5594047290c1499fd468ec74a8d7759ecd853f91 (diff) | |
download | gcc-d8224f0222d8b6d99d98fe5038183f6d369ce286.zip gcc-d8224f0222d8b6d99d98fe5038183f6d369ce286.tar.gz gcc-d8224f0222d8b6d99d98fe5038183f6d369ce286.tar.bz2 |
gccrs: ast: Visit block labels if they are present
gcc/rust/ChangeLog:
* ast/rust-ast-visitor.cc (DefaultASTVisitor::visit): Visit a block's loop label if it
exists.
-rw-r--r-- | gcc/rust/ast/rust-ast-visitor.cc | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/gcc/rust/ast/rust-ast-visitor.cc b/gcc/rust/ast/rust-ast-visitor.cc index 32d5d32..7be2ecc 100644 --- a/gcc/rust/ast/rust-ast-visitor.cc +++ b/gcc/rust/ast/rust-ast-visitor.cc @@ -449,8 +449,13 @@ DefaultASTVisitor::visit (AST::BlockExpr &expr) { visit_outer_attrs (expr); visit_inner_attrs (expr); + + if (expr.has_label ()) + visit (expr.get_label ()); + for (auto &stmt : expr.get_statements ()) visit (stmt); + if (expr.has_tail_expr ()) visit (expr.get_tail_expr ()); } |