From: Arthur Cohen <[email protected]>
Since this function is only used in a labels context, let's make it clearer.
gcc/rust/ChangeLog:
* backend/rust-compile-expr.cc (CompileExpr::visit): Call the new name.
(CompileExpr::lookup_temp_var): Rename it to...
(CompileExpr::lookup_label_temp_var): ...this.
* backend/rust-compile-expr.h: Likewise.
---
This change was merged into the gccrs repository and is posted here for
upstream visibility and potential drive-by review, as requested by GCC
release managers.
Each commit email contains a link to its details on github from where you can
find the Pull-Request and associated discussions.
Commit on github:
https://github.com/Rust-GCC/gccrs/commit/58e4887308341b0fc3f8e901880fdf611678a2fd
The commit has NOT been mentioned in any issue.
The commit has been mentioned in the following pull-request(s):
- https://github.com/Rust-GCC/gccrs/pull/4551
gcc/rust/backend/rust-compile-expr.cc | 4 ++--
gcc/rust/backend/rust-compile-expr.h | 2 +-
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/gcc/rust/backend/rust-compile-expr.cc
b/gcc/rust/backend/rust-compile-expr.cc
index 5dac2439c..36c088e8e 100644
--- a/gcc/rust/backend/rust-compile-expr.cc
+++ b/gcc/rust/backend/rust-compile-expr.cc
@@ -867,7 +867,7 @@ CompileExpr::visit (HIR::BreakExpr &expr)
if (expr.has_break_expr () && expr.has_label ())
{
HIR::Lifetime &label = expr.get_label ();
- auto tvar = lookup_temp_var (label.get_mappings ().get_nodeid ());
+ auto tvar = lookup_label_temp_var (label.get_mappings ().get_nodeid ());
tree value = CompileExpr::Compile (expr.get_expr (), ctx);
tree assign
= Backend::assignment_statement (tvar->get_tree (label.get_locus ()),
@@ -2811,7 +2811,7 @@ CompileExpr::lookup_label (NodeId to_be_resolved)
}
Bvariable *
-CompileExpr::lookup_temp_var (NodeId to_be_resolved)
+CompileExpr::lookup_label_temp_var (NodeId to_be_resolved)
{
// TODO: Not sure that this temp var should have been inserted in the Labels
// namespace? Why not values?
diff --git a/gcc/rust/backend/rust-compile-expr.h
b/gcc/rust/backend/rust-compile-expr.h
index 9d1238e12..63ada9f33 100644
--- a/gcc/rust/backend/rust-compile-expr.h
+++ b/gcc/rust/backend/rust-compile-expr.h
@@ -156,7 +156,7 @@ protected:
tree construct_block_label (HIR::BlockExpr &expr);
tree lookup_label (NodeId to_be_resolved);
- Bvariable *lookup_temp_var (NodeId to_be_resolved);
+ Bvariable *lookup_label_temp_var (NodeId to_be_resolved);
HirId resolve_nodeid (NodeId to_be_resolved, Resolver2_0::Namespace ns);
private:
--
2.54.0