[gcc/devel/rust/master] gccrs: refactor monomoprhized_clone to not use virtual dispatch

Thomas Schwinge tschwinge@gcc.gnu.org
Mon Mar 20 07:23:28 GMT 2023


https://gcc.gnu.org/g:d6e39f781eec041aad061b1cee35c99e2ad37868

commit d6e39f781eec041aad061b1cee35c99e2ad37868
Author: Philip Herron <herron.philip@googlemail.com>
Date:   Fri Mar 10 16:31:14 2023 +0000

    gccrs: refactor monomoprhized_clone to not use virtual dispatch
    
    gcc/rust/ChangeLog:
    
            * typecheck/rust-tyty.cc (BaseType::monomorphized_clone): new impl
            (InferType::monomorphized_clone): remove
            (ErrorType::monomorphized_clone): likewise
            (ADTType::monomorphized_clone): likewise
            (TupleType::monomorphized_clone): likewise
            (FnType::monomorphized_clone): likewise
            (FnPtr::monomorphized_clone): likewise
            (ClosureType::monomorphized_clone): likewise
            (ArrayType::clone): likewise
            (ArrayType::get_var_element_type): likewise
            (ArrayType::monomorphized_clone): likewise
            (SliceType::clone): likewise
            (SliceType::get_var_element_type): likewise
            (SliceType::monomorphized_clone): likewise
            (BoolType::monomorphized_clone): likewise
            (IntType::monomorphized_clone): likewise
            (UintType::monomorphized_clone): likewise
            (FloatType::monomorphized_clone): likewise
            (USizeType::monomorphized_clone): likewise
            (ISizeType::monomorphized_clone): likewise
            (CharType::monomorphized_clone): likewise
            (ReferenceType::clone): likewise
            (ReferenceType::get_var_element_type): likewise
            (ReferenceType::monomorphized_clone): likewise
            (PointerType::clone): likewise
            (PointerType::get_var_element_type): likewise
            (PointerType::monomorphized_clone): likewise
            (ParamType::monomorphized_clone): likewise
            (StrType::monomorphized_clone): likewise
            (NeverType::monomorphized_clone): likewise
            (PlaceholderType::monomorphized_clone): likewise
            (ProjectionType::monomorphized_clone): likewise
            (DynamicObjectType::monomorphized_clone): likewise
            * typecheck/rust-tyty.h: update header
    
    Signed-off-by: Philip Herron <herron.philip@googlemail.com>

Diff:
---
 gcc/rust/typecheck/rust-tyty.cc | 314 +++++++++++++++++-----------------------
 gcc/rust/typecheck/rust-tyty.h  |  39 ++---
 2 files changed, 145 insertions(+), 208 deletions(-)

diff --git a/gcc/rust/typecheck/rust-tyty.cc b/gcc/rust/typecheck/rust-tyty.cc
index dbd4b5c7ae4..90d227c577a 100644
--- a/gcc/rust/typecheck/rust-tyty.cc
+++ b/gcc/rust/typecheck/rust-tyty.cc
@@ -25,10 +25,8 @@
 
 #include "rust-substitution-mapper.h"
 #include "rust-hir-trait-reference.h"
-#include "rust-hir-type-bounds.h"
 #include "rust-hir-trait-resolve.h"
 #include "rust-tyty-cmp.h"
-#include "rust-type-util.h"
 
 #include "options.h"
 
@@ -572,6 +570,122 @@ BaseType::destructure () const
   return x;
 }
 
