From: Pierre-Emmanuel Patry <[email protected]>
gcc/rust/ChangeLog:
* ast/rust-ast.h (class Attribute): Add a node id member.
Signed-off-by: Pierre-Emmanuel Patry <[email protected]>
---
This change was merged into the gccrs repository and is posted here for
upstream visibility and potential drive-by review, as requested by GCC
release managers.
Each commit email contains a link to its details on github from where you can
find the Pull-Request and associated discussions.
Commit on github:
https://github.com/Rust-GCC/gccrs/commit/c6f80dc65681d5eb48b03622c983c2beb37489aa
The commit has been mentioned in the following pull-request(s):
- https://github.com/Rust-GCC/gccrs/pull/4425
gcc/rust/ast/rust-ast.h | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/gcc/rust/ast/rust-ast.h b/gcc/rust/ast/rust-ast.h
index 349318540..2185f4b03 100644
--- a/gcc/rust/ast/rust-ast.h
+++ b/gcc/rust/ast/rust-ast.h
@@ -577,6 +577,8 @@ class Attribute : Visitable
bool inner_attribute;
+ NodeId node_id;
+
// TODO: maybe a variable storing whether attr input is parsed or not
public:
@@ -587,7 +589,8 @@ public:
Attribute (SimplePath path, std::unique_ptr<AttrInput> input,
location_t locus = UNDEF_LOCATION, bool inner_attribute = false)
: path (std::move (path)), attr_input (std::move (input)), locus (locus),
- inner_attribute (inner_attribute)
+ inner_attribute (inner_attribute),
+ node_id (Analysis::Mappings::get ().get_next_node_id ())
{}
bool is_derive () const;
@@ -690,6 +693,8 @@ public:
const SimplePath &get_path () const { return path; }
SimplePath &get_path () { return path; }
+ NodeId get_node_id () { return node_id; }
+
// Call to parse attribute body to meta item syntax.
void parse_attr_to_meta_item ();
--
2.53.0