aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbors[bot] <26634292+bors[bot]@users.noreply.github.com>2021-09-01 10:37:18 +0000
committerGitHub <noreply@github.com>2021-09-01 10:37:18 +0000
commitc33c6f3676dfca1a6bd7984cebf5028c015ea182 (patch)
tree0c830b9a468c78f3b0e4a140093cd09ebdda2989
parent82e1061579796adaa39ab34da77b6c8c6ea82539 (diff)
parent3b5c0f65ef12bd4771f69195d232588cff86b270 (diff)
downloadgcc-c33c6f3676dfca1a6bd7984cebf5028c015ea182.zip
gcc-c33c6f3676dfca1a6bd7984cebf5028c015ea182.tar.gz
gcc-c33c6f3676dfca1a6bd7984cebf5028c015ea182.tar.bz2
Merge #654
654: Cleanup some StructExpr related classes r=philberty a=dkm From Mark Wielaard: https://gcc.gnu.org/pipermail/gcc-rust/2021-September/000163.html > There are various Structure Expressions that don't actually "exist" > because they are syntactically equivalent to other constructs. So we > never really construct or use these classes. But they are still listed > in various visitors, which is somewhat confusing. Removing the AST and > HIR variants of these classes really cleans up the code IMHO. Co-authored-by: Mark Wielaard <mark@klomp.org>
-rw-r--r--gcc/rust/ast/rust-ast-full-decls.h11
-rw-r--r--gcc/rust/ast/rust-ast-full-test.cc128
-rw-r--r--gcc/rust/ast/rust-ast-visitor.h9
-rw-r--r--gcc/rust/ast/rust-expr.h445
-rw-r--r--gcc/rust/backend/rust-compile-base.h9
-rw-r--r--gcc/rust/expand/rust-macro-expand.cc136
-rw-r--r--gcc/rust/hir/rust-ast-lower-base.h9
-rw-r--r--gcc/rust/hir/tree/rust-hir-expr.h435
-rw-r--r--gcc/rust/hir/tree/rust-hir-full-decls.h11
-rw-r--r--gcc/rust/hir/tree/rust-hir-full-test.cc101
-rw-r--r--gcc/rust/hir/tree/rust-hir-visitor.h8
-rw-r--r--gcc/rust/lint/rust-lint-marklive-base.h9
-rw-r--r--gcc/rust/resolve/rust-ast-resolve-base.h8
-rw-r--r--gcc/rust/typecheck/rust-hir-const-fold-base.h9
-rw-r--r--gcc/rust/typecheck/rust-hir-type-check-base.h9
-rw-r--r--gcc/rust/typecheck/rust-hir-type-check-util.h9
16 files changed, 0 insertions, 1346 deletions
diff --git a/gcc/rust/ast/rust-ast-full-decls.h b/gcc/rust/ast/rust-ast-full-decls.h
index 7644dfe..2be7e77 100644
--- a/gcc/rust/ast/rust-ast-full-decls.h
+++ b/gcc/rust/ast/rust-ast-full-decls.h
@@ -109,17 +109,6 @@ class StructExprFieldIdentifierValue;
class StructExprFieldIndexValue;
class StructExprStructFields;
class StructExprStructBase;
-class StructExprTuple;
-class StructExprUnit;
-class EnumVariantExpr;
-class EnumExprField;
-class EnumExprFieldIdentifier;
-class EnumExprFieldWithVal;
-class EnumExprFieldIdentifierValue;
-class EnumExprFieldIndexValue;
-class EnumExprStruct;
-class EnumExprTuple;
-class EnumExprFieldless;
class CallExpr;
class MethodCallExpr;
class FieldAccessExpr;
diff --git a/gcc/rust/ast/rust-ast-full-test.cc b/gcc/rust/ast/rust-ast-full-test.cc
index c18d4c4..6241710 100644
--- a/gcc/rust/ast/rust-ast-full-test.cc
+++ b/gcc/rust/ast/rust-ast-full-test.cc
@@ -3240,44 +3240,6 @@ StructExpr::as_string () const
}
std::string
-StructExprTuple::as_string () const
-{
- std::string str = StructExpr::as_string ();
-
- if (exprs.empty ())
- {
- str += "()";
- }
- else
- {
- auto i = exprs.begin ();
- auto e = exprs.end ();
-
- // debug - null pointer check
- if (*i == nullptr)
- return "ERROR_MARK_STRING - nullptr struct expr tuple field";
-
- str += '(';
- for (; i != e; i++)
- {
- str += (*i)->as_string ();
- if (e != i + 1)
- str += ", ";
- }
- str += ')';
- }
-
- indent_spaces (enter);
- indent_spaces (enter);
- // inner attributes
- str += append_attributes (inner_attrs, INNER);
- indent_spaces (out);
- indent_spaces (out);
-
- return str;
-}
-
-std::string
StructExprStruct::as_string () const
{
// TODO: doesn't this require data from StructExpr?
@@ -3347,48 +3309,6 @@ StructExprStructFields::as_string () const
}
std::string
-EnumExprStruct::as_string () const
-{
- std::string str ("EnumExprStruct (or subclass): ");
-
- str += "\n Path: " + get_enum_variant_path ().as_string ();
-
- str += "\n Fields: ";
- if (fields.empty ())
- {
- str += "none";
- }
- else
- {
- for (const auto &field : fields)
- str += "\n " + field->as_string ();
- }
-
- return str;
-}
-
-std::string
-EnumExprFieldWithVal::as_string () const
-{
- // used to get value string
- return value->as_string ();
-}
-
-std::string
-EnumExprFieldIdentifierValue::as_string () const
-{
- // TODO: rewrite to work with non-linearisable exprs
- return field_name + " : " + EnumExprFieldWithVal::as_string ();
-}
-
-std::string
-EnumExprFieldIndexValue::as_string () const
-{
- // TODO: rewrite to work with non-linearisable exprs
- return std::to_string (index) + " : " + EnumExprFieldWithVal::as_string ();
-}
-
-std::string
EnumItem::as_string () const
{
// outer attributes
@@ -5223,54 +5143,6 @@ StructExprStructBase::accept_vis (ASTVisitor &vis)
}
void
-StructExprTuple::accept_vis (ASTVisitor &vis)
-{
- vis.visit (*this);
-}
-
-void
-StructExprUnit::accept_vis (ASTVisitor &vis)
-{
- vis.visit (*this);
-}
-
-void
-EnumExprFieldIdentifier::accept_vis (ASTVisitor &vis)
-{
- vis.visit (*this);
-}
-
-void
-EnumExprFieldIdentifierValue::accept_vis (ASTVisitor &vis)
-{
- vis.visit (*this);
-}
-
-void
-EnumExprFieldIndexValue::accept_vis (ASTVisitor &vis)
-{
- vis.visit (*this);
-}
-
-void
-EnumExprStruct::accept_vis (ASTVisitor &vis)
-{
- vis.visit (*this);
-}
-
-void
-EnumExprTuple::accept_vis (ASTVisitor &vis)
-{
- vis.visit (*this);
-}
-
-void
-EnumExprFieldless::accept_vis (ASTVisitor &vis)
-{
- vis.visit (*this);
-}
-
-void
CallExpr::accept_vis (ASTVisitor &vis)
{
vis.visit (*this);
diff --git a/gcc/rust/ast/rust-ast-visitor.h b/gcc/rust/ast/rust-ast-visitor.h
index e0de54d..15bf086 100644
--- a/gcc/rust/ast/rust-ast-visitor.h
+++ b/gcc/rust/ast/rust-ast-visitor.h
@@ -93,15 +93,6 @@ public:
virtual void visit (StructExprFieldIndexValue &field) = 0;
virtual void visit (StructExprStructFields &expr) = 0;
virtual void visit (StructExprStructBase &expr) = 0;
- virtual void visit (StructExprTuple &expr) = 0;
- virtual void visit (StructExprUnit &expr) = 0;
- // virtual void visit(EnumExprField& field) = 0;
- virtual void visit (EnumExprFieldIdentifier &field) = 0;
- virtual void visit (EnumExprFieldIdentifierValue &field) = 0;
- virtual void visit (EnumExprFieldIndexValue &field) = 0;
- virtual void visit (EnumExprStruct &expr) = 0;
- virtual void visit (EnumExprTuple &expr) = 0;
- virtual void visit (EnumExprFieldless &expr) = 0;
virtual void visit (CallExpr &expr) = 0;
virtual void visit (MethodCallExpr &expr) = 0;
virtual void visit (FieldAccessExpr &expr) = 0;
diff --git a/gcc/rust/ast/rust-expr.h b/gcc/rust/ast/rust-expr.h
index 88e45fe..f26ed98 100644
--- a/gcc/rust/ast/rust-expr.h
+++ b/gcc/rust/ast/rust-expr.h
@@ -1852,451 +1852,6 @@ protected:
}
};
-// AST node of a tuple struct creator
-class StructExprTuple : public StructExpr
-{
- std::vector<Attribute> inner_attrs;
- std::vector<std::unique_ptr<Expr> > exprs;
-
- Location locus;
-
-public:
- std::string as_string () const override;
-
- const std::vector<Attribute> &get_inner_attrs () const { return inner_attrs; }
- std::vector<Attribute> &get_inner_attrs () { return inner_attrs; }
-
- StructExprTuple (PathInExpression struct_path,
- std::vector<std::unique_ptr<Expr> > tuple_exprs,
- std::vector<Attribute> inner_attribs,
- std::vector<Attribute> outer_attribs, Location locus)
- : StructExpr (std::move (struct_path), std::move (outer_attribs)),
- inner_attrs (std::move (inner_attribs)), exprs (std::move (tuple_exprs)),
- locus (locus)
- {}
-
- // copy constructor with vector clone
- StructExprTuple (StructExprTuple const &other)
- : StructExpr (other), inner_attrs (other.inner_attrs), locus (other.locus)
- {
- exprs.reserve (other.exprs.size ());
- for (const auto &e : other.exprs)
- exprs.push_back (e->clone_expr ());
- }
-
- // overloaded assignment operator with vector clone
- StructExprTuple &operator= (StructExprTuple const &other)
- {
- StructExpr::operator= (other);
- inner_attrs = other.inner_attrs;
- locus = other.locus;
-
- exprs.reserve (other.exprs.size ());
- for (const auto &e : other.exprs)
- exprs.push_back (e->clone_expr ());
-
- return *this;
- }
-
- // move constructors
- StructExprTuple (StructExprTuple &&other) = default;
- StructExprTuple &operator= (StructExprTuple &&other) = default;
-
- Location get_locus () const override final { return locus; }
-
- void accept_vis (ASTVisitor &vis) override;
-
- const std::vector<std::unique_ptr<Expr> > &get_elems () const
- {
- return exprs;
- }
- std::vector<std::unique_ptr<Expr> > &get_elems () { return exprs; }
-
-protected:
- /* Use covariance to implement clone function as returning this object rather
- * than base */
- StructExprTuple *clone_expr_without_block_impl () const override
- {
- return new StructExprTuple (*this);
- }
-};
-
-// AST node of a "unit" struct creator (no fields and no braces)
-class StructExprUnit : public StructExpr
-{
- Location locus;
-
-public:
- std::string as_string () const override
- {
- return get_struct_name ().as_string ();
- }
-
- StructExprUnit (PathInExpression struct_path,
- std::vector<Attribute> outer_attribs, Location locus)
- : StructExpr (std::move (struct_path), std::move (outer_attribs)),
- locus (locus)
- {}
-
- Location get_locus () const override final { return locus; }
-
- void accept_vis (ASTVisitor &vis) override;
-
-protected:
- /* Use covariance to implement clone function as returning this object rather
- * than base */
- StructExprUnit *clone_expr_without_block_impl () const override
- {
- return new StructExprUnit (*this);
- }
-};
-
-// aka EnumerationVariantExpr
-// Base AST node representing creation of an enum variant instance - abstract
-class EnumVariantExpr : public ExprWithoutBlock
-{
- std::vector<Attribute> outer_attrs;
- PathInExpression enum_variant_path;
-
-protected:
- // Protected constructor for initialising enum_variant_path
- EnumVariantExpr (PathInExpression path_to_enum_variant,
- std::vector<Attribute> outer_attribs)
- : outer_attrs (std::move (outer_attribs)),
- enum_variant_path (std::move (path_to_enum_variant))
- {}
-
-public:
- const PathInExpression &get_enum_variant_path () const
- {
- return enum_variant_path;
- }
- PathInExpression &get_enum_variant_path () { return enum_variant_path; }
-
- // Invalid if path is in error state, so base stripping on that.
- void mark_for_strip () override
- {
- enum_variant_path = PathInExpression::create_error ();
- }
- bool is_marked_for_strip () const override
- {
- return enum_variant_path.is_error ();
- }
-
- const std::vector<Attribute> &get_outer_attrs () const { return outer_attrs; }
- std::vector<Attribute> &get_outer_attrs () { return outer_attrs; }
-
- void set_outer_attrs (std::vector<Attribute> new_attrs) override
- {
- outer_attrs = std::move (new_attrs);
- }
-};
-
-/* Base AST node for a single enum expression field (in enum instance creation)
- * - abstract */
-class EnumExprField
-{
-public:
- virtual ~EnumExprField () {}
-
- // Unique pointer custom clone function
- std::unique_ptr<EnumExprField> clone_enum_expr_field () const
- {
- return std::unique_ptr<EnumExprField> (clone_enum_expr_field_impl ());
- }
-
- virtual std::string as_string () const = 0;
-
- virtual void accept_vis (ASTVisitor &vis) = 0;
-
- virtual Location get_locus () const = 0;
-
-protected:
- // Clone function implementation as pure virtual method
- virtual EnumExprField *clone_enum_expr_field_impl () const = 0;
-};
-
-// Identifier-only variant of EnumExprField AST node
-class EnumExprFieldIdentifier : public EnumExprField
-{
- Identifier field_name;
- Location locus;
-
-public:
- EnumExprFieldIdentifier (Identifier field_identifier, Location locus)
- : field_name (std::move (field_identifier)), locus (locus)
- {}
-
- void accept_vis (ASTVisitor &vis) override;
-
- std::string as_string () const override { return field_name; }
-
- Location get_locus () const override final { return locus; }
-
-protected:
- /* Use covariance to implement clone function as returning this object rather
- * than base */
- EnumExprFieldIdentifier *clone_enum_expr_field_impl () const override
- {
- return new EnumExprFieldIdentifier (*this);
- }
-};
-
-/* Base AST node for a single enum expression field with an assigned value -
- * abstract */
-class EnumExprFieldWithVal : public EnumExprField
-{
- std::unique_ptr<Expr> value;
-
-protected:
- EnumExprFieldWithVal (std::unique_ptr<Expr> field_value)
- : value (std::move (field_value))
- {}
-
- // Copy constructor must clone unique_ptr value
- EnumExprFieldWithVal (EnumExprFieldWithVal const &other)
- : value (other.value->clone_expr ())
- {}
-
- // Overload assignment operator to clone
- EnumExprFieldWithVal &operator= (EnumExprFieldWithVal const &other)
- {
- value = other.value->clone_expr ();
-
- return *this;
- }
-
- // move constructors
- EnumExprFieldWithVal (EnumExprFieldWithVal &&other) = default;
- EnumExprFieldWithVal &operator= (EnumExprFieldWithVal &&other) = default;
-
-public:
- std::string as_string () const override;
-
- // TODO: is this better? Or is a "vis_block" better?
- std::unique_ptr<Expr> &get_value ()
- {
- rust_assert (value != nullptr);
- return value;
- }
-};
-
-// Identifier and value variant of EnumExprField AST node
-class EnumExprFieldIdentifierValue : public EnumExprFieldWithVal
-{
- Identifier field_name;
- Location locus;
-
-public:
- EnumExprFieldIdentifierValue (Identifier field_name,
- std::unique_ptr<Expr> field_value,
- Location locus)
- : EnumExprFieldWithVal (std::move (field_value)),
- field_name (std::move (field_name)), locus (locus)
- {}
-
- std::string as_string () const override;
-
- void accept_vis (ASTVisitor &vis) override;
-
- Location get_locus () const override final { return locus; }
-
-protected:
- /* Use covariance to implement clone function as returning this object rather
- * than base */
- EnumExprFieldIdentifierValue *clone_enum_expr_field_impl () const override
- {
- return new EnumExprFieldIdentifierValue (*this);
- }
-};
-
-// Tuple index and value variant of EnumExprField AST node
-class EnumExprFieldIndexValue : public EnumExprFieldWithVal
-{
- TupleIndex index;
- // TODO: implement "with val" as a template with EnumExprField as type param?
-
- Location locus;
-
-public:
- EnumExprFieldIndexValue (TupleIndex field_index,
- std::unique_ptr<Expr> field_value, Location locus)
- : EnumExprFieldWithVal (std::move (field_value)), index (field_index),
- locus (locus)
- {}
-
- std::string as_string () const override;
-
- void accept_vis (ASTVisitor &vis) override;
-
- Location get_locus () const override final { return locus; }
-
-protected:
- /* Use covariance to implement clone function as returning this object rather
- * than base */
- EnumExprFieldIndexValue *clone_enum_expr_field_impl () const override
- {
- return new EnumExprFieldIndexValue (*this);
- }
-};
-
-// Struct-like syntax enum variant instance creation AST node
-class EnumExprStruct : public EnumVariantExpr
-{
- std::vector<std::unique_ptr<EnumExprField> > fields;
- Location locus;
-
-public:
- std::string as_string () const override;
-
- EnumExprStruct (PathInExpression enum_variant_path,
- std::vector<std::unique_ptr<EnumExprField> > variant_fields,
- std::vector<Attribute> outer_attribs, Location locus)
- : EnumVariantExpr (std::move (enum_variant_path),
- std::move (outer_attribs)),
- fields (std::move (variant_fields)), locus (locus)
- {}
-
- // copy constructor with vector clone
- EnumExprStruct (EnumExprStruct const &other)
- : EnumVariantExpr (other), locus (other.locus)
- {
- fields.reserve (other.fields.size ());
- for (const auto &e : other.fields)
- fields.push_back (e->clone_enum_expr_field ());
- }
-
- // overloaded assignment operator with vector clone
- EnumExprStruct &operator= (EnumExprStruct const &other)
- {
- EnumVariantExpr::operator= (other);
- locus = other.locus;
-
- fields.reserve (other.fields.size ());
- for (const auto &e : other.fields)
- fields.push_back (e->clone_enum_expr_field ());
-
- return *this;
- }
-
- // move constructors
- EnumExprStruct (EnumExprStruct &&other) = default;
- EnumExprStruct &operator= (EnumExprStruct &&other) = default;
-
- Location get_locus () const override final { return locus; }
-
- void accept_vis (ASTVisitor &vis) override;
-
- // TODO: this mutable getter seems really dodgy. Think up better way.
- std::vector<std::unique_ptr<EnumExprField> > &get_fields () { return fields; }
- const std::vector<std::unique_ptr<EnumExprField> > &get_fields () const
- {
- return fields;
- }
-
-protected:
- /* Use covariance to implement clone function as returning this object rather
- * than base */
- EnumExprStruct *clone_expr_without_block_impl () const override
- {
- return new EnumExprStruct (*this);
- }
-};
-
-// Tuple-like syntax enum variant instance creation AST node
-class EnumExprTuple : public EnumVariantExpr
-{
- std::vector<std::unique_ptr<Expr> > values;
- Location locus;
-
-public:
- std::string as_string () const override;
-
- EnumExprTuple (PathInExpression enum_variant_path,
- std::vector<std::unique_ptr<Expr> > variant_values,
- std::vector<Attribute> outer_attribs, Location locus)
- : EnumVariantExpr (std::move (enum_variant_path),
- std::move (outer_attribs)),
- values (std::move (variant_values)), locus (locus)
- {}
-
- // copy constructor with vector clone
- EnumExprTuple (EnumExprTuple const &other)
- : EnumVariantExpr (other), locus (other.locus)
- {
- values.reserve (other.values.size ());
- for (const auto &e : other.values)
- values.push_back (e->clone_expr ());
- }
-
- // overloaded assignment operator with vector clone
- EnumExprTuple &operator= (EnumExprTuple const &other)
- {
- EnumVariantExpr::operator= (other);
- locus = other.locus;
-
- values.reserve (other.values.size ());
- for (const auto &e : other.values)
- values.push_back (e->clone_expr ());
-
- return *this;
- }
-
- // move constructors
- EnumExprTuple (EnumExprTuple &&other) = default;
- EnumExprTuple &operator= (EnumExprTuple &&other) = default;
-
- Location get_locus () const override final { return locus; }
-
- void accept_vis (ASTVisitor &vis) override;
-
- const std::vector<std::unique_ptr<Expr> > &get_elems () const
- {
- return values;
- }
- std::vector<std::unique_ptr<Expr> > &get_elems () { return values; }
-
-protected:
- /* Use covariance to implement clone function as returning this object rather
- * than base */
- EnumExprTuple *clone_expr_without_block_impl () const override
- {
- return new EnumExprTuple (*this);
- }
-};
-
-// No-field enum variant instance creation AST node
-class EnumExprFieldless : public EnumVariantExpr
-{
- Location locus;
-
-public:
- std::string as_string () const override
- {
- // return enum_variant_path.as_string();
- return get_enum_variant_path ().as_string ();
- }
-
- EnumExprFieldless (PathInExpression enum_variant_path,
- std::vector<Attribute> outer_attribs, Location locus)
- : EnumVariantExpr (std::move (enum_variant_path),
- std::move (outer_attribs)),
- locus (locus)
- {}
-
- Location get_locus () const override final { return locus; }
-
- void accept_vis (ASTVisitor &vis) override;
-
-protected:
- /* Use covariance to implement clone function as returning this object rather
- * than base */
- EnumExprFieldless *clone_expr_without_block_impl () const override
- {
- return new EnumExprFieldless (*this);
- }
-};
-
// Forward decl for Function - used in CallExpr
class Function;
diff --git a/gcc/rust/backend/rust-compile-base.h b/gcc/rust/backend/rust-compile-base.h
index 3daad5f..c0cfacf 100644
--- a/gcc/rust/backend/rust-compile-base.h
+++ b/gcc/rust/backend/rust-compile-base.h
@@ -72,15 +72,6 @@ public:
virtual void visit (HIR::StructExprFieldIndexValue &field) {}
virtual void visit (HIR::StructExprStructFields &expr) {}
virtual void visit (HIR::StructExprStructBase &expr) {}
- virtual void visit (HIR::StructExprTuple &expr) {}
- virtual void visit (HIR::StructExprUnit &expr) {}
- // virtual void visit(EnumExprField& field) {}
- virtual void visit (HIR::EnumExprFieldIdentifier &field) {}
- virtual void visit (HIR::EnumExprFieldIdentifierValue &field) {}
- virtual void visit (HIR::EnumExprFieldIndexValue &field) {}
- virtual void visit (HIR::EnumExprStruct &expr) {}
- virtual void visit (HIR::EnumExprTuple &expr) {}
- virtual void visit (HIR::EnumExprFieldless &expr) {}
virtual void visit (HIR::CallExpr &expr) {}
virtual void visit (HIR::MethodCallExpr &expr) {}
virtual void visit (HIR::FieldAccessExpr &expr) {}
diff --git a/gcc/rust/expand/rust-macro-expand.cc b/gcc/rust/expand/rust-macro-expand.cc
index e4855e0..8134f7e 100644
--- a/gcc/rust/expand/rust-macro-expand.cc
+++ b/gcc/rust/expand/rust-macro-expand.cc
@@ -939,142 +939,6 @@ public:
"cannot strip expression in this position - outer "
"attributes not allowed");
}
- void visit (AST::StructExprTuple &expr) override
- {
- // initial strip test based on outer attrs
- expander.expand_cfg_attrs (expr.get_outer_attrs ());
- if (expander.fails_cfg_with_expand (expr.get_outer_attrs ()))
- {
- expr.mark_for_strip ();
- return;
- }
-
- /* strip test based on inner attrs - spec says these are inner
- * attributes, not outer attributes of inner expr */
- expander.expand_cfg_attrs (expr.get_inner_attrs ());
- if (expander.fails_cfg_with_expand (expr.get_inner_attrs ()))
- {
- expr.mark_for_strip ();
- return;
- }
-
- // strip sub-exprs of path
- auto &struct_name = expr.get_struct_name ();
- visit (struct_name);
- if (struct_name.is_marked_for_strip ())
- rust_error_at (struct_name.get_locus (),
- "cannot strip path in this position");
-
- /* spec says outer attributes are specifically allowed for elements
- * of tuple-style struct expressions, so full stripping possible */
- expand_pointer_allow_strip (expr.get_elems ());
- }
- void visit (AST::StructExprUnit &expr) override
- {
- // initial strip test based on outer attrs
- expander.expand_cfg_attrs (expr.get_outer_attrs ());
- if (expander.fails_cfg_with_expand (expr.get_outer_attrs ()))
- {
- expr.mark_for_strip ();
- return;
- }
-
- // strip sub-exprs of path
- auto &struct_name = expr.get_struct_name ();
- visit (struct_name);
- if (struct_name.is_marked_for_strip ())
- rust_error_at (struct_name.get_locus (),
- "cannot strip path in this position");
- }
- void visit (AST::EnumExprFieldIdentifier &) override
- {
- // as no attrs (at moment, at least), no stripping possible
- }
- void visit (AST::EnumExprFieldIdentifierValue &field) override
- {
- /* as no attrs possible (at moment, at least), only sub-expression
- * stripping is possible */
- auto &value = field.get_value ();
- value->accept_vis (*this);
- if (value->is_marked_for_strip ())
- rust_error_at (value->get_locus (),
- "cannot strip expression in this position - outer "
- "attributes not allowed");
- }
- void visit (AST::EnumExprFieldIndexValue &field) override
- {
- /* as no attrs possible (at moment, at least), only sub-expression
- * stripping is possible */
- auto &value = field.get_value ();
- value->accept_vis (*this);
- if (value->is_marked_for_strip ())
- rust_error_at (value->get_locus (),
- "cannot strip expression in this position - outer "
- "attributes not allowed");
- }
- void visit (AST::EnumExprStruct &expr) override
- {
- // initial strip test based on outer attrs
- expander.expand_cfg_attrs (expr.get_outer_attrs ());
- if (expander.fails_cfg_with_expand (expr.get_outer_attrs ()))
- {
- expr.mark_for_strip ();
- return;
- }
-
- // supposedly spec doesn't allow inner attributes in enum exprs
-
- // strip sub-exprs of path
- auto &enum_path = expr.get_enum_variant_path ();
- visit (enum_path);
- if (enum_path.is_marked_for_strip ())
- rust_error_at (enum_path.get_locus (),
- "cannot strip path in this position");
-
- /* spec does not specify whether expressions are allowed to be
- * stripped at top level of expression fields, but I wouldn't think
- * that they would be, so operating under the assumption that only
- * sub-expressions can be stripped. */
- for (auto &field : expr.get_fields ())
- {
- field->accept_vis (*this);
- // shouldn't strip in this
- }
- }
- void visit (AST::EnumExprTuple &expr) override
- {
- // initial strip test based on outer attrs
- expander.expand_cfg_attrs (expr.get_outer_attrs ());
- if (expander.fails_cfg_with_expand (expr.get_outer_attrs ()))
- {
- expr.mark_for_strip ();
- return;
- }
-
- // supposedly spec doesn't allow inner attributes in enum exprs
-
- // strip sub-exprs of path
- auto &enum_path = expr.get_enum_variant_path ();
- visit (enum_path);
- if (enum_path.is_marked_for_strip ())
- rust_error_at (enum_path.get_locus (),
- "cannot strip path in this position");
-
- /* spec says outer attributes are specifically allowed for elements
- * of tuple-style enum expressions, so full stripping possible */
- expand_pointer_allow_strip (expr.get_elems ());
- }
- void visit (AST::EnumExprFieldless &expr) override
- {
- // can't be stripped as no attrs
-
- // strip sub-exprs of path
- auto &enum_path = expr.get_enum_variant_path ();
- visit (enum_path);
- if (enum_path.is_marked_for_strip ())
- rust_error_at (enum_path.get_locus (),
- "cannot strip path in this position");
- }
void visit (AST::CallExpr &expr) override
{
// initial strip test based on outer attrs
diff --git a/gcc/rust/hir/rust-ast-lower-base.h b/gcc/rust/hir/rust-ast-lower-base.h
index 07489f8..d445599 100644
--- a/gcc/rust/hir/rust-ast-lower-base.h
+++ b/gcc/rust/hir/rust-ast-lower-base.h
@@ -96,15 +96,6 @@ public:
virtual void visit (AST::StructExprFieldIndexValue &field) {}
virtual void visit (AST::StructExprStructFields &expr) {}
virtual void visit (AST::StructExprStructBase &expr) {}
- virtual void visit (AST::StructExprTuple &expr) {}
- virtual void visit (AST::StructExprUnit &expr) {}
- // virtual void visit(EnumExprField& field) {}
- virtual void visit (AST::EnumExprFieldIdentifier &field) {}
- virtual void visit (AST::EnumExprFieldIdentifierValue &field) {}
- virtual void visit (AST::EnumExprFieldIndexValue &field) {}
- virtual void visit (AST::EnumExprStruct &expr) {}
- virtual void visit (AST::EnumExprTuple &expr) {}
- virtual void visit (AST::EnumExprFieldless &expr) {}
virtual void visit (AST::CallExpr &expr) {}
virtual void visit (AST::MethodCallExpr &expr) {}
virtual void visit (AST::FieldAccessExpr &expr) {}
diff --git a/gcc/rust/hir/tree/rust-hir-expr.h b/gcc/rust/hir/tree/rust-hir-expr.h
index bb15d4f..05bc1f9 100644
--- a/gcc/rust/hir/tree/rust-hir-expr.h
+++ b/gcc/rust/hir/tree/rust-hir-expr.h
@@ -1578,441 +1578,6 @@ protected:
}
};
-// HIR node of a tuple struct creator
-class StructExprTuple : public StructExpr
-{
- AST::AttrVec inner_attrs;
- std::vector<std::unique_ptr<Expr> > exprs;
-
- Location locus;
-
-public:
- std::string as_string () const override;
-
- const AST::AttrVec &get_inner_attrs () const { return inner_attrs; }
-
- /*inline std::vector<std::unique_ptr<Expr>> get_exprs() const {
- return exprs;
- }*/
-
- StructExprTuple (Analysis::NodeMapping mappings, PathInExpression struct_path,
- std::vector<std::unique_ptr<Expr> > tuple_exprs,
- AST::AttrVec inner_attribs, AST::AttrVec outer_attribs,
- Location locus)
- : StructExpr (std::move (mappings), std::move (struct_path),
- std::move (outer_attribs)),
- inner_attrs (std::move (inner_attribs)), exprs (std::move (tuple_exprs)),
- locus (locus)
- {}
-
- // copy constructor with vector clone
- StructExprTuple (StructExprTuple const &other)
- : StructExpr (other), inner_attrs (other.inner_attrs), locus (other.locus)
- {
- exprs.reserve (other.exprs.size ());
- for (const auto &e : other.exprs)
- exprs.push_back (e->clone_expr ());
- }
-
- // overloaded assignment operator with vector clone
- StructExprTuple &operator= (StructExprTuple const &other)
- {
- StructExpr::operator= (other);
- inner_attrs = other.inner_attrs;
- locus = other.locus;
-
- exprs.reserve (other.exprs.size ());
- for (const auto &e : other.exprs)
- exprs.push_back (e->clone_expr ());
-
- return *this;
- }
-
- // move constructors
- StructExprTuple (StructExprTuple &&other) = default;
- StructExprTuple &operator= (StructExprTuple &&other) = default;
-
- Location get_locus () const override final { return locus; }
-
- void accept_vis (HIRVisitor &vis) override;
-
-protected:
- /* Use covariance to implement clone function as returning this object rather
- * than base */
- StructExprTuple *clone_expr_impl () const override
- {
- return new StructExprTuple (*this);
- }
-
- /* Use covariance to implement clone function as returning this object rather
- * than base */
- StructExprTuple *clone_expr_without_block_impl () const override
- {
- return new StructExprTuple (*this);
- }
-};
-
-// HIR node of a "unit" struct creator (no fields and no braces)
-class StructExprUnit : public StructExpr
-{
- Location locus;
-
-public:
- std::string as_string () const override { return struct_name.as_string (); }
-
- StructExprUnit (Analysis::NodeMapping mappings, PathInExpression struct_path,
- AST::AttrVec outer_attribs, Location locus)
- : StructExpr (std::move (mappings), std::move (struct_path),
- std::move (outer_attribs)),
- locus (locus)
- {}
-
- Location get_locus () const override final { return locus; }
-
- void accept_vis (HIRVisitor &vis) override;
-
-protected:
- /* Use covariance to implement clone function as returning this object rather
- * than base */
- StructExprUnit *clone_expr_impl () const override
- {
- return new StructExprUnit (*this);
- }
-
- /* Use covariance to implement clone function as returning this object rather
- * than base */
- StructExprUnit *clone_expr_without_block_impl () const override
- {
- return new StructExprUnit (*this);
- }
-};
-
-// aka EnumerationVariantExpr
-// Base HIR node representing creation of an enum variant instance - abstract
-class EnumVariantExpr : public ExprWithoutBlock
-{
- PathInExpression enum_variant_path;
-
-protected:
- // Protected constructor for initialising enum_variant_path
- EnumVariantExpr (Analysis::NodeMapping mappings,
- PathInExpression path_to_enum_variant,
- AST::AttrVec outer_attribs)
- : ExprWithoutBlock (std::move (mappings), std::move (outer_attribs)),
- enum_variant_path (std::move (path_to_enum_variant))
- {}
-
-public:
- // TODO: maybe remove and have string version gotten here directly
- PathInExpression get_enum_variant_path () const { return enum_variant_path; }
-};
-
-/* Base HIR node for a single enum expression field (in enum instance creation)
- * - abstract */
-class EnumExprField
-{
-public:
- virtual ~EnumExprField () {}
-
- // Unique pointer custom clone function
- std::unique_ptr<EnumExprField> clone_enum_expr_field () const
- {
- return std::unique_ptr<EnumExprField> (clone_enum_expr_field_impl ());
- }
-
- virtual void accept_vis (HIRVisitor &vis) = 0;
-
-protected:
- // Clone function implementation as pure virtual method
- virtual EnumExprField *clone_enum_expr_field_impl () const = 0;
-};
-
-// Identifier-only variant of EnumExprField HIR node
-class EnumExprFieldIdentifier : public EnumExprField
-{
- Identifier field_name;
-
- // TODO: should this store location data?
-
-public:
- EnumExprFieldIdentifier (Identifier field_identifier)
- : field_name (std::move (field_identifier))
- {}
-
- void accept_vis (HIRVisitor &vis) override;
-
-protected:
- /* Use covariance to implement clone function as returning this object rather
- * than base */
- EnumExprFieldIdentifier *clone_enum_expr_field_impl () const override
- {
- return new EnumExprFieldIdentifier (*this);
- }
-};
-
-/* Base HIR node for a single enum expression field with an assigned value -
- * abstract */
-class EnumExprFieldWithVal : public EnumExprField
-{
- std::unique_ptr<Expr> value;
-
- // TODO: should this store location data?
-
-protected:
- EnumExprFieldWithVal (std::unique_ptr<Expr> field_value)
- : value (std::move (field_value))
- {}
-
- // Copy constructor must clone unique_ptr value
- EnumExprFieldWithVal (EnumExprFieldWithVal const &other)
- : value (other.value->clone_expr ())
- {}
-
- // Overload assignment operator to clone
- EnumExprFieldWithVal &operator= (EnumExprFieldWithVal const &other)
- {
- value = other.value->clone_expr ();
-
- return *this;
- }
-
- // move constructors
- EnumExprFieldWithVal (EnumExprFieldWithVal &&other) = default;
- EnumExprFieldWithVal &operator= (EnumExprFieldWithVal &&other) = default;
-};
-
-// Identifier and value variant of EnumExprField HIR node
-class EnumExprFieldIdentifierValue : public EnumExprFieldWithVal
-{
- Identifier field_name;
-
- // TODO: should this store location data?
-
-public:
- EnumExprFieldIdentifierValue (Identifier field_name,
- std::unique_ptr<Expr> field_value)
- : EnumExprFieldWithVal (std::move (field_value)),
- field_name (std::move (field_name))
- {}
-
- // copy constructor, destructor, and assignment operator should not need
- // defining
-
- void accept_vis (HIRVisitor &vis) override;
-
-protected:
- /* Use covariance to implement clone function as returning this object rather
- * than base */
- EnumExprFieldIdentifierValue *clone_enum_expr_field_impl () const override
- {
- return new EnumExprFieldIdentifierValue (*this);
- }
-};
-
-// Tuple index and value variant of EnumExprField HIR node
-class EnumExprFieldIndexValue : public EnumExprFieldWithVal
-{
- TupleIndex index;
- // TODO: implement "with val" as a template with EnumExprField as type param?
-
- // TODO: should this store location data?
-
-public:
- EnumExprFieldIndexValue (TupleIndex field_index,
- std::unique_ptr<Expr> field_value)
- : EnumExprFieldWithVal (std::move (field_value)), index (field_index)
- {}
-
- void accept_vis (HIRVisitor &vis) override;
-
-protected:
- /* Use covariance to implement clone function as returning this object rather
- * than base */
- EnumExprFieldIndexValue *clone_enum_expr_field_impl () const override
- {
- return new EnumExprFieldIndexValue (*this);
- }
-};
-
-// Struct-like syntax enum variant instance creation HIR node
-class EnumExprStruct : public EnumVariantExpr
-{
- // std::vector<EnumExprField> fields;
- std::vector<std::unique_ptr<EnumExprField> > fields;
-
- Location locus;
-
-public:
- std::string as_string () const override;
-
- /*inline std::vector<std::unique_ptr<EnumExprField>> get_fields() const
- { return fields;
- }*/
-
- EnumExprStruct (Analysis::NodeMapping mappings,
- PathInExpression enum_variant_path,
- std::vector<std::unique_ptr<EnumExprField> > variant_fields,
- AST::AttrVec outer_attribs, Location locus)
- : EnumVariantExpr (std::move (mappings), std::move (enum_variant_path),
- std::move (outer_attribs)),
- fields (std::move (variant_fields)), locus (locus)
- {}
-
- // copy constructor with vector clone
- EnumExprStruct (EnumExprStruct const &other)
- : EnumVariantExpr (other), locus (other.locus)
- {
- fields.reserve (other.fields.size ());
- for (const auto &e : other.fields)
- fields.push_back (e->clone_enum_expr_field ());
- }
-
- // overloaded assignment operator with vector clone
- EnumExprStruct &operator= (EnumExprStruct const &other)
- {
- EnumVariantExpr::operator= (other);
- locus = other.locus;
-
- fields.reserve (other.fields.size ());
- for (const auto &e : other.fields)
- fields.push_back (e->clone_enum_expr_field ());
-
- return *this;
- }
-
- // move constructors
- EnumExprStruct (EnumExprStruct &&other) = default;
- EnumExprStruct &operator= (EnumExprStruct &&other) = default;
-
- Location get_locus () const override final { return locus; }
-
- void accept_vis (HIRVisitor &vis) override;
-
-protected:
- /* Use covariance to implement clone function as returning this object rather
- * than base */
- EnumExprStruct *clone_expr_impl () const override
- {
- return new EnumExprStruct (*this);
- }
-
- /* Use covariance to implement clone function as returning this object rather
- * than base */
- EnumExprStruct *clone_expr_without_block_impl () const override
- {
- return new EnumExprStruct (*this);
- }
-};
-
-// Tuple-like syntax enum variant instance creation HIR node
-class EnumExprTuple : public EnumVariantExpr
-{
- std::vector<std::unique_ptr<Expr> > values;
-
- Location locus;
-
-public:
- std::string as_string () const override;
-
- /*inline std::vector<std::unique_ptr<Expr>> get_values() const {
- return values;
- }*/
-
- EnumExprTuple (Analysis::NodeMapping mappings,
- PathInExpression enum_variant_path,
- std::vector<std::unique_ptr<Expr> > variant_values,
- AST::AttrVec outer_attribs, Location locus)
- : EnumVariantExpr (std::move (mappings), std::move (enum_variant_path),
- std::move (outer_attribs)),
- values (std::move (variant_values)), locus (locus)
- {}
-
- // copy constructor with vector clone
- EnumExprTuple (EnumExprTuple const &other)
- : EnumVariantExpr (other), locus (other.locus)
- {
- values.reserve (other.values.size ());
- for (const auto &e : other.values)
- values.push_back (e->clone_expr ());
- }
-
- // overloaded assignment operator with vector clone
- EnumExprTuple &operator= (EnumExprTuple const &other)
- {
- EnumVariantExpr::operator= (other);
- locus = other.locus;
-
- values.reserve (other.values.size ());
- for (const auto &e : other.values)
- values.push_back (e->clone_expr ());
-
- return *this;
- }
-
- // move constructors
- EnumExprTuple (EnumExprTuple &&other) = default;
- EnumExprTuple &operator= (EnumExprTuple &&other) = default;
-
- Location get_locus () const override final { return locus; }
-
- void accept_vis (HIRVisitor &vis) override;
-
-protected:
- /* Use covariance to implement clone function as returning this object rather
- * than base */
- EnumExprTuple *clone_expr_impl () const override
- {
- return new EnumExprTuple (*this);
- }
-
- /* Use covariance to implement clone function as returning this object rather
- * than base */
- EnumExprTuple *clone_expr_without_block_impl () const override
- {
- return new EnumExprTuple (*this);
- }
-};
-
-// No-field enum variant instance creation HIR node
-class EnumExprFieldless : public EnumVariantExpr
-{
- Location locus;
-
-public:
- std::string as_string () const override
- {
- // return enum_variant_path.as_string();
- return get_enum_variant_path ().as_string ();
- }
-
- EnumExprFieldless (Analysis::NodeMapping mappings,
- PathInExpression enum_variant_path,
- AST::AttrVec outer_attribs, Location locus)
- : EnumVariantExpr (std::move (mappings), std::move (enum_variant_path),
- std::move (outer_attribs)),
- locus (locus)
- {}
-
- Location get_locus () const override final { return locus; }
-
- void accept_vis (HIRVisitor &vis) override;
-
-protected:
- /* Use covariance to implement clone function as returning this object rather
- * than base */
- EnumExprFieldless *clone_expr_impl () const override
- {
- return new EnumExprFieldless (*this);
- }
-
- /* Use covariance to implement clone function as returning this object rather
- * than base */
- EnumExprFieldless *clone_expr_without_block_impl () const override
- {
- return new EnumExprFieldless (*this);
- }
-};
-
// Forward decl for Function - used in CallExpr
class Function;
diff --git a/gcc/rust/hir/tree/rust-hir-full-decls.h b/gcc/rust/hir/tree/rust-hir-full-decls.h
index 41ae398..ffa0812 100644
--- a/gcc/rust/hir/tree/rust-hir-full-decls.h
+++ b/gcc/rust/hir/tree/rust-hir-full-decls.h
@@ -90,17 +90,6 @@ class StructExprFieldIdentifierValue;
class StructExprFieldIndexValue;
class StructExprStructFields;
class StructExprStructBase;
-class StructExprTuple;
-class StructExprUnit;
-class EnumVariantExpr;
-class EnumExprField;
-class EnumExprFieldIdentifier;
-class EnumExprFieldWithVal;
-class EnumExprFieldIdentifierValue;
-class EnumExprFieldIndexValue;
-class EnumExprStruct;
-class EnumExprTuple;
-class EnumExprFieldless;
class CallExpr;
class MethodCallExpr;
class FieldAccessExpr;
diff --git a/gcc/rust/hir/tree/rust-hir-full-test.cc b/gcc/rust/hir/tree/rust-hir-full-test.cc
index ecc282a..f328ae6 100644
--- a/gcc/rust/hir/tree/rust-hir-full-test.cc
+++ b/gcc/rust/hir/tree/rust-hir-full-test.cc
@@ -2995,59 +2995,6 @@ StructExpr::as_string () const
}
std::string
-StructExprTuple::as_string () const
-{
- std::string str = StructExpr::as_string ();
-
- if (exprs.empty ())
- {
- str += "()";
- }
- else
- {
- auto i = exprs.begin ();
- auto e = exprs.end ();
-
- // debug - null pointer check
- if (*i == nullptr)
- {
- return "ERROR_MARK_STRING - nullptr struct expr tuple field";
- }
-
- str += '(';
- for (; i != e; i++)
- {
- str += (*i)->as_string ();
- if (e != i + 1)
- str += ", ";
- }
- str += ')';
- }
-
- indent_spaces (enter);
- indent_spaces (enter);
- // inner attributes
- str += "\n" + indent_spaces (stay) + "inner attributes:";
- if (inner_attrs.empty ())
- {
- str += "none";
- }
- else
- {
- /* note that this does not print them with "inner attribute" syntax -
- * just the body */
- for (const auto &attr : inner_attrs)
- {
- str += "\n" + indent_spaces (stay) + attr.as_string ();
- }
- }
- indent_spaces (out);
- indent_spaces (out);
-
- return str;
-}
-
-std::string
StructExprStruct::as_string () const
{
std::string str ("StructExprStruct (or subclass): ");
@@ -3984,54 +3931,6 @@ StructExprStructBase::accept_vis (HIRVisitor &vis)
}
void
-StructExprTuple::accept_vis (HIRVisitor &vis)
-{
- vis.visit (*this);
-}
-
-void
-StructExprUnit::accept_vis (HIRVisitor &vis)
-{
- vis.visit (*this);
-}
-
-void
-EnumExprFieldIdentifier::accept_vis (HIRVisitor &vis)
-{
- vis.visit (*this);
-}
-
-void
-EnumExprFieldIdentifierValue::accept_vis (HIRVisitor &vis)
-{
- vis.visit (*this);
-}
-
-void
-EnumExprFieldIndexValue::accept_vis (HIRVisitor &vis)
-{
- vis.visit (*this);
-}
-
-void
-EnumExprStruct::accept_vis (HIRVisitor &vis)
-{
- vis.visit (*this);
-}
-
-void
-EnumExprTuple::accept_vis (HIRVisitor &vis)
-{
- vis.visit (*this);
-}
-
-void
-EnumExprFieldless::accept_vis (HIRVisitor &vis)
-{
- vis.visit (*this);
-}
-
-void
CallExpr::accept_vis (HIRVisitor &vis)
{
vis.visit (*this);
diff --git a/gcc/rust/hir/tree/rust-hir-visitor.h b/gcc/rust/hir/tree/rust-hir-visitor.h
index 6372543..d5fbff9 100644
--- a/gcc/rust/hir/tree/rust-hir-visitor.h
+++ b/gcc/rust/hir/tree/rust-hir-visitor.h
@@ -60,14 +60,6 @@ public:
virtual void visit (StructExprFieldIndexValue &field) = 0;
virtual void visit (StructExprStructFields &expr) = 0;
virtual void visit (StructExprStructBase &expr) = 0;
- virtual void visit (StructExprTuple &expr) = 0;
- virtual void visit (StructExprUnit &expr) = 0;
- virtual void visit (EnumExprFieldIdentifier &field) = 0;
- virtual void visit (EnumExprFieldIdentifierValue &field) = 0;
- virtual void visit (EnumExprFieldIndexValue &field) = 0;
- virtual void visit (EnumExprStruct &expr) = 0;
- virtual void visit (EnumExprTuple &expr) = 0;
- virtual void visit (EnumExprFieldless &expr) = 0;
virtual void visit (CallExpr &expr) = 0;
virtual void visit (MethodCallExpr &expr) = 0;
virtual void visit (FieldAccessExpr &expr) = 0;
diff --git a/gcc/rust/lint/rust-lint-marklive-base.h b/gcc/rust/lint/rust-lint-marklive-base.h
index 229643f..e7b0194 100644
--- a/gcc/rust/lint/rust-lint-marklive-base.h
+++ b/gcc/rust/lint/rust-lint-marklive-base.h
@@ -70,16 +70,7 @@ public:
virtual void visit (HIR::StructExprFieldIndexValue &) override {}
virtual void visit (HIR::StructExprStructFields &) override {}
virtual void visit (HIR::StructExprStructBase &) override {}
- virtual void visit (HIR::StructExprTuple &) override {}
- virtual void visit (HIR::StructExprUnit &) override {}
- virtual void visit (HIR::EnumExprFieldIdentifier &) override {}
- virtual void visit (HIR::EnumExprFieldIdentifierValue &) override {}
-
- virtual void visit (HIR::EnumExprFieldIndexValue &) override {}
- virtual void visit (HIR::EnumExprStruct &) override {}
- virtual void visit (HIR::EnumExprTuple &) override {}
- virtual void visit (HIR::EnumExprFieldless &) override {}
virtual void visit (HIR::CallExpr &) override {}
virtual void visit (HIR::MethodCallExpr &) override {}
virtual void visit (HIR::FieldAccessExpr &) override {}
diff --git a/gcc/rust/resolve/rust-ast-resolve-base.h b/gcc/rust/resolve/rust-ast-resolve-base.h
index 10e2b1b..025052d 100644
--- a/gcc/rust/resolve/rust-ast-resolve-base.h
+++ b/gcc/rust/resolve/rust-ast-resolve-base.h
@@ -73,14 +73,6 @@ public:
void visit (AST::StructExprFieldIndexValue &) {}
void visit (AST::StructExprStructFields &) {}
void visit (AST::StructExprStructBase &) {}
- void visit (AST::StructExprTuple &) {}
- void visit (AST::StructExprUnit &) {}
- void visit (AST::EnumExprFieldIdentifier &) {}
- void visit (AST::EnumExprFieldIdentifierValue &) {}
- void visit (AST::EnumExprFieldIndexValue &) {}
- void visit (AST::EnumExprStruct &) {}
- void visit (AST::EnumExprTuple &) {}
- void visit (AST::EnumExprFieldless &) {}
void visit (AST::CallExpr &) {}
void visit (AST::MethodCallExpr &) {}
void visit (AST::FieldAccessExpr &) {}
diff --git a/gcc/rust/typecheck/rust-hir-const-fold-base.h b/gcc/rust/typecheck/rust-hir-const-fold-base.h
index 1829b85..0c23ec8 100644
--- a/gcc/rust/typecheck/rust-hir-const-fold-base.h
+++ b/gcc/rust/typecheck/rust-hir-const-fold-base.h
@@ -73,16 +73,7 @@ public:
virtual void visit (HIR::StructExprFieldIndexValue &) override {}
virtual void visit (HIR::StructExprStructFields &) override {}
virtual void visit (HIR::StructExprStructBase &) override {}
- virtual void visit (HIR::StructExprTuple &) override {}
- virtual void visit (HIR::StructExprUnit &) override {}
- virtual void visit (HIR::EnumExprFieldIdentifier &) override {}
- virtual void visit (HIR::EnumExprFieldIdentifierValue &) override {}
-
- virtual void visit (HIR::EnumExprFieldIndexValue &) override {}
- virtual void visit (HIR::EnumExprStruct &) override {}
- virtual void visit (HIR::EnumExprTuple &) override {}
- virtual void visit (HIR::EnumExprFieldless &) override {}
virtual void visit (HIR::CallExpr &) override {}
virtual void visit (HIR::MethodCallExpr &) override {}
virtual void visit (HIR::FieldAccessExpr &) override {}
diff --git a/gcc/rust/typecheck/rust-hir-type-check-base.h b/gcc/rust/typecheck/rust-hir-type-check-base.h
index 3050814..26fb506 100644
--- a/gcc/rust/typecheck/rust-hir-type-check-base.h
+++ b/gcc/rust/typecheck/rust-hir-type-check-base.h
@@ -74,16 +74,7 @@ public:
virtual void visit (HIR::StructExprFieldIndexValue &) override {}
virtual void visit (HIR::StructExprStructFields &) override {}
virtual void visit (HIR::StructExprStructBase &) override {}
- virtual void visit (HIR::StructExprTuple &) override {}
- virtual void visit (HIR::StructExprUnit &) override {}
- virtual void visit (HIR::EnumExprFieldIdentifier &) override {}
- virtual void visit (HIR::EnumExprFieldIdentifierValue &) override {}
-
- virtual void visit (HIR::EnumExprFieldIndexValue &) override {}
- virtual void visit (HIR::EnumExprStruct &) override {}
- virtual void visit (HIR::EnumExprTuple &) override {}
- virtual void visit (HIR::EnumExprFieldless &) override {}
virtual void visit (HIR::CallExpr &) override {}
virtual void visit (HIR::MethodCallExpr &) override {}
virtual void visit (HIR::FieldAccessExpr &) override {}
diff --git a/gcc/rust/typecheck/rust-hir-type-check-util.h b/gcc/rust/typecheck/rust-hir-type-check-util.h
index 8146c6e..78d35a6 100644
--- a/gcc/rust/typecheck/rust-hir-type-check-util.h
+++ b/gcc/rust/typecheck/rust-hir-type-check-util.h
@@ -68,16 +68,7 @@ public:
virtual void visit (HIR::StructExprFieldIndexValue &) override {}
virtual void visit (HIR::StructExprStructFields &) override {}
virtual void visit (HIR::StructExprStructBase &) override {}
- virtual void visit (HIR::StructExprTuple &) override {}
- virtual void visit (HIR::StructExprUnit &) override {}
- virtual void visit (HIR::EnumExprFieldIdentifier &) override {}
- virtual void visit (HIR::EnumExprFieldIdentifierValue &) override {}
-
- virtual void visit (HIR::EnumExprFieldIndexValue &) override {}
- virtual void visit (HIR::EnumExprStruct &) override {}
- virtual void visit (HIR::EnumExprTuple &) override {}
- virtual void visit (HIR::EnumExprFieldless &) override {}
virtual void visit (HIR::CallExpr &) override {}
virtual void visit (HIR::MethodCallExpr &) override {}
virtual void visit (HIR::FieldAccessExpr &) override {}