]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
gccrs: Change early resolver visit_attributes arguments
authorPierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
Tue, 1 Aug 2023 10:43:27 +0000 (12:43 +0200)
committerArthur Cohen <arthur.cohen@embecosm.com>
Tue, 16 Jan 2024 18:04:33 +0000 (19:04 +0100)
We do not need to copy the whole vector we can simply take a reference
instead.

gcc/rust/ChangeLog:

* resolve/rust-early-name-resolver-2.0.cc (Early::visit_attributes):
Change argument to reference.
* resolve/rust-early-name-resolver-2.0.h: Update function
prototype.

Signed-off-by: Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
gcc/rust/resolve/rust-early-name-resolver-2.0.cc
gcc/rust/resolve/rust-early-name-resolver-2.0.h

index 65ec0d659167f669b9e7cbf01a26648cb2e247c4..7373e6232667338c608fd836b5584bb176c60953 100644 (file)
@@ -175,7 +175,7 @@ Early::visit (AST::UseTreeGlob &use)
 {}
 
 void
-Early::visit_attributes (std::vector<AST::Attribute> attrs)
+Early::visit_attributes (std::vector<AST::Attribute> &attrs)
 {
   for (auto &attr : attrs)
     {
index fe1c1f6b11cb5ca63e830ae44075dfacd6505fb2..dc27319647352f89de4b41f9305a6fae8fa8090b 100644 (file)
@@ -58,7 +58,7 @@ public:
   void visit (AST::StructStruct &) override;
 
 private:
-  void visit_attributes (std::vector<AST::Attribute> attrs);
+  void visit_attributes (std::vector<AST::Attribute> &attrs);
 
   /**
    * Macros can either be resolved through textual scoping or regular path