diff options
author | Iain Buclaw <ibuclaw@gdcproject.org> | 2024-03-03 20:28:58 +0100 |
---|---|---|
committer | Iain Buclaw <ibuclaw@gdcproject.org> | 2024-03-03 23:42:56 +0100 |
commit | bbfbaa792b50ebd75b383be25f50c92f30243256 (patch) | |
tree | 745acbaba5cd3643e8e3ed9797a4ca258d2ae1d8 /gcc/d/expr.cc | |
parent | 24975a9195743e8eb4ca213f35b9221d4eeb6b59 (diff) | |
download | gcc-bbfbaa792b50ebd75b383be25f50c92f30243256.zip gcc-bbfbaa792b50ebd75b383be25f50c92f30243256.tar.gz gcc-bbfbaa792b50ebd75b383be25f50c92f30243256.tar.bz2 |
d: Merge upstream dmd, druntime f8bae04558, phobos ba2ade9dec
D front-end changes:
- Import dmd v2.108.1-beta-1.
D runtime changes:
- Import druntime v2.108.1-beta-1.
Phobos changes:
- Import phobos v2.108.1-beta-1.
gcc/d/ChangeLog:
* dmd/MERGE: Merge upstream dmd f8bae04558.
* dmd/VERSION: Bump version to v2.108.0-beta.1.
* d-builtins.cc (build_frontend_type): Update for new front-end
interface.
* d-codegen.cc (build_assert_call): Likewise.
* d-convert.cc (d_array_convert): Likewise.
* decl.cc (get_vtable_decl): Likewise.
* expr.cc (ExprVisitor::visit (EqualExp *)): Likewise.
(ExprVisitor::visit (VarExp *)): Likewise.
(ExprVisitor::visit (ArrayLiteralExp *)): Likewise.
(ExprVisitor::visit (AssocArrayLiteralExp)): Likewise.
* intrinsics.cc (build_shuffle_mask_type): Likewise.
(maybe_warn_intrinsic_mismatch): Likewise.
* runtime.cc (get_libcall_type): Likewise.
* typeinfo.cc (TypeInfoVisitor::layout_string): Likewise.
(TypeInfoVisitor::visit(TypeInfoTupleDeclaration *)): Likewise.
libphobos/ChangeLog:
* libdruntime/MERGE: Merge upstream druntime 02d6d07a69.
* src/MERGE: Merge upstream phobos a2ade9dec.
Diffstat (limited to 'gcc/d/expr.cc')
-rw-r--r-- | gcc/d/expr.cc | 21 |
1 files changed, 11 insertions, 10 deletions
diff --git a/gcc/d/expr.cc b/gcc/d/expr.cc index 7fbabbe..d055e0b 100644 --- a/gcc/d/expr.cc +++ b/gcc/d/expr.cc @@ -464,7 +464,7 @@ public: else { /* Use _adEq2() to compare each element. */ - Type *t1array = t1elem->arrayOf (); + Type *t1array = dmd::arrayOf (t1elem); tree result = build_libcall (LIBCALL_ADEQ2, e->type, 3, d_array_convert (e->e1), d_array_convert (e->e2), @@ -2172,7 +2172,8 @@ public: { /* Generate a slice for non-zero initialized aggregates, otherwise create an empty array. */ - gcc_assert (e->type == dmd::constOf (Type::tvoid->arrayOf ())); + gcc_assert (e->type->isConst () + && e->type->nextOf ()->ty == TY::Tvoid); tree type = build_ctype (e->type); tree length = size_int (sd->dsym->structsize); @@ -2571,7 +2572,7 @@ public: /* Implicitly convert void[n] to ubyte[n]. */ if (tb->ty == TY::Tsarray && tb->nextOf ()->toBasetype ()->ty == TY::Tvoid) - tb = Type::tuns8->sarrayOf (tb->isTypeSArray ()->dim->toUInteger ()); + tb = dmd::sarrayOf (Type::tuns8, tb->isTypeSArray ()->dim->toUInteger ()); gcc_assert (tb->ty == TY::Tarray || tb->ty == TY::Tsarray || tb->ty == TY::Tpointer); @@ -2685,7 +2686,7 @@ public: /* Allocate space on the memory managed heap. */ tree mem = build_libcall (LIBCALL_ARRAYLITERALTX, dmd::pointerTo (etype), 2, - build_typeinfo (e, etype->arrayOf ()), + build_typeinfo (e, dmd::arrayOf (etype)), size_int (e->elements->length)); mem = d_save_expr (mem); @@ -2732,20 +2733,20 @@ public: /* Build an expression that assigns all expressions in KEYS to a constructor. */ - tree akeys = build_array_from_exprs (ta->index->sarrayOf (e->keys->length), - e->keys, this->constp_); + Type *tkarray = dmd::sarrayOf (ta->index, e->keys->length); + tree akeys = build_array_from_exprs (tkarray, e->keys, this->constp_); tree init = stabilize_expr (&akeys); /* Do the same with all expressions in VALUES. */ - tree avals = build_array_from_exprs (ta->next->sarrayOf (e->values->length), - e->values, this->constp_); + Type *tvarray = dmd::sarrayOf (ta->next, e->values->length); + tree avals = build_array_from_exprs (tvarray, e->values, this->constp_); init = compound_expr (init, stabilize_expr (&avals)); /* Generate: _d_assocarrayliteralTX (ti, keys, vals); */ - tree keys = d_array_value (build_ctype (ta->index->arrayOf ()), + tree keys = d_array_value (build_ctype (dmd::arrayOf (ta->index)), size_int (e->keys->length), build_address (akeys)); - tree vals = d_array_value (build_ctype (ta->next->arrayOf ()), + tree vals = d_array_value (build_ctype (dmd::arrayOf (ta->next)), size_int (e->values->length), build_address (avals)); |