Skip to content

Commit 5df24b4

Browse files
sqrtMP-E-P
authored andcommitted
gccrs: remove some loop helpers
gcc/rust/ChangeLog: * util/rust-attributes.cc: remove loop helper functions * util/rust-attributes.h: remove function defs Signed-off-by: Mason Pike <m@sonpike.net>
1 parent 028f3e8 commit 5df24b4

File tree

2 files changed

+5
-19
lines changed

2 files changed

+5
-19
lines changed

gcc/rust/util/rust-attributes.cc

Lines changed: 5 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -169,8 +169,11 @@ AttributeChecker::go (AST::Crate &crate)
169169
void
170170
AttributeChecker::visit (AST::Crate &crate)
171171
{
172-
check_inner_attributes (crate.get_inner_attrs ());
173-
check_attributes (crate.get_inner_attrs ());
172+
for (auto &attr : crate.get_inner_attrs ())
173+
{
174+
check_inner_attribute (attr);
175+
check_attribute (attr);
176+
}
174177

175178
for (auto &item : crate.items)
176179
item->accept_vis (*this);
@@ -455,13 +458,6 @@ AttributeChecker::check_inner_attribute (const AST::Attribute &attribute)
455458
"attribute cannot be used at crate level");
456459
}
457460

458-
void
459-
AttributeChecker::check_inner_attributes (const AST::AttrVec &attributes)
460-
{
461-
for (auto &attr : attributes)
462-
check_inner_attribute (attr);
463-
}
464-
465461
static void
466462
check_link_section_attribute (const AST::Attribute &attribute)
467463
{
@@ -524,12 +520,6 @@ AttributeChecker::check_attribute (const AST::Attribute &attribute)
524520
else if (result.name == Attrs::DEPRECATED)
525521
check_deprecated_attribute (attribute);
526522
}
527-
void
528-
AttributeChecker::check_attributes (const AST::AttrVec &attributes)
529-
{
530-
for (auto &attr : attributes)
531-
check_attribute (attr);
532-
}
533523

534524
void
535525
AttributeChecker::visit (AST::Token &)

gcc/rust/util/rust-attributes.h

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -105,12 +105,8 @@ class AttributeChecker : public AST::DefaultASTVisitor
105105

106106
/* Check the validity of an inner attribute */
107107
void check_inner_attribute (const AST::Attribute &attribute);
108-
/* Check the validy of all inner attributes */
109-
void check_inner_attributes (const AST::AttrVec &attributes);
110108
/* Check the validity of a given attribute */
111109
void check_attribute (const AST::Attribute &attribute);
112-
/* Check the validity of all given attributes */
113-
void check_attributes (const AST::AttrVec &attributes);
114110

115111
// rust-ast.h
116112
void visit (AST::Crate &crate) override;

0 commit comments

Comments
 (0)