public inbox for gcc-cvs@sourceware.org help / color / mirror / Atom feed
From: Arthur Cohen <cohenarthur@gcc.gnu.org> To: gcc-cvs@gcc.gnu.org Subject: [gcc r14-8565] gccrs: ast: Add NodeId to UseTree base class Date: Tue, 30 Jan 2024 12:00:17 +0000 (GMT) [thread overview] Message-ID: <20240130120017.58EF6385801D@sourceware.org> (raw) https://gcc.gnu.org/g:1133c1c671d91243b54dd5f6d2fed658ce1f8d9a commit r14-8565-g1133c1c671d91243b54dd5f6d2fed658ce1f8d9a Author: Arthur Cohen <arthur.cohen@embecosm.com> Date: Wed Aug 23 13:49:24 2023 +0200 gccrs: ast: Add NodeId to UseTree base class gcc/rust/ChangeLog: * ast/rust-item.h (class UseTree): Add `node_id` member. Diff: --- gcc/rust/ast/rust-item.h | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/gcc/rust/ast/rust-item.h b/gcc/rust/ast/rust-item.h index 2c0e45962cea..3480d126bc03 100644 --- a/gcc/rust/ast/rust-item.h +++ b/gcc/rust/ast/rust-item.h @@ -940,6 +940,7 @@ protected: class UseTree { location_t locus; + NodeId node_id; public: enum Kind @@ -975,6 +976,7 @@ public: virtual Kind get_kind () const = 0; location_t get_locus () const { return locus; } + NodeId get_node_id () const { return node_id; } virtual void accept_vis (ASTVisitor &vis) = 0; @@ -982,7 +984,9 @@ protected: // Clone function implementation as pure virtual method virtual UseTree *clone_use_tree_impl () const = 0; - UseTree (location_t locus) : locus (locus) {} + UseTree (location_t locus) + : locus (locus), node_id (Analysis::Mappings::get ()->get_next_node_id ()) + {} }; // Use tree with a glob (wildcard) operator @@ -1182,7 +1186,7 @@ public: Kind get_kind () const override { return Rebind; } - SimplePath get_path () const + const SimplePath &get_path () const { rust_assert (has_path ()); return path;
reply other threads:[~2024-01-30 12:00 UTC|newest] Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=20240130120017.58EF6385801D@sourceware.org \ --to=cohenarthur@gcc.gnu.org \ --cc=gcc-cvs@gcc.gnu.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).