From fabb3894d5fe5c2ca87917fd08b2f0813553532d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20Poulhi=C3=A8s?= Date: Mon, 8 Mar 2021 21:13:02 +0100 Subject: WIP for #252 Removed TyTy::UnitType and TyTy::TypeKind::UNIT. Replaced by TyTy::TupleType with an empty list of fields. Added default empty vector for fields in ctor for TyTy::TypeType. --- gcc/rust/backend/rust-compile-context.h | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'gcc/rust/backend/rust-compile-context.h') diff --git a/gcc/rust/backend/rust-compile-context.h b/gcc/rust/backend/rust-compile-context.h index 6f45e57..6347464 100644 --- a/gcc/rust/backend/rust-compile-context.h +++ b/gcc/rust/backend/rust-compile-context.h @@ -351,11 +351,6 @@ public: ctx->get_mappings ()->lookup_location (type.get_ref ())); } - void visit (TyTy::UnitType &) override - { - translated = ctx->get_backend ()->void_type (); - } - void visit (TyTy::ADTType &type) override { if (ctx->lookup_compiled_types (type.get_ty_ref (), &translated, &type)) @@ -389,6 +384,12 @@ public: void visit (TyTy::TupleType &type) override { + if (type.num_fields () == 0) + { + translated = ctx->get_backend ()->void_type (); + return; + } + bool ok = ctx->lookup_compiled_types (type.get_ty_ref (), &translated); if (ok) return; -- cgit v1.1