+2019-04-21 Iain Buclaw <ibuclaw@gdcproject.org>
+
+ * decl.cc (DeclVisitor::visit(Import)): Set semanticRun after
+ completion, guard against being called more than once.
+ (DeclVisitor::visit(StructDeclaration)): Likewise.
+ (DeclVisitor::visit(ClassDeclaration)): Likewise.
+ (DeclVisitor::visit(InterfaceDeclaration)): Likewise.
+ (DeclVisitor::visit(VarDeclaration)): Likewise.
+ (DeclVisitor::visit(TypeInfoDeclaration)): Likewise.
+
2019-04-21 Iain Buclaw <ibuclaw@gdcproject.org>
* modules.cc (register_module_decl): Don't register unittests against
void visit (Import *d)
{
+ if (d->semanticRun >= PASSobj)
+ return;
+
/* Implements import declarations by telling the debug back-end we are
importing the NAMESPACE_DECL of the module or IMPORTED_DECL of the
declaration into the current lexical scope CONTEXT. NAME is set if
debug_hooks->imported_module_or_decl (decl, name, context,
false, false);
}
+
+ d->semanticRun = PASSobj;
}
/* Expand any local variables found in tuples. */
void visit (StructDeclaration *d)
{
+ if (d->semanticRun >= PASSobj)
+ return;
+
if (d->type->ty == Terror)
{
error_at (make_location_t (d->loc),
if (d->xhash)
d->xhash->accept (this);
+
+ d->semanticRun = PASSobj;
}
/* Finish semantic analysis of functions in vtbl for class CD. */
void visit (ClassDeclaration *d)
{
+ if (d->semanticRun >= PASSobj)
+ return;
+
if (d->type->ty == Terror)
{
error_at (make_location_t (d->loc),
tree ctype = TREE_TYPE (build_ctype (d->type));
if (TYPE_NAME (ctype))
d_pushdecl (TYPE_NAME (ctype));
+
+ d->semanticRun = PASSobj;
}
/* Write out compiler generated TypeInfo and vtables for the given interface
void visit (InterfaceDeclaration *d)
{
+ if (d->semanticRun >= PASSobj)
+ return;
+
if (d->type->ty == Terror)
{
error_at (make_location_t (d->loc),
tree ctype = TREE_TYPE (build_ctype (d->type));
if (TYPE_NAME (ctype))
d_pushdecl (TYPE_NAME (ctype));
+
+ d->semanticRun = PASSobj;
}
/* Write out compiler generated TypeInfo and initializer for the given
void visit (VarDeclaration *d)
{
+ if (d->semanticRun >= PASSobj)
+ return;
+
if (d->type->ty == Terror)
{
error_at (make_location_t (d->loc),
}
}
}
+
+ d->semanticRun = PASSobj;
}
/* Generate and compile a static TypeInfo declaration, but only if it is
void visit (TypeInfoDeclaration *d)
{
+ if (d->semanticRun >= PASSobj)
+ return;
+
if (speculative_type_p (d->tinfo))
return;
tree t = get_typeinfo_decl (d);
DECL_INITIAL (t) = layout_typeinfo (d);
d_finish_decl (t);
+ d->semanticRun = PASSobj;
}
/* Finish up a function declaration and compile it all the way