+BaseType *
+BaseType::monomorphized_clone () const
+{
+  const TyTy::BaseType *x = destructure ();
+  switch (x->get_kind ())
+    {
+    case PARAM:
+    case PROJECTION:
+    case PLACEHOLDER:
+    case INFER:
+    case BOOL:
+    case CHAR:
+    case INT:
+    case UINT:
+    case FLOAT:
+    case USIZE:
+    case ISIZE:
+    case NEVER:
+    case STR:
+    case DYNAMIC:
+    case CLOSURE:
+    case ERROR:
+      return x->clone ();
+
+      case ARRAY: {
+	const ArrayType &arr = *static_cast<const ArrayType *> (x);
+	TyVar elm = arr.get_var_element_type ().monomorphized_clone ();
+	return new ArrayType (arr.get_ref (), arr.get_ty_ref (), ident.locus,
+			      arr.get_capacity_expr (), elm,
+			      arr.get_combined_refs ());
+      }
+      break;
+
+      case SLICE: {
+	const SliceType &slice = *static_cast<const SliceType *> (x);
+	TyVar elm = slice.get_var_element_type ().monomorphized_clone ();
+	return new SliceType (slice.get_ref (), slice.get_ty_ref (),
+			      ident.locus, elm, slice.get_combined_refs ());
+      }
+      break;
+
+      case POINTER: {
+	const PointerType &ptr = *static_cast<const PointerType *> (x);
+	TyVar elm = ptr.get_var_element_type ().monomorphized_clone ();
+	return new PointerType (ptr.get_ref (), ptr.get_ty_ref (), elm,
+				ptr.mutability (), ptr.get_combined_refs ());
+      }
+      break;
+
+      case REF: {
+	const ReferenceType &ref = *static_cast<const ReferenceType *> (x);
+	TyVar elm = ref.get_var_element_type ().monomorphized_clone ();
+	return new ReferenceType (ref.get_ref (), ref.get_ty_ref (), elm,
+				  ref.mutability (), ref.get_combined_refs ());
+      }
+      break;
+
+      case TUPLE: {
+	const TupleType &tuple = *static_cast<const TupleType *> (x);
+	std::vector<TyVar> cloned_fields;
+	for (const auto &f : tuple.get_fields ())
+	  cloned_fields.push_back (f.monomorphized_clone ());
+
+	return new TupleType (tuple.get_ref (), tuple.get_ty_ref (),
+			      tuple.get_ident ().locus, cloned_fields,
+			      tuple.get_combined_refs ());
+      }
+      break;
+
+      case FNDEF: {
+	const FnType &fn = *static_cast<const FnType *> (x);
+	std::vector<std::pair<HIR::Pattern *, BaseType *>> cloned_params;
+	for (auto &p : fn.get_params ())
+	  cloned_params.push_back ({p.first, p.second->monomorphized_clone ()});
+
+	BaseType *retty = fn.get_return_type ()->monomorphized_clone ();
+	return new FnType (fn.get_ref (), fn.get_ty_ref (), fn.get_id (),
+			   fn.get_identifier (), fn.ident, fn.get_flags (),
+			   fn.get_abi (), std::move (cloned_params), retty,
+			   fn.clone_substs (), fn.get_combined_refs ());
+      }
+      break;
+
+      case FNPTR: {
+	const FnPtr &fn = *static_cast<const FnPtr *> (x);
+	std::vector<TyVar> cloned_params;
+	for (auto &p : fn.get_params ())
+	  cloned_params.push_back (p.monomorphized_clone ());
+
+	TyVar retty = fn.get_var_return_type ().monomorphized_clone ();
+	return new FnPtr (fn.get_ref (), fn.get_ty_ref (), fn.ident.locus,
+			  std::move (cloned_params), retty,
+			  fn.get_combined_refs ());
+      }
+      break;
+
+      case ADT: {
+	const ADTType &adt = *static_cast<const ADTType *> (x);
+	std::vector<VariantDef *> cloned_variants;
+	for (auto &variant : adt.get_variants ())
+	  cloned_variants.push_back (variant->monomorphized_clone ());
+
+	return new ADTType (adt.get_ref (), adt.get_ty_ref (),
+			    adt.get_identifier (), adt.ident,
+			    adt.get_adt_kind (), cloned_variants,
+			    adt.clone_substs (), adt.get_repr_options (),
+			    adt.get_used_arguments (),
+			    adt.get_combined_refs ());
+      }
+      break;
+    }
+
+  gcc_unreachable ();
+  return nullptr;
+}
+
 std::string
 BaseType::mappings_str () const
 {
@@ -820,12 +934,6 @@ InferType::clone () const
   return clone;
 }
 
