aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorPhilip Herron <philip.herron@embecosm.com>2022-01-13 21:28:42 +0000
committerPhilip Herron <philip.herron@embecosm.com>2022-01-13 21:28:42 +0000
commitf51d8fd538681cd66791ac6e93d094651cde174d (patch)
tree82a14ffdc5daba7e019b448285bab710c513b64f /gcc
parent03e56b5181506a4e6cdb9fe86c543a57840e54c3 (diff)
downloadgcc-f51d8fd538681cd66791ac6e93d094651cde174d.zip
gcc-f51d8fd538681cd66791ac6e93d094651cde174d.tar.gz
gcc-f51d8fd538681cd66791ac6e93d094651cde174d.tar.bz2
Add ArrayElemsType enum to differentiate between the types
Diffstat (limited to 'gcc')
-rw-r--r--gcc/rust/hir/tree/rust-hir-expr.h18
1 files changed, 18 insertions, 0 deletions
diff --git a/gcc/rust/hir/tree/rust-hir-expr.h b/gcc/rust/hir/tree/rust-hir-expr.h
index c1495d4..3a5b8974 100644
--- a/gcc/rust/hir/tree/rust-hir-expr.h
+++ b/gcc/rust/hir/tree/rust-hir-expr.h
@@ -816,6 +816,12 @@ protected:
class ArrayElems
{
public:
+ enum ArrayExprType
+ {
+ VALUES,
+ COPIED,
+ };
+
virtual ~ArrayElems () {}
// Unique pointer custom clone ArrayElems function
@@ -828,6 +834,8 @@ public:
virtual void accept_vis (HIRFullVisitor &vis) = 0;
+ virtual ArrayExprType get_array_expr_type () const = 0;
+
protected:
// pure virtual clone implementation
virtual ArrayElems *clone_array_elems_impl () const = 0;
@@ -875,6 +883,11 @@ public:
std::vector<std::unique_ptr<Expr> > &get_values () { return values; }
+ ArrayElems::ArrayExprType get_array_expr_type () const override final
+ {
+ return ArrayElems::ArrayExprType::VALUES;
+ }
+
protected:
ArrayElemsValues *clone_array_elems_impl () const override
{
@@ -923,6 +936,11 @@ public:
Expr *get_num_copies_expr () { return num_copies.get (); }
+ ArrayElems::ArrayExprType get_array_expr_type () const override final
+ {
+ return ArrayElems::ArrayExprType::COPIED;
+ }
+
protected:
ArrayElemsCopied *clone_array_elems_impl () const override
{