aboutsummaryrefslogtreecommitdiff
path: root/gcc/d/decl.cc
diff options
context:
space:
mode:
authorIain Buclaw <ibuclaw@gdcproject.org>2025-03-14 23:08:16 +0100
committerIain Buclaw <ibuclaw@gdcproject.org>2025-03-16 21:06:07 +0100
commit7d6e5591e6ab1f5a24dcf007b17f81cc19987c47 (patch)
treefdc4ad1abac3bd4a831b5e72ec6e3003f88f872c /gcc/d/decl.cc
parent26c4ea2ebcdcd0aa26350d04dc4cd38348148bd9 (diff)
downloadgcc-7d6e5591e6ab1f5a24dcf007b17f81cc19987c47.zip
gcc-7d6e5591e6ab1f5a24dcf007b17f81cc19987c47.tar.gz
gcc-7d6e5591e6ab1f5a24dcf007b17f81cc19987c47.tar.bz2
d: Merge upstream dmd, druntime 603225372b
D front-end changes: - Import dmd v2.111.0-beta.1. - Added placement `new' expressions. D runtime changes: - Import druntime v2.111.0-beta.1. gcc/d/ChangeLog: * dmd/MERGE: Merge upstream dmd 603225372b. * dmd/VERSION: Bump version to v2.111.0-beta.1. * d-builtins.cc (build_frontend_type): Update for new front-end interface. * decl.cc (Class DeclVisitor): Likewise. (maybe_build_decl_tree): Likewise. (get_vtable_decl): Likewise. (layout_class_initializer): Likewise. * expr.cc (class ExprVisitor): Likewise. (ExprVisitor::visit (NewExp *)): Implement placement new for class, struct, and pointer types. * modules.cc (get_internal_fn): Update for new front-end interface. libphobos/ChangeLog: * libdruntime/MERGE: Merge upstream druntime 603225372b.
Diffstat (limited to 'gcc/d/decl.cc')
-rw-r--r--gcc/d/decl.cc52
1 files changed, 26 insertions, 26 deletions
diff --git a/gcc/d/decl.cc b/gcc/d/decl.cc
index c05c303..9fcfc56 100644
--- a/gcc/d/decl.cc
+++ b/gcc/d/decl.cc
@@ -256,18 +256,18 @@ public:
void visit (Module *d) final override
{
- if (d->semanticRun >= PASS::obj)
+ if (d->semanticRun () >= PASS::obj)
return;
build_module_tree (d);
- d->semanticRun = PASS::obj;
+ d->semanticRun (PASS::obj);
}
/* Write the imported symbol to debug. */
void visit (Import *d) final override
{
- if (d->semanticRun >= PASS::obj)
+ if (d->semanticRun () >= PASS::obj)
return;
/* Implements import declarations by telling the debug back-end we are
@@ -320,7 +320,7 @@ public:
false, false);
}
- d->semanticRun = PASS::obj;
+ d->semanticRun (PASS::obj);
}
/* Finish a top-level `asm` definition. */
@@ -472,7 +472,7 @@ public:
void visit (StructDeclaration *d) final override
{
- if (d->semanticRun >= PASS::obj)
+ if (d->semanticRun () >= PASS::obj)
return;
if (d->type->ty == TY::Terror)
@@ -520,7 +520,7 @@ public:
if (d->xhash)
this->build_dsymbol (d->xhash);
- d->semanticRun = PASS::obj;
+ d->semanticRun (PASS::obj);
}
/* Finish semantic analysis of functions in vtbl for class CD. */
@@ -542,7 +542,7 @@ public:
has_errors = true;
/* No name hiding to check for. */
- if (!d->isFuncHidden (fd) || fd->isFuture ())
+ if (!dmd::isFuncHidden (d, fd) || fd->isFuture ())
continue;
/* The function fd is hidden from the view of the class.
@@ -588,7 +588,7 @@ public:
void visit (ClassDeclaration *d) final override
{
- if (d->semanticRun >= PASS::obj)
+ if (d->semanticRun () >= PASS::obj)
return;
if (d->type->ty == TY::Terror)
@@ -617,7 +617,7 @@ public:
/* Generate C symbols. */
d->csym = get_classinfo_decl (d);
- Dsymbol *vtblsym = d->vtblSymbol ();
+ Dsymbol *vtblsym = dmd::vtblSymbol (d);
vtblsym->csym = get_vtable_decl (d);
tree sinit = aggregate_initializer_decl (d);
@@ -654,7 +654,7 @@ public:
= build_constructor (TREE_TYPE (vtblsym->csym), elms);
d_finish_decl (vtblsym->csym);
- d->semanticRun = PASS::obj;
+ d->semanticRun (PASS::obj);
}
/* Write out compiler generated TypeInfo and vtables for the given interface
@@ -662,7 +662,7 @@ public:
void visit (InterfaceDeclaration *d) final override
{
- if (d->semanticRun >= PASS::obj)
+ if (d->semanticRun () >= PASS::obj)
return;
if (d->type->ty == TY::Terror)
@@ -697,7 +697,7 @@ public:
DECL_INITIAL (d->csym) = layout_classinfo (d);
d_finish_decl (d->csym);
- d->semanticRun = PASS::obj;
+ d->semanticRun (PASS::obj);
}
/* Write out compiler generated TypeInfo and initializer for the given
@@ -705,10 +705,10 @@ public:
void visit (EnumDeclaration *d) final override
{
- if (d->semanticRun >= PASS::obj)
+ if (d->semanticRun () >= PASS::obj)
return;
- if (d->errors || d->type->ty == TY::Terror)
+ if (d->errors () || d->type->ty == TY::Terror)
{
error_at (make_location_t (d->loc),
"had semantic errors when compiling");
@@ -736,7 +736,7 @@ public:
d_finish_decl (d->sinit);
}
- d->semanticRun = PASS::obj;
+ d->semanticRun (PASS::obj);
}
/* Finish up a variable declaration and push it into the current scope.
@@ -744,7 +744,7 @@ public:
void visit (VarDeclaration *d) final override
{
- if (d->semanticRun >= PASS::obj)
+ if (d->semanticRun () >= PASS::obj)
return;
if (d->type->ty == TY::Terror)
@@ -889,7 +889,7 @@ public:
}
}
- d->semanticRun = PASS::obj;
+ d->semanticRun (PASS::obj);
}
/* Generate and compile a static TypeInfo declaration, but only if it is
@@ -897,7 +897,7 @@ public:
void visit (TypeInfoDeclaration *d) final override
{
- if (d->semanticRun >= PASS::obj)
+ if (d->semanticRun () >= PASS::obj)
return;
if (dmd::isSpeculativeType (d->tinfo))
@@ -906,7 +906,7 @@ public:
tree t = get_typeinfo_decl (d);
DECL_INITIAL (t) = layout_typeinfo (d);
d_finish_decl (t);
- d->semanticRun = PASS::obj;
+ d->semanticRun (PASS::obj);
}
/* Finish up a function declaration and compile it all the way
@@ -915,7 +915,7 @@ public:
void visit (FuncDeclaration *d) final override
{
/* Already generated the function. */
- if (d->semanticRun >= PASS::obj)
+ if (d->semanticRun () >= PASS::obj)
return;
/* Don't emit any symbols from gcc.attributes module. */
@@ -957,7 +957,7 @@ public:
}
/* Ensure all semantic passes have run. */
- if (d->semanticRun < PASS::semantic3)
+ if (d->semanticRun () < PASS::semantic3)
{
gcc_assert (!doing_semantic_analysis_p);
@@ -971,8 +971,8 @@ public:
return;
/* Start generating code for this function. */
- gcc_assert (d->semanticRun == PASS::semantic3done);
- d->semanticRun = PASS::obj;
+ gcc_assert (d->semanticRun () == PASS::semantic3done);
+ d->semanticRun (PASS::obj);
/* Duplicated FuncDeclarations map to the same symbol. Check if this
is the one declaration which will be emitted. */
@@ -1179,7 +1179,7 @@ maybe_build_decl_tree (Declaration *decl)
/* Still running semantic analysis on declaration, or it has already had its
code generated. */
- if (doing_semantic_analysis_p || decl->semanticRun >= PASS::obj)
+ if (doing_semantic_analysis_p || decl->semanticRun () >= PASS::obj)
return decl->csym;
if (error_operand_p (decl->csym))
@@ -2212,7 +2212,7 @@ get_vtable_decl (ClassDeclaration *decl)
will have a different type. However the back-end seems to accept this. */
tree type = build_ctype (dmd::sarrayOf (Type::tvoidptr, decl->vtbl.length));
- Dsymbol *vtblsym = decl->vtblSymbol ();
+ Dsymbol *vtblsym = dmd::vtblSymbol (decl);
vtblsym->csym = declare_extern_var (ident, type);
DECL_LANG_SPECIFIC (vtblsym->csym) = build_lang_decl (NULL);
@@ -2403,7 +2403,7 @@ aggregate_initializer_decl (AggregateDeclaration *decl)
tree
layout_class_initializer (ClassDeclaration *cd)
{
- NewExp *ne = NewExp::create (cd->loc, NULL, cd->type, NULL);
+ NewExp *ne = NewExp::create (cd->loc, NULL, NULL, cd->type, NULL);
ne->type = cd->type;
Expression *e = dmd::ctfeInterpret (ne);