-BaseType *
-InferType::monomorphized_clone () const
-{
-  return clone ();
-}
-
 bool
 InferType::default_type (BaseType **type) const
 {
@@ -899,12 +1007,6 @@ ErrorType::clone () const
   return new ErrorType (get_ref (), get_ty_ref (), get_combined_refs ());
 }
 
-BaseType *
-ErrorType::monomorphized_clone () const
-{
-  return clone ();
-}
-
 // Struct Field type
 
 StructFieldType::StructFieldType (HirId ref, std::string name, BaseType *ty,
@@ -1314,19 +1416,6 @@ ADTType::clone () const
 		      get_combined_refs ());
 }
 
-BaseType *
-ADTType::monomorphized_clone () const
-{
-  std::vector<VariantDef *> cloned_variants;
-  for (auto &variant : variants)
-    cloned_variants.push_back (variant->monomorphized_clone ());
-
-  return new ADTType (get_ref (), get_ty_ref (), identifier, ident,
-		      get_adt_kind (), cloned_variants, clone_substs (),
-		      get_repr_options (), used_arguments,
-		      get_combined_refs ());
-}
-
 static bool
 handle_substitions (SubstitutionArgumentMappings &subst_mappings,
 		    StructFieldType *field)
@@ -1528,17 +1617,6 @@ TupleType::clone () const
 			cloned_fields, get_combined_refs ());
 }
 
-BaseType *
-TupleType::monomorphized_clone () const
-{
-  std::vector<TyVar> cloned_fields;
-  for (const auto &f : fields)
-    cloned_fields.push_back (f.monomorphized_clone ());
-
-  return new TupleType (get_ref (), get_ty_ref (), get_ident ().locus,
-			cloned_fields, get_combined_refs ());
-}
-
 TupleType *
 TupleType::handle_substitions (SubstitutionArgumentMappings &mappings)
 {
@@ -1660,19 +1738,6 @@ FnType::clone () const
 		     get_combined_refs ());
 }
 
-BaseType *
-FnType::monomorphized_clone () const
-{
-  std::vector<std::pair<HIR::Pattern *, BaseType *>> cloned_params;
-  for (auto &p : params)
-    cloned_params.push_back ({p.first, p.second->monomorphized_clone ()});
-
-  return new FnType (get_ref (), get_ty_ref (), get_id (), get_identifier (),
-		     ident, flags, abi, std::move (cloned_params),
-		     get_return_type ()->clone (), clone_substs (),
-		     get_combined_refs ());
-}
-
 FnType *
 FnType::handle_substitions (SubstitutionArgumentMappings &subst_mappings)
 {
@@ -1858,18 +1923,6 @@ FnPtr::clone () const
 		    get_combined_refs ());
 }
 
-BaseType *
-FnPtr::monomorphized_clone () const
-{
-  std::vector<TyVar> cloned_params;
-  for (auto &p : params)
-    cloned_params.push_back (p.monomorphized_clone ());
-
-  return new FnPtr (get_ref (), get_ty_ref (), ident.locus,
-		    std::move (cloned_params), result_type,
-		    get_combined_refs ());
-}
-
 void
 ClosureType::accept_vis (TyVisitor &vis)
 {
@@ -1921,12 +1974,6 @@ ClosureType::clone () const
 			  specified_bounds);
 }
 
-BaseType *
-ClosureType::monomorphized_clone () const
-{
-  return clone ();
-}
-
 ClosureType *
 ClosureType::handle_substitions (SubstitutionArgumentMappings &mappings)
 {
@@ -2025,19 +2072,17 @@ ArrayType::get_element_type () const
   return element_type.get_tyty ();
 }
 
-BaseType *
-ArrayType::clone () const
+const TyVar &
+ArrayType::get_var_element_type () const
 {
-  return new ArrayType (get_ref (), get_ty_ref (), ident.locus, capacity_expr,
-			element_type, get_combined_refs ());
+  return element_type;
 }
 
 BaseType *
