From df9a163470950c365c46c913013e154ab3798a56 Mon Sep 17 00:00:00 2001 From: Owen Avery Date: Fri, 6 Oct 2023 23:16:41 -0400 Subject: [PATCH] Rename cloning methods in TupleStructItems and TuplePatternItems gcc/rust/ChangeLog: * hir/tree/rust-hir-pattern.h (TupleStructItems::clone_tuple_struct_items_impl): Rename to... (TupleStructItems::clone_tuple_items_impl): ...here. (TupleStructItemsNoRange::clone_tuple_struct_items_impl): Rename to... (TupleStructItemsNoRange::clone_tuple_items_impl): ...here. (TupleStructItemsRange::clone_tuple_struct_items_impl): Rename to... (TupleStructItemsRange::clone_tuple_items_impl): ...here. (TuplePatternItems::clone_tuple_pattern_items_impl): Rename to... (TuplePatternItems::clone_tuple_items_impl): ...here. (TuplePatternItemsMultiple::clone_tuple_pattern_items_impl): Rename to... (TuplePatternItemsMultiple::clone_tuple_items_impl): ...here. (TuplePatternItemsRanged::clone_tuple_pattern_items_impl): Rename to... (TuplePatternItemsRanged::clone_tuple_items_impl): ...here. Signed-off-by: Owen Avery --- gcc/rust/hir/tree/rust-hir-pattern.h | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/gcc/rust/hir/tree/rust-hir-pattern.h b/gcc/rust/hir/tree/rust-hir-pattern.h index b3dc56a88c6b..6aa3d885cfa2 100644 --- a/gcc/rust/hir/tree/rust-hir-pattern.h +++ b/gcc/rust/hir/tree/rust-hir-pattern.h @@ -794,7 +794,7 @@ class TupleStructItems : public FullVisitable // Unique pointer custom clone function std::unique_ptr clone_tuple_struct_items () const { - return std::unique_ptr (clone_tuple_struct_items_impl ()); + return std::unique_ptr (clone_tuple_items_impl ()); } virtual std::string as_string () const = 0; @@ -805,7 +805,7 @@ class TupleStructItems : public FullVisitable protected: // pure virtual clone implementation - virtual TupleStructItems *clone_tuple_struct_items_impl () const = 0; + virtual TupleStructItems *clone_tuple_items_impl () const = 0; }; // Class for non-ranged tuple struct pattern patterns @@ -857,7 +857,7 @@ class TupleStructItemsNoRange : public TupleStructItems protected: /* Use covariance to implement clone function as returning this object rather * than base */ - TupleStructItemsNoRange *clone_tuple_struct_items_impl () const override + TupleStructItemsNoRange *clone_tuple_items_impl () const override { return new TupleStructItemsNoRange (*this); } @@ -936,7 +936,7 @@ class TupleStructItemsRange : public TupleStructItems protected: /* Use covariance to implement clone function as returning this object rather * than base */ - TupleStructItemsRange *clone_tuple_struct_items_impl () const override + TupleStructItemsRange *clone_tuple_items_impl () const override { return new TupleStructItemsRange (*this); } @@ -1027,8 +1027,7 @@ class TuplePatternItems : public FullVisitable // Unique pointer custom clone function std::unique_ptr clone_tuple_pattern_items () const { - return std::unique_ptr ( - clone_tuple_pattern_items_impl ()); + return std::unique_ptr (clone_tuple_items_impl ()); } virtual std::string as_string () const = 0; @@ -1037,7 +1036,7 @@ class TuplePatternItems : public FullVisitable protected: // pure virtual clone implementation - virtual TuplePatternItems *clone_tuple_pattern_items_impl () const = 0; + virtual TuplePatternItems *clone_tuple_items_impl () const = 0; }; // Class representing TuplePattern patterns where there are multiple patterns @@ -1092,7 +1091,7 @@ class TuplePatternItemsMultiple : public TuplePatternItems protected: /* Use covariance to implement clone function as returning this object rather * than base */ - TuplePatternItemsMultiple *clone_tuple_pattern_items_impl () const override + TuplePatternItemsMultiple *clone_tuple_items_impl () const override { return new TuplePatternItemsMultiple (*this); } @@ -1174,7 +1173,7 @@ class TuplePatternItemsRanged : public TuplePatternItems protected: /* Use covariance to implement clone function as returning this object rather * than base */ - TuplePatternItemsRanged *clone_tuple_pattern_items_impl () const override + TuplePatternItemsRanged *clone_tuple_items_impl () const override { return new TuplePatternItemsRanged (*this); }