public inbox for gcc-cvs@sourceware.org help / color / mirror / Atom feed
From: Thomas Schwinge <tschwinge@gcc.gnu.org> To: gcc-cvs@gcc.gnu.org Subject: [gcc/devel/rust/master] ast: Add NodeId and clone to RestPattern Date: Sun, 5 Mar 2023 11:41:34 +0000 (GMT) [thread overview] Message-ID: <20230305114134.80CCD385828E@sourceware.org> (raw) https://gcc.gnu.org/g:a2ef9ad25a81fc01bfa8c24772ad771cf89ab7ea commit a2ef9ad25a81fc01bfa8c24772ad771cf89ab7ea Author: Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com> Date: Wed Mar 1 10:54:29 2023 +0100 ast: Add NodeId and clone to RestPattern The RestPattern AST node did not have any NodeId to identify it and could therefore not be instanciated. gcc/rust/ChangeLog: * ast/rust-pattern.h (class RestPattern): Add NodeId as well as the clone_impl function. Signed-off-by: Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com> Diff: --- gcc/rust/ast/rust-pattern.h | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/gcc/rust/ast/rust-pattern.h b/gcc/rust/ast/rust-pattern.h index 3d7cbed37c3..0cc84252640 100644 --- a/gcc/rust/ast/rust-pattern.h +++ b/gcc/rust/ast/rust-pattern.h @@ -194,15 +194,26 @@ protected: class RestPattern : public Pattern { Location locus; + NodeId node_id; public: std::string as_string () const override { return ".."; } - RestPattern (Location locus) : locus (locus) {} + RestPattern (Location locus) + : locus (locus), node_id (Analysis::Mappings::get ()->get_next_node_id ()) + {} Location get_locus () const override final { return locus; } void accept_vis (ASTVisitor &vis) override; + + NodeId get_pattern_node_id () const override final { return node_id; } + +protected: + RestPattern *clone_pattern_impl () const override + { + return new RestPattern (*this); + } }; // Base range pattern bound (lower or upper limit) - abstract
reply other threads:[~2023-03-05 11:41 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=20230305114134.80CCD385828E@sourceware.org \ --to=tschwinge@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).