mirror of
https://github.com/gcc-mirror/gcc.git
synced 2026-05-06 23:25:24 +02:00
gccrs: gcc/rust/ChangeLog:
* ast/rust-collect-lang-items.cc (get_lang_item_attr): "removed checker fn" * util/rust-attributes.cc (Attributes::is_lang_item): "added fn" * util/rust-attributes.h: "added fn" Signed-off-by: Om Swaroop Nayak <96killerat96@gmail.com>
This commit is contained in:
committed by
Arthur Cohen
parent
770ca551cf
commit
7fd3007310
@@ -40,12 +40,7 @@ get_lang_item_attr (const T &maybe_lang_item)
|
||||
continue;
|
||||
}
|
||||
|
||||
bool is_lang_item = str_path == Values::Attributes::LANG
|
||||
&& attr.has_attr_input ()
|
||||
&& attr.get_attr_input ().get_attr_input_type ()
|
||||
== AST::AttrInput::AttrInputType::LITERAL;
|
||||
|
||||
if (is_lang_item)
|
||||
if (Analysis::Attributes::is_lang_item (str_path, attr))
|
||||
{
|
||||
auto &literal
|
||||
= static_cast<AST::AttrInputLiteral &> (attr.get_attr_input ());
|
||||
|
||||
@@ -37,6 +37,14 @@ Attributes::is_known (const std::string &attribute_path)
|
||||
|
||||
return !lookup.is_error ();
|
||||
}
|
||||
bool
|
||||
Attributes::is_lang_item (const std::string &attribute_path,
|
||||
const AST::Attribute &attr)
|
||||
{
|
||||
return ((attribute_path == Values::Attributes::LANG) && attr.has_attr_input ()
|
||||
&& (attr.get_attr_input ().get_attr_input_type ()
|
||||
== AST::AttrInput::AttrInputType::LITERAL));
|
||||
}
|
||||
|
||||
using Attrs = Values::Attributes;
|
||||
|
||||
|
||||
@@ -29,6 +29,8 @@ class Attributes
|
||||
{
|
||||
public:
|
||||
static bool is_known (const std::string &attribute_path);
|
||||
static bool is_lang_item (const std::string &attribute_path,
|
||||
const AST::Attribute &attr);
|
||||
};
|
||||
|
||||
enum CompilerPass
|
||||
|
||||
Reference in New Issue
Block a user