]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
gccrs: Add new virtual function HIR::ImplItem::get_impl_item_name
authorPhilip Herron <herron.philip@googlemail.com>
Mon, 6 Feb 2023 17:48:06 +0000 (17:48 +0000)
committerArthur Cohen <arthur.cohen@embecosm.com>
Thu, 6 Apr 2023 08:47:23 +0000 (10:47 +0200)
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

gcc/rust/hir/tree/rust-hir-item.h
gcc/rust/hir/tree/rust-hir.h

index f7bf1f879c8dae4d494a787af839b1e82c5706be..03e1f71abb53777ce75ae1a8d421758fd06f961c 100644 (file)
@@ -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 */
index 314aafb32d3444ff372071173f75b4ae618bb000..28f1f21a6bb4b2ef5e01756e09483b54508bc747 100644 (file)
@@ -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;