Mercurial > projects > ldc
diff gen/declarations.cpp @ 1149:5ebe8224988b
Fixed problems introduced by previous commits that prevented Tango from compiling.
author | Tomas Lindquist Olsen <tomas.l.olsen gmail.com> |
---|---|
date | Fri, 27 Mar 2009 23:17:04 +0100 |
parents | 3d1b16dabd25 |
children | 79758fd2f48a |
line wrap: on
line diff
--- a/gen/declarations.cpp Fri Mar 27 21:50:32 2009 +0100 +++ b/gen/declarations.cpp Fri Mar 27 23:17:04 2009 +0100 @@ -84,6 +84,9 @@ return; } + if (AggregateDeclaration* ad = isMember()) + ad->codegen(p); + // global variable or magic #if DMDV2 // taken from dmd2/structs @@ -135,7 +138,12 @@ if (nakedUse) gIR->usedArray.push_back(DtoBitCast(gvar, getVoidPtrType())); - DtoConstInitGlobal(this); + // don't initialize static struct members yet, they might be of the struct type + // which doesn't have a static initializer yet. + if (AggregateDeclaration* ad = isMember()) + ad->ir.irStruct->staticVars.push_back(this); + else + DtoConstInitGlobal(this); } else {