Mercurial > projects > ldc
comparison dmd2/mtype.c @ 921:75c53f8f67a4
Apply StaticStructInit changes from [913] to dmd2/
author | Christian Kamm <kamm incasoftware de> |
---|---|
date | Tue, 03 Feb 2009 18:00:17 +0100 |
parents | eb936607f071 |
children | 5fa3e0ea06e9 |
comparison
equal
deleted
inserted
replaced
920:545f54041d91 | 921:75c53f8f67a4 |
---|---|
5247 sym->size(0); // give error for forward references | 5247 sym->size(0); // give error for forward references |
5248 return sym->structalign; | 5248 return sym->structalign; |
5249 } | 5249 } |
5250 | 5250 |
5251 Expression *TypeStruct::defaultInit(Loc loc) | 5251 Expression *TypeStruct::defaultInit(Loc loc) |
5252 { Symbol *s; | 5252 { Declaration *d; |
5253 Declaration *d; | |
5254 | 5253 |
5255 #if LOGDEFAULTINIT | 5254 #if LOGDEFAULTINIT |
5256 printf("TypeStruct::defaultInit() '%s'\n", toChars()); | 5255 printf("TypeStruct::defaultInit() '%s'\n", toChars()); |
5257 #endif | 5256 #endif |
5258 s = sym->toInitializer(); | 5257 d = new StaticStructInitDeclaration(sym->loc, sym); |
5259 d = new SymbolDeclaration(sym->loc, s, sym); | |
5260 assert(d); | 5258 assert(d); |
5261 d->type = this; | 5259 d->type = this; |
5262 return new VarExp(sym->loc, d); | 5260 return new VarExp(sym->loc, d); |
5263 } | 5261 } |
5264 | 5262 |