diff options
author | Philip Herron <herron.philip@googlemail.com> | 2023-02-06 17:48:06 +0000 |
---|---|---|
committer | Philip Herron <philip.herron@embecosm.com> | 2023-02-14 22:55:07 +0000 |
commit | 226e5736c08614621ef64dd7f710f6af006d082a (patch) | |
tree | 813114a15c6eaeb7f3c4a567bf14f5de3bd47254 /gcc | |
parent | a10df8a219b6aabcb9af73f1134021083d511538 (diff) | |
download | gcc-226e5736c08614621ef64dd7f710f6af006d082a.zip gcc-226e5736c08614621ef64dd7f710f6af006d082a.tar.gz gcc-226e5736c08614621ef64dd7f710f6af006d082a.tar.bz2 |
gccrs: Add new virtual function HIR::ImplItem::get_impl_item_name
Signed-off-by: Philip Herron <herron.philip@googlemail.com>
gcc/rust/ChangeLog:
* hir/tree/rust-hir-item.h: implement virtual function
* hir/tree/rust-hir.h: add virtual function
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/rust/hir/tree/rust-hir-item.h | 17 | ||||
-rw-r--r-- | gcc/rust/hir/tree/rust-hir.h | 2 |
2 files changed, 18 insertions, 1 deletions
diff --git a/gcc/rust/hir/tree/rust-hir-item.h b/gcc/rust/hir/tree/rust-hir-item.h index f7bf1f8..03e1f71 100644 --- a/gcc/rust/hir/tree/rust-hir-item.h +++ b/gcc/rust/hir/tree/rust-hir-item.h @@ -1226,6 +1226,11 @@ public: SelfParam &get_self_param () { return self; } + std::string get_impl_item_name () const override final + { + return get_function_name (); + } + protected: /* Use covariance to implement clone function as returning this object * rather than base */ @@ -1345,6 +1350,11 @@ public: return get_mappings (); }; + std::string get_impl_item_name () const override final + { + return get_new_type_name (); + } + protected: /* Use covariance to implement clone function as returning this object * rather than base */ @@ -2116,7 +2126,7 @@ public: Expr *get_expr () { return const_expr.get (); } - std::string get_identifier () { return identifier; } + std::string get_identifier () const { return identifier; } Analysis::NodeMapping get_impl_mappings () const override { @@ -2130,6 +2140,11 @@ public: ItemKind get_item_kind () const override { return ItemKind::Constant; } + std::string get_impl_item_name () const override final + { + return get_identifier (); + } + protected: /* Use covariance to implement clone function as returning this object * rather than base */ diff --git a/gcc/rust/hir/tree/rust-hir.h b/gcc/rust/hir/tree/rust-hir.h index 314aafb..28f1f21 100644 --- a/gcc/rust/hir/tree/rust-hir.h +++ b/gcc/rust/hir/tree/rust-hir.h @@ -839,6 +839,8 @@ public: virtual ImplItemType get_impl_item_type () const = 0; + virtual std::string get_impl_item_name () const = 0; + protected: // Clone function implementation as pure virtual method virtual ImplItem *clone_inherent_impl_item_impl () const = 0; |