aboutsummaryrefslogtreecommitdiff
path: root/gcc/rust/util/rust-attributes.cc
diff options
context:
space:
mode:
authorOm Swaroop Nayak <96killerat96@gmail.com>2025-01-01 09:02:02 -0800
committerPhilip Herron <philip.herron@embecosm.com>2025-01-10 12:34:55 +0000
commit600fd806b8821ea24103ea0f31d666077245c6b7 (patch)
tree7aad84aa0661bc1b8701e177a11d2ed9c12400b4 /gcc/rust/util/rust-attributes.cc
parentc957f18575fbe8208e01674cd446652323a7eb1b (diff)
downloadgcc-600fd806b8821ea24103ea0f31d666077245c6b7.zip
gcc-600fd806b8821ea24103ea0f31d666077245c6b7.tar.gz
gcc-600fd806b8821ea24103ea0f31d666077245c6b7.tar.bz2
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>
Diffstat (limited to 'gcc/rust/util/rust-attributes.cc')
-rw-r--r--gcc/rust/util/rust-attributes.cc8
1 files changed, 8 insertions, 0 deletions
diff --git a/gcc/rust/util/rust-attributes.cc b/gcc/rust/util/rust-attributes.cc
index 45ebf8c..1a66be2 100644
--- a/gcc/rust/util/rust-attributes.cc
+++ b/gcc/rust/util/rust-attributes.cc
@@ -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;