public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc r14-7689] gccrs: expand: Merge arguments into one
@ 2024-01-16 17:53 Arthur Cohen
  0 siblings, 0 replies; only message in thread
From: Arthur Cohen @ 2024-01-16 17:53 UTC (permalink / raw)
  To: gcc-cvs

https://gcc.gnu.org/g:13557769abc6f575fa9cd994849c20ccf60dda52

commit r14-7689-g13557769abc6f575fa9cd994849c20ccf60dda52
Author: Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
Date:   Mon Jun 19 14:01:13 2023 +0200

    gccrs: expand: Merge arguments into one
    
    The second argument could be derived from the first one, the second
    argument is hence useless as the first argument alone could be kept to
    access it's data.
    
    gcc/rust/ChangeLog:
    
            * expand/rust-expand-visitor.cc (ExpandVisitor::expand_inner_stmts):
            Remove second argument.
            (ExpandVisitor::visit): Remove argument from function call.
            * expand/rust-expand-visitor.h: Update function prototype.
    
    Signed-off-by: Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>

Diff:
---
 gcc/rust/expand/rust-expand-visitor.cc | 6 +++---
 gcc/rust/expand/rust-expand-visitor.h  | 3 +--
 2 files changed, 4 insertions(+), 5 deletions(-)

diff --git a/gcc/rust/expand/rust-expand-visitor.cc b/gcc/rust/expand/rust-expand-visitor.cc
index d79aeac440b..28ff3df3148 100644
--- a/gcc/rust/expand/rust-expand-visitor.cc
+++ b/gcc/rust/expand/rust-expand-visitor.cc
@@ -286,9 +286,9 @@ ExpandVisitor::expand_inner_items (
 }
 
 void
-ExpandVisitor::expand_inner_stmts (
-  AST::BlockExpr &expr, std::vector<std::unique_ptr<AST::Stmt>> &stmts)
+ExpandVisitor::expand_inner_stmts (AST::BlockExpr &expr)
 {
+  auto &stmts = expr.get_statements ();
   expander.push_context (MacroExpander::ContextType::STMT);
 
   for (auto it = stmts.begin (); it != stmts.end (); it++)
@@ -834,7 +834,7 @@ ExpandVisitor::visit (AST::ClosureExprInner &expr)
 void
 ExpandVisitor::visit (AST::BlockExpr &expr)
 {
-  expand_inner_stmts (expr, expr.get_statements ());
+  expand_inner_stmts (expr);
 
   expand_tail_expr (expr, expander);
   if (expr.has_tail_expr ())
diff --git a/gcc/rust/expand/rust-expand-visitor.h b/gcc/rust/expand/rust-expand-visitor.h
index e7e303b44b4..a88c91e81f8 100644
--- a/gcc/rust/expand/rust-expand-visitor.h
+++ b/gcc/rust/expand/rust-expand-visitor.h
@@ -158,8 +158,7 @@ public:
    * @param values Vector of values to mutate in-place and append into
    */
   void expand_inner_items (std::vector<std::unique_ptr<AST::Item>> &values);
-  void expand_inner_stmts (AST::BlockExpr &expr,
-			   std::vector<std::unique_ptr<AST::Stmt>> &values);
+  void expand_inner_stmts (AST::BlockExpr &expr);
 
   // TODO: See if possible to make more specialization for Impl items, Block
   // stmts etc? This could allow us to remove expand_macro_children or at least

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2024-01-16 17:53 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-01-16 17:53 [gcc r14-7689] gccrs: expand: Merge arguments into one Arthur Cohen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).