Skip to content

Commit

Permalink
Rename cloning methods in TupleStructItems and TuplePatternItems
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
powerboat9 committed Oct 7, 2023
1 parent 2897221 commit df9a163
Showing 1 changed file with 8 additions and 9 deletions.
17 changes: 8 additions & 9 deletions gcc/rust/hir/tree/rust-hir-pattern.h
Original file line number Diff line number Diff line change
Expand Up @@ -794,7 +794,7 @@ class TupleStructItems : public FullVisitable
// Unique pointer custom clone function
std::unique_ptr<TupleStructItems> clone_tuple_struct_items () const
{
return std::unique_ptr<TupleStructItems> (clone_tuple_struct_items_impl ());
return std::unique_ptr<TupleStructItems> (clone_tuple_items_impl ());
}

virtual std::string as_string () const = 0;
Expand All @@ -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
Expand Down Expand Up @@ -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);
}
Expand Down Expand Up @@ -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);
}
Expand Down Expand Up @@ -1027,8 +1027,7 @@ class TuplePatternItems : public FullVisitable
// Unique pointer custom clone function
std::unique_ptr<TuplePatternItems> clone_tuple_pattern_items () const
{
return std::unique_ptr<TuplePatternItems> (
clone_tuple_pattern_items_impl ());
return std::unique_ptr<TuplePatternItems> (clone_tuple_items_impl ());
}

virtual std::string as_string () const = 0;
Expand All @@ -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
Expand Down Expand Up @@ -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);
}
Expand Down Expand Up @@ -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);
}
Expand Down

0 comments on commit df9a163

Please sign in to comment.