-ArrayType::monomorphized_clone () const
+ArrayType::clone () const
 {
   return new ArrayType (get_ref (), get_ty_ref (), ident.locus, capacity_expr,
-			element_type.monomorphized_clone (),
-			get_combined_refs ());
+			element_type, get_combined_refs ());
 }
 
 ArrayType *
@@ -2101,19 +2146,17 @@ SliceType::get_element_type () const
   return element_type.get_tyty ();
 }
 
-BaseType *
-SliceType::clone () const
+const TyVar &
+SliceType::get_var_element_type () const
 {
-  return new SliceType (get_ref (), get_ty_ref (), ident.locus,
-			element_type.clone (), get_combined_refs ());
+  return element_type;
 }
 
 BaseType *
-SliceType::monomorphized_clone () const
+SliceType::clone () const
 {
   return new SliceType (get_ref (), get_ty_ref (), ident.locus,
-			element_type.monomorphized_clone (),
-			get_combined_refs ());
+			element_type.clone (), get_combined_refs ());
 }
 
 SliceType *
@@ -2185,12 +2228,6 @@ BoolType::clone () const
   return new BoolType (get_ref (), get_ty_ref (), get_combined_refs ());
 }
 
-BaseType *
-BoolType::monomorphized_clone () const
-{
-  return clone ();
-}
-
 // IntType
 
 IntType::IntType (HirId ref, IntKind kind, std::set<HirId> refs)
@@ -2267,12 +2304,6 @@ IntType::clone () const
 		      get_combined_refs ());
 }
 
-BaseType *
-IntType::monomorphized_clone () const
-{
-  return clone ();
-}
-
 bool
 IntType::is_equal (const BaseType &other) const
 {
@@ -2360,12 +2391,6 @@ UintType::clone () const
 		       get_combined_refs ());
 }
 
-BaseType *
-UintType::monomorphized_clone () const
-{
-  return clone ();
-}
-
 bool
 UintType::is_equal (const BaseType &other) const
 {
@@ -2447,12 +2472,6 @@ FloatType::clone () const
 			get_combined_refs ());
 }
 
-BaseType *
-FloatType::monomorphized_clone () const
-{
-  return clone ();
-}
-
 bool
 FloatType::is_equal (const BaseType &other) const
 {
@@ -2516,12 +2535,6 @@ USizeType::clone () const
   return new USizeType (get_ref (), get_ty_ref (), get_combined_refs ());
 }
 
-BaseType *
-USizeType::monomorphized_clone () const
-{
-  return clone ();
-}
-
 // ISizeType
 
 ISizeType::ISizeType (HirId ref, std::set<HirId> refs)
@@ -2575,12 +2588,6 @@ ISizeType::clone () const
   return new ISizeType (get_ref (), get_ty_ref (), get_combined_refs ());
 }
 
-BaseType *
-ISizeType::monomorphized_clone () const
-{
-  return clone ();
-}
-
 // Char Type
 
 CharType::CharType (HirId ref, std::set<HirId> refs)
@@ -2634,12 +2641,6 @@ CharType::clone () const
   return new CharType (get_ref (), get_ty_ref (), get_combined_refs ());
 }
 
-BaseType *
-CharType::monomorphized_clone () const
-{
-  return clone ();
-}
-
 // Reference Type
 
 ReferenceType::ReferenceType (HirId ref, TyVar base, Mutability mut,
@@ -2756,18 +2757,16 @@ ReferenceType::get_base () const
   return base.get_tyty ();
 }
 
-BaseType *
-ReferenceType::clone () const
+const TyVar &
+ReferenceType::get_var_element_type () const
 {
-  return new ReferenceType (get_ref (), get_ty_ref (), base, mutability (),
-			    get_combined_refs ());
+  return base;
 }
 
 BaseType *
