Mercurial > projects > ldc
comparison 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 |
comparison
equal
deleted
inserted
replaced
1148:3d1b16dabd25 | 1149:5ebe8224988b |
---|---|
81 { | 81 { |
82 Logger::println("alias sym"); | 82 Logger::println("alias sym"); |
83 toAlias()->codegen(p); | 83 toAlias()->codegen(p); |
84 return; | 84 return; |
85 } | 85 } |
86 | |
87 if (AggregateDeclaration* ad = isMember()) | |
88 ad->codegen(p); | |
86 | 89 |
87 // global variable or magic | 90 // global variable or magic |
88 #if DMDV2 | 91 #if DMDV2 |
89 // taken from dmd2/structs | 92 // taken from dmd2/structs |
90 if (isDataseg() || (storage_class & (STCconst | STCinvariant) && init)) | 93 if (isDataseg() || (storage_class & (STCconst | STCinvariant) && init)) |
133 // if this global is used from a nested function, this is necessary or | 136 // if this global is used from a nested function, this is necessary or |
134 // optimization could potentially remove the global (if it's the only use) | 137 // optimization could potentially remove the global (if it's the only use) |
135 if (nakedUse) | 138 if (nakedUse) |
136 gIR->usedArray.push_back(DtoBitCast(gvar, getVoidPtrType())); | 139 gIR->usedArray.push_back(DtoBitCast(gvar, getVoidPtrType())); |
137 | 140 |
138 DtoConstInitGlobal(this); | 141 // don't initialize static struct members yet, they might be of the struct type |
142 // which doesn't have a static initializer yet. | |
143 if (AggregateDeclaration* ad = isMember()) | |
144 ad->ir.irStruct->staticVars.push_back(this); | |
145 else | |
146 DtoConstInitGlobal(this); | |
139 } | 147 } |
140 else | 148 else |
141 { | 149 { |
142 // might already have its irField, as classes derive each other without getting copies of the VarDeclaration | 150 // might already have its irField, as classes derive each other without getting copies of the VarDeclaration |
143 if (!ir.irField) | 151 if (!ir.irField) |