From: Mason Pike <[email protected]>

gcc/rust/ChangeLog:
        * util/rust-attributes.cc: remove loop helper functions
        * util/rust-attributes.h: remove function defs

Signed-off-by: Mason Pike <[email protected]>
---
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/5df24b4229874c43b6c11777bd57c202162e7661

The commit has been mentioned in the following pull-request(s):
 - https://github.com/Rust-GCC/gccrs/pull/4339

 gcc/rust/util/rust-attributes.cc | 20 +++++---------------
 gcc/rust/util/rust-attributes.h  |  4 ----
 2 files changed, 5 insertions(+), 19 deletions(-)

diff --git a/gcc/rust/util/rust-attributes.cc b/gcc/rust/util/rust-attributes.cc
index 9141bf5b1..8c7e0639b 100644
--- a/gcc/rust/util/rust-attributes.cc
+++ b/gcc/rust/util/rust-attributes.cc
@@ -169,8 +169,11 @@ AttributeChecker::go (AST::Crate &crate)
 void
 AttributeChecker::visit (AST::Crate &crate)
 {
-  check_inner_attributes (crate.get_inner_attrs ());
-  check_attributes (crate.get_inner_attrs ());
+  for (auto &attr : crate.get_inner_attrs ())
+    {
+      check_inner_attribute (attr);
+      check_attribute (attr);
+    }
 
   for (auto &item : crate.items)
     item->accept_vis (*this);
@@ -455,13 +458,6 @@ AttributeChecker::check_inner_attribute (const 
AST::Attribute &attribute)
                   "attribute cannot be used at crate level");
 }
 
-void
-AttributeChecker::check_inner_attributes (const AST::AttrVec &attributes)
-{
-  for (auto &attr : attributes)
-    check_inner_attribute (attr);
-}
-
 static void
 check_link_section_attribute (const AST::Attribute &attribute)
 {
@@ -524,12 +520,6 @@ AttributeChecker::check_attribute (const AST::Attribute 
&attribute)
   else if (result.name == Attrs::DEPRECATED)
     check_deprecated_attribute (attribute);
 }
-void
-AttributeChecker::check_attributes (const AST::AttrVec &attributes)
-{
-  for (auto &attr : attributes)
-    check_attribute (attr);
-}
 
 void
 AttributeChecker::visit (AST::Token &)
diff --git a/gcc/rust/util/rust-attributes.h b/gcc/rust/util/rust-attributes.h
index 7edad1083..2a9f44da1 100644
--- a/gcc/rust/util/rust-attributes.h
+++ b/gcc/rust/util/rust-attributes.h
@@ -105,12 +105,8 @@ private:
 
   /* Check the validity of an inner attribute */
   void check_inner_attribute (const AST::Attribute &attribute);
-  /* Check the validy of all inner attributes */
-  void check_inner_attributes (const AST::AttrVec &attributes);
   /* Check the validity of a given attribute */
   void check_attribute (const AST::Attribute &attribute);
-  /* Check the validity of all given attributes */
-  void check_attributes (const AST::AttrVec &attributes);
 
   // rust-ast.h
   void visit (AST::Crate &crate) override;
-- 
2.52.0

Reply via email to