-ReferenceType::monomorphized_clone () const
+ReferenceType::clone () const
 {
-  return new ReferenceType (get_ref (), get_ty_ref (),
-			    base.monomorphized_clone (), mutability (),
+  return new ReferenceType (get_ref (), get_ty_ref (), base, mutability (),
 			    get_combined_refs ());
 }
 
@@ -2909,18 +2908,16 @@ PointerType::get_base () const
   return base.get_tyty ();
 }
 
-BaseType *
-PointerType::clone () const
+const TyVar &
+PointerType::get_var_element_type () const
 {
-  return new PointerType (get_ref (), get_ty_ref (), base, mutability (),
-			  get_combined_refs ());
+  return base;
 }
 
 BaseType *
-PointerType::monomorphized_clone () const
+PointerType::clone () const
 {
-  return new PointerType (get_ref (), get_ty_ref (),
-			  base.monomorphized_clone (), mutability (),
+  return new PointerType (get_ref (), get_ty_ref (), base, mutability (),
 			  get_combined_refs ());
 }
 
@@ -3024,12 +3021,6 @@ ParamType::clone () const
 			get_combined_refs ());
 }
 
-BaseType *
-ParamType::monomorphized_clone () const
-{
-  return resolve ()->clone ();
-}
-
 std::string
 ParamType::get_symbol () const
 {
@@ -3151,12 +3142,6 @@ StrType::clone () const
   return new StrType (get_ref (), get_ty_ref (), get_combined_refs ());
 }
 
-BaseType *
-StrType::monomorphized_clone () const
-{
-  return clone ();
-}
-
 void
 StrType::accept_vis (TyVisitor &vis)
 {
@@ -3241,12 +3226,6 @@ NeverType::clone () const
   return new NeverType (get_ref (), get_ty_ref (), get_combined_refs ());
 }
 
-BaseType *
-NeverType::monomorphized_clone () const
-{
-  return clone ();
-}
-
 // placeholder type
 
 PlaceholderType::PlaceholderType (std::string symbol, HirId ref,
@@ -3312,15 +3291,6 @@ PlaceholderType::clone () const
 			      get_combined_refs ());
 }
 
-BaseType *
-PlaceholderType::monomorphized_clone () const
-{
-  if (can_resolve ())
-    return resolve ()->monomorphized_clone ();
-
-  return clone ();
-}
-
 void
 PlaceholderType::set_associated_type (HirId ref)
 {
@@ -3463,12 +3433,6 @@ ProjectionType::clone () const
 			     get_combined_refs ());
 }
 
-BaseType *
-ProjectionType::monomorphized_clone () const
-{
-  return get ()->monomorphized_clone ();
-}
-
 ProjectionType *
 ProjectionType::handle_substitions (
   SubstitutionArgumentMappings &subst_mappings)
@@ -3588,12 +3552,6 @@ DynamicObjectType::clone () const
 				specified_bounds, get_combined_refs ());
 }
 
-BaseType *
-DynamicObjectType::monomorphized_clone () const
-{
-  return clone ();
-}
-
 std::string
 DynamicObjectType::get_name () const
 {
diff --git a/gcc/rust/typecheck/rust-tyty.h b/gcc/rust/typecheck/rust-tyty.h
index 47f55163277..ce17c18fcab 100644
--- a/gcc/rust/typecheck/rust-tyty.h
+++ b/gcc/rust/typecheck/rust-tyty.h
@@ -135,8 +135,9 @@ public:
    * releasing the memory of the returned ty. */
   virtual BaseType *clone () const = 0;
 
-  // TODO
-  virtual BaseType *monomorphized_clone () const = 0;
+  // monomorphized clone is a clone which destructures the types to get rid of
+  // generics
+  BaseType *monomorphized_clone () const;
 
   // get_combined_refs returns the chain of node refs involved in unification
   std::set<HirId> get_combined_refs () const;
@@ -212,7 +213,6 @@ public:
   bool can_eq (const BaseType *other, bool emit_errors) const override final;
 
   BaseType *clone () const final override;
-  BaseType *monomorphized_clone () const final override;
 
   InferTypeKind get_infer_kind () const;
 
@@ -240,7 +240,6 @@ public:
   bool can_eq (const BaseType *other, bool emit_errors) const override final;
 
   BaseType *clone () const final override;
-  BaseType *monomorphized_clone () const final override;
 
   std::string get_name () const override final;
 };
