comparison dmd/declaration.h @ 913:29c0d1194033

Fix #198 and #199 by making CTFE on static struct initializers work. Renamed SymbolDeclaration to StaticStructInitDeclaration to make its usage clearer.
author Christian Kamm <kamm incasoftware de>
date Sun, 01 Feb 2009 20:20:56 +0100
parents bc982f1ad106
children 545f54041d91
comparison
equal deleted inserted replaced
912:16264a3973bf 913:29c0d1194033
276 unsigned offset2; 276 unsigned offset2;
277 }; 277 };
278 278
279 /**************************************************************/ 279 /**************************************************************/
280 280
281 // This is a shell around a back end symbol 281 // LDC uses this to denote static struct initializers
282 282
283 struct SymbolDeclaration : Declaration 283 struct StaticStructInitDeclaration : Declaration
284 { 284 {
285 Symbol *sym;
286 StructDeclaration *dsym; 285 StructDeclaration *dsym;
287 286
288 SymbolDeclaration(Loc loc, Symbol *s, StructDeclaration *dsym); 287 StaticStructInitDeclaration(Loc loc, StructDeclaration *dsym);
289 288
290 Symbol *toSymbol(); 289 Symbol *toSymbol();
291 290
292 // Eliminate need for dynamic_cast 291 // Eliminate need for dynamic_cast
293 SymbolDeclaration *isSymbolDeclaration() { return (SymbolDeclaration *)this; } 292 StaticStructInitDeclaration *isStaticStructInitDeclaration() { return (StaticStructInitDeclaration *)this; }
294 }; 293 };
295 294
296 struct ClassInfoDeclaration : VarDeclaration 295 struct ClassInfoDeclaration : VarDeclaration
297 { 296 {
298 ClassDeclaration *cd; 297 ClassDeclaration *cd;