mirror of
https://github.com/gcc-mirror/gcc.git
synced 2026-05-06 14:59:39 +02:00
gccrs: Add crate_name and crate_type to attribute values
gcc/rust/ChangeLog: * rust-session-manager.cc (Session::handle_crate_name): Use the new constexpr instead of a raw string value. * util/rust-attribute-values.h: Add crate_name and crate_type values. Signed-off-by: Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
This commit is contained in:
committed by
Arthur Cohen
parent
7459c47d42
commit
b6bfe68e0c
@@ -476,7 +476,7 @@ Session::handle_crate_name (const char *filename,
|
||||
|
||||
for (const auto &attr : parsed_crate.inner_attrs)
|
||||
{
|
||||
if (attr.get_path () != "crate_name")
|
||||
if (attr.get_path () != Values::Attributes::CRATE_NAME)
|
||||
continue;
|
||||
|
||||
auto msg_str = Analysis::Attributes::extract_string_literal (attr);
|
||||
|
||||
@@ -50,6 +50,8 @@ public:
|
||||
static constexpr auto &PROC_MACRO = "proc_macro";
|
||||
static constexpr auto &PROC_MACRO_DERIVE = "proc_macro_derive";
|
||||
static constexpr auto &PROC_MACRO_ATTRIBUTE = "proc_macro_attribute";
|
||||
static constexpr auto &CRATE_NAME = "crate_name";
|
||||
static constexpr auto &CRATE_TYPE = "crate_type";
|
||||
|
||||
static constexpr auto &TARGET_FEATURE = "target_feature";
|
||||
static constexpr auto &FEATURE = "feature";
|
||||
|
||||
Reference in New Issue
Block a user