@@ -266,7 +265,6 @@ public:
   bool can_eq (const BaseType *other, bool emit_errors) const override final;
 
   BaseType *clone () const final override;
-  BaseType *monomorphized_clone () const final override;
 
   std::string get_symbol () const;
 
@@ -346,7 +344,6 @@ public:
   BaseType *get_field (size_t index) const;
 
   BaseType *clone () const final override;
-  BaseType *monomorphized_clone () const final override;
 
   const std::vector<TyVar> &get_fields () const;
 
@@ -574,7 +571,6 @@ public:
   }
 
   BaseType *clone () const final override;
-  BaseType *monomorphized_clone () const final override;
 
   bool needs_generic_substitutions () const override final
   {
@@ -733,7 +729,6 @@ public:
   BaseType *get_return_type () const { return type; }
 
   BaseType *clone () const final override;
-  BaseType *monomorphized_clone () const final override;
 
   bool needs_generic_substitutions () const override final
   {
@@ -751,6 +746,7 @@ public:
   handle_substitions (SubstitutionArgumentMappings &mappings) override final;
 
   ABI get_abi () const { return abi; }
+  uint8_t get_flags () const { return flags; }
 
 private:
   std::vector<std::pair<HIR::Pattern *, BaseType *>> params;
@@ -781,6 +777,7 @@ public:
   std::string get_name () const override final { return as_string (); }
 
   BaseType *get_return_type () const { return result_type.get_tyty (); }
+  const TyVar &get_var_return_type () const { return result_type; }
 
   size_t num_params () const { return params.size (); }
 
@@ -796,7 +793,6 @@ public:
   bool is_equal (const BaseType &other) const override;
 
   BaseType *clone () const final override;
-  BaseType *monomorphized_clone () const final override;
 
   std::vector<TyVar> &get_params () { return params; }
   const std::vector<TyVar> &get_params () const { return params; }
@@ -856,7 +852,6 @@ public:
   bool is_equal (const BaseType &other) const override;
 
   BaseType *clone () const final override;
-  BaseType *monomorphized_clone () const final override;
 
   bool needs_generic_substitutions () const override final
   {
@@ -918,9 +913,9 @@ public:
   bool is_equal (const BaseType &other) const override;
 
   BaseType *get_element_type () const;
+  const TyVar &get_var_element_type () const;
 
   BaseType *clone () const final override;
-  BaseType *monomorphized_clone () const final override;
 
   HIR::Expr &get_capacity_expr () const { return capacity_expr; }
 
@@ -960,9 +955,9 @@ public:
   bool is_equal (const BaseType &other) const override;
 
   BaseType *get_element_type () const;
+  const TyVar &get_var_element_type () const;
 
   BaseType *clone () const final override;
-  BaseType *monomorphized_clone () const final override;
 
   SliceType *handle_substitions (SubstitutionArgumentMappings &mappings);
 
@@ -986,7 +981,6 @@ public:
   bool can_eq (const BaseType *other, bool emit_errors) const override final;
 
   BaseType *clone () const final override;
-  BaseType *monomorphized_clone () const final override;
 };
 
 class IntType : public BaseType
@@ -1017,7 +1011,6 @@ public:
   IntKind get_int_kind () const;
 
   BaseType *clone () const final override;
-  BaseType *monomorphized_clone () const final override;
 
   bool is_equal (const BaseType &other) const override;
 
@@ -1054,7 +1047,6 @@ public:
   UintKind get_uint_kind () const;
 
   BaseType *clone () const final override;
-  BaseType *monomorphized_clone () const final override;
 
   bool is_equal (const BaseType &other) const override;
 
@@ -1087,7 +1079,6 @@ public:
   FloatKind get_float_kind () const;
 
   BaseType *clone () const final override;
-  BaseType *monomorphized_clone () const final override;
 
   bool is_equal (const BaseType &other) const override;
 
@@ -1111,7 +1102,6 @@ public:
   bool can_eq (const BaseType *other, bool emit_errors) const override final;
 
   BaseType *clone () const final override;
-  BaseType *monomorphized_clone () const final override;
 };
 
 class ISizeType : public BaseType
@@ -1130,7 +1120,6 @@ public:
   bool can_eq (const BaseType *other, bool emit_errors) const override final;
 
   BaseType *clone () const final override;
-  BaseType *monomorphized_clone () const final override;
 };
 
 class CharType : public BaseType
