Skip to content

Commit

Permalink
gcc/rust/ChangeLog:
Browse files Browse the repository at this point in the history
	* util/rust-attributes.cc (Attributes::is_rustc_builtin_macro):
	added checker function
	* util/rust-attributes.h:
	 added checker function definition

Signed-off-by: Om Swaroop Nayak <[email protected]>
  • Loading branch information
saeitoshi-10 committed Jan 13, 2025
1 parent 4ae5d60 commit cc844c6
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 9 deletions.
15 changes: 7 additions & 8 deletions gcc/rust/util/rust-attributes.cc
Original file line number Diff line number Diff line change
Expand Up @@ -38,15 +38,14 @@ Attributes::is_known (const std::string &attribute_path)
return !lookup.is_error ();
}
bool
Attributes::is_rustc_builtin_macro (AST::AttrVec outer_attrs)
Attributes::is_rustc_builtin_macro (const AST::AttrVec outer_attrs)
{
for (auto attr : outer_attrs)
{
if (attr.get_path () == Values::Attributes::RUSTC_BUILTIN_MACRO)
{
return true;
}
}
for (const auto attr : outer_attrs)

if (attr.get_path () == Values::Attributes::RUSTC_BUILTIN_MACRO)

return true;

return false;
}

Expand Down
2 changes: 1 addition & 1 deletion gcc/rust/util/rust-attributes.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ class Attributes
{
public:
static bool is_known (const std::string &attribute_path);
static bool is_rustc_builtin_macro (AST::AttrVec outer_attrs);
static bool is_rustc_builtin_macro (const AST::AttrVec outer_attrs);
};

enum CompilerPass
Expand Down

0 comments on commit cc844c6

Please sign in to comment.