aboutsummaryrefslogtreecommitdiff
path: root/gcc/d/expr.cc
diff options
context:
space:
mode:
authorIain Buclaw <ibuclaw@gdcproject.org>2024-02-03 14:00:24 +0100
committerIain Buclaw <ibuclaw@gdcproject.org>2024-02-04 01:32:42 +0100
commitc428454ecee141937a6810dd6213716602d563ca (patch)
tree84ad8f3ba37eb09deee3c087f4fc5a93cc65d927 /gcc/d/expr.cc
parent435bed3f028b21ccc2242c7ee8612d95f07b30dc (diff)
downloadgcc-c428454ecee141937a6810dd6213716602d563ca.zip
gcc-c428454ecee141937a6810dd6213716602d563ca.tar.gz
gcc-c428454ecee141937a6810dd6213716602d563ca.tar.bz2
d: Merge dmd, druntime a6f1083699, phobos 31dedd7da
D front-end changes: - Import dmd v2.107.0. - Character postfixes can now also be used for integers of size two or four. D run-time changes: - Import druntime v2.107.0. Phobos changes: - Import phobos v2.107.0. gcc/d/ChangeLog: * dmd/MERGE: Merge upstream dmd a6f1083699. * dmd/VERSION: Bump version to v2.107.0 * Make-lang.in (D_FRONTEND_OBJS): Add d/pragmasem.o. * d-builtins.cc (strip_type_modifiers): Update for new front-end interface. * d-codegen.cc (declaration_type): Likewise. (parameter_type): Likewise. * d-target.cc (TargetCPP::parameterType): Likewise. * expr.cc (ExprVisitor::visit (IndexExp *)): Likewise. (ExprVisitor::visit (VarExp *)): Likewise. (ExprVisitor::visit (AssocArrayLiteralExp *)): Likewise. * runtime.cc (get_libcall_type): Likewise. * typeinfo.cc (TypeInfoVisitor::visit (TypeInfoConstDeclaration *)): Likewise. (TypeInfoVisitor::visit (TypeInfoInvariantDeclaration *)): Likewise. (TypeInfoVisitor::visit (TypeInfoSharedDeclaration *)): Likewise. (TypeInfoVisitor::visit (TypeInfoWildDeclaration *)): Likewise. * types.cc (build_ctype): Likewise. libphobos/ChangeLog: * libdruntime/MERGE: Merge upstream druntime a6f1083699. * src/MERGE: Merge upstream phobos 31dedd7da.
Diffstat (limited to 'gcc/d/expr.cc')
-rw-r--r--gcc/d/expr.cc9
1 files changed, 4 insertions, 5 deletions
diff --git a/gcc/d/expr.cc b/gcc/d/expr.cc
index 0a85a55..a050588 100644
--- a/gcc/d/expr.cc
+++ b/gcc/d/expr.cc
@@ -1178,7 +1178,7 @@ public:
{
libcall = LIBCALL_AAGETY;
ptr = build_address (build_expr (e->e1));
- tinfo = build_typeinfo (e, tb1->unSharedOf ()->mutableOf ());
+ tinfo = build_typeinfo (e, mutableOf (unSharedOf (tb1)));
}
else
{
@@ -2170,7 +2170,7 @@ public:
{
/* Generate a slice for non-zero initialized aggregates,
otherwise create an empty array. */
- gcc_assert (e->type == Type::tvoid->arrayOf ()->constOf ());
+ gcc_assert (e->type == constOf (Type::tvoid->arrayOf ()));
tree type = build_ctype (e->type);
tree length = size_int (sd->dsym->structsize);
@@ -2709,17 +2709,16 @@ public:
void visit (AssocArrayLiteralExp *e) final override
{
- if (e->lowering != NULL)
+ if (this->constp_ && e->lowering != NULL)
{
/* When an associative array literal gets lowered, it's converted into a
struct literal suitable for static initialization. */
- gcc_assert (this->constp_);
this->result_ = build_expr (e->lowering, this->constp_, true);
return ;
}
/* Want the mutable type for typeinfo reference. */
- Type *tb = e->type->toBasetype ()->mutableOf ();
+ Type *tb = mutableOf (e->type->toBasetype ());
/* Handle empty assoc array literals. */
TypeAArray *ta = tb->isTypeAArray ();