aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorThomas Young <wenzhang5800@gmail.com>2021-06-27 01:08:03 +0800
committerThomas Young <wenzhang5800@gmail.com>2021-06-27 01:19:12 +0800
commit5ff37842fb091ebc79d87b5e7770bc335f2a8591 (patch)
tree4377b51b6e97974561e71d148b73b31cc3fe3426 /gcc
parent5386fcdf20d8d9e769fb6ac8badfd39e8c9ebc91 (diff)
downloadgcc-5ff37842fb091ebc79d87b5e7770bc335f2a8591.zip
gcc-5ff37842fb091ebc79d87b5e7770bc335f2a8591.tar.gz
gcc-5ff37842fb091ebc79d87b5e7770bc335f2a8591.tar.bz2
mark live symbol in for expr without test case
Diffstat (limited to 'gcc')
-rw-r--r--gcc/rust/hir/tree/rust-hir-expr.h2
-rw-r--r--gcc/rust/lint/rust-lint-marklive.h6
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 28cb80b..681ccf8 100644
--- a/gcc/rust/hir/tree/rust-hir-expr.h
+++ b/gcc/rust/hir/tree/rust-hir-expr.h
@@ -3452,6 +3452,8 @@ public:
void accept_vis (HIRVisitor &vis) override;
+ std::unique_ptr<Expr> &get_iterator_expr () { return iterator_expr; }
+
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 bd9107d..d34587d 100644
--- a/gcc/rust/lint/rust-lint-marklive.h
+++ b/gcc/rust/lint/rust-lint-marklive.h
@@ -137,6 +137,12 @@ public:
expr.get_cond ()->accept_vis (*this);
}
+ void visit (HIR::ForLoopExpr &expr) override
+ {
+ expr.get_loop_block ()->accept_vis (*this);
+ expr.get_iterator_expr ()->accept_vis (*this);
+ }
+
void visit (HIR::ExprStmtWithoutBlock &stmt) override
{
stmt.get_expr ()->accept_vis (*this);