mirror of
https://github.com/xomboverlord/ldc.git
synced 2026-01-11 18:33:14 +01:00
Run semantic3 on tuple declarations. This way, flag "availableExternally" will be set correctly for tuples.
This commit is contained in:
@@ -244,6 +244,26 @@ int TupleDeclaration::needThis()
|
||||
return 0;
|
||||
}
|
||||
|
||||
#if IN_LLVM
|
||||
|
||||
void TupleDeclaration::semantic3(Scope *sc)
|
||||
{
|
||||
//printf("TupleDeclaration::semantic3((%s)\n", toChars());
|
||||
for (size_t i = 0; i < objects->dim; i++)
|
||||
{ Object *o = (Object *)objects->data[i];
|
||||
if (o->dyncast() == DYNCAST_EXPRESSION)
|
||||
{ Expression *e = (Expression *)o;
|
||||
if (e->op == TOKdsymbol)
|
||||
{ DsymbolExp *ve = (DsymbolExp *)e;
|
||||
Declaration *d = ve->s->isDeclaration();
|
||||
d->semantic3(sc);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
/********************************* TypedefDeclaration ****************************/
|
||||
|
||||
TypedefDeclaration::TypedefDeclaration(Loc loc, Identifier *id, Type *basetype, Initializer *init)
|
||||
@@ -1381,6 +1401,9 @@ void VarDeclaration::semantic3(Scope *sc)
|
||||
if (!global.params.useAvailableExternally)
|
||||
availableExternally = false;
|
||||
|
||||
if (aliassym)
|
||||
aliassym->semantic3(sc);
|
||||
|
||||
// Preserve call chain
|
||||
Declaration::semantic3(sc);
|
||||
}
|
||||
|
||||
@@ -193,6 +193,7 @@ struct TupleDeclaration : Declaration
|
||||
TupleDeclaration *isTupleDeclaration() { return this; }
|
||||
|
||||
#if IN_LLVM
|
||||
void semantic3(Scope *sc);
|
||||
/// Codegen traversal
|
||||
void codegen(Ir* ir);
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user