@@ -1148,7 +1137,6 @@ public:
   bool can_eq (const BaseType *other, bool emit_errors) const override final;
 
   BaseType *clone () const final override;
-  BaseType *monomorphized_clone () const final override;
 };
 
 class StrType : public BaseType
@@ -1169,7 +1157,6 @@ public:
   bool is_equal (const BaseType &other) const override;
 
   BaseType *clone () const final override;
-  BaseType *monomorphized_clone () const final override;
 };
 
 class ReferenceType : public BaseType
@@ -1181,6 +1168,7 @@ public:
 		 std::set<HirId> refs = std::set<HirId> ());
 
   BaseType *get_base () const;
+  const TyVar &get_var_element_type () const;
 
   void accept_vis (TyVisitor &vis) override;
   void accept_vis (TyConstVisitor &vis) const override;
@@ -1194,18 +1182,14 @@ public:
   bool is_equal (const BaseType &other) const override;
 
   BaseType *clone () const final override;
-  BaseType *monomorphized_clone () const final override;
 
   ReferenceType *handle_substitions (SubstitutionArgumentMappings &mappings);
 
   Mutability mutability () const;
-
   bool is_mutable () const;
 
   bool is_dyn_object () const;
-
   bool is_dyn_slice_type (const TyTy::SliceType **slice = nullptr) const;
-
   bool is_dyn_str_type (const TyTy::StrType **str = nullptr) const;
 
 private:
@@ -1222,6 +1206,7 @@ public:
 	       std::set<HirId> refs = std::set<HirId> ());
 
   BaseType *get_base () const;
+  const TyVar &get_var_element_type () const;
 
   void accept_vis (TyVisitor &vis) override;
   void accept_vis (TyConstVisitor &vis) const override;
@@ -1234,7 +1219,6 @@ public:
   bool is_equal (const BaseType &other) const override;
 
   BaseType *clone () const final override;
-  BaseType *monomorphized_clone () const final override;
 
   PointerType *handle_substitions (SubstitutionArgumentMappings &mappings);
 
@@ -1242,7 +1226,6 @@ public:
   bool is_mutable () const;
   bool is_const () const;
   bool is_dyn_object () const;
-
   bool is_dyn_slice_type (const TyTy::SliceType **slice = nullptr) const;
   bool is_dyn_str_type (const TyTy::StrType **str = nullptr) const;
 
@@ -1276,7 +1259,6 @@ public:
   bool can_eq (const BaseType *other, bool emit_errors) const override final;
 
   BaseType *clone () const final override;
-  BaseType *monomorphized_clone () const final override;
 
   std::string get_name () const override final;
 };
@@ -1299,7 +1281,6 @@ public:
   bool can_eq (const BaseType *other, bool emit_errors) const override final;
 
   BaseType *clone () const final override;
-  BaseType *monomorphized_clone () const final override;
 
   std::string get_name () const override final;
 
@@ -1344,7 +1325,6 @@ public:
   bool can_eq (const BaseType *other, bool emit_errors) const override final;
 
   BaseType *clone () const final override;
-  BaseType *monomorphized_clone () const final override;
 
   std::string get_name () const override final;
 
@@ -1387,7 +1367,6 @@ public:
   bool is_equal (const BaseType &other) const override;
 
   BaseType *clone () const final override;
-  BaseType *monomorphized_clone () const final override;
 
   std::string get_name () const override final;


More information about the Gcc-cvs mailing list