diff options
author | Thomas Young <wenzhang5800@gmail.com> | 2021-06-27 01:01:11 +0800 |
---|---|---|
committer | Thomas Young <wenzhang5800@gmail.com> | 2021-06-27 01:19:12 +0800 |
commit | 5386fcdf20d8d9e769fb6ac8badfd39e8c9ebc91 (patch) | |
tree | a1ff18ce66fc2533ece21d6b52f2e94bb1ff1ada /gcc | |
parent | 348c893f9c56b1be8eeb1b843d239564567d00ee (diff) | |
download | gcc-5386fcdf20d8d9e769fb6ac8badfd39e8c9ebc91.zip gcc-5386fcdf20d8d9e769fb6ac8badfd39e8c9ebc91.tar.gz gcc-5386fcdf20d8d9e769fb6ac8badfd39e8c9ebc91.tar.bz2 |
mark live symbol in whilelet expr without test case
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/rust/hir/tree/rust-hir-expr.h | 2 | ||||
-rw-r--r-- | gcc/rust/lint/rust-lint-marklive.h | 6 |
2 files changed, 8 insertions, 0 deletions
diff --git a/gcc/rust/hir/tree/rust-hir-expr.h b/gcc/rust/hir/tree/rust-hir-expr.h index f718a61..28cb80b 100644 --- a/gcc/rust/hir/tree/rust-hir-expr.h +++ b/gcc/rust/hir/tree/rust-hir-expr.h @@ -3387,6 +3387,8 @@ public: void accept_vis (HIRVisitor &vis) override; + std::unique_ptr<Expr> &get_cond () { return condition; } + protected: /* Use covariance to implement clone function as returning this object rather * than base */ diff --git a/gcc/rust/lint/rust-lint-marklive.h b/gcc/rust/lint/rust-lint-marklive.h index 529d189..bd9107d 100644 --- a/gcc/rust/lint/rust-lint-marklive.h +++ b/gcc/rust/lint/rust-lint-marklive.h @@ -131,6 +131,12 @@ public: expr.get_expr ()->accept_vis (*this); } + void visit (HIR::WhileLetLoopExpr &expr) override + { + expr.get_loop_block ()->accept_vis (*this); + expr.get_cond ()->accept_vis (*this); + } + void visit (HIR::ExprStmtWithoutBlock &stmt) override { stmt.get_expr ()->accept_vis (*this); |