Mercurial > projects > ddmd
comparison dmd/StructDeclaration.d @ 138:90821c10b6a7
2.039
author | Trass3r |
---|---|
date | Tue, 14 Sep 2010 00:00:24 +0200 |
parents | af1bebfd96a4 |
children | bc45b1c53019 |
comparison
equal
deleted
inserted
replaced
137:09c858522d55 | 138:90821c10b6a7 |
---|---|
104 | 104 |
105 override void semantic(Scope sc) | 105 override void semantic(Scope sc) |
106 { | 106 { |
107 Scope sc2; | 107 Scope sc2; |
108 | 108 |
109 //printf("+StructDeclaration.semantic(this=%p, '%s')\n", this, toChars()); | 109 //writef("+StructDeclaration.semantic(this=%p, '%s', sizeok = %d)\n", this, toChars(), sizeok); |
110 | 110 |
111 //static int count; if (++count == 20) *(char*)0=0; | 111 //static int count; if (++count == 20) halt(); |
112 | 112 |
113 assert(type); | 113 assert(type); |
114 if (!members) // if forward reference | 114 if (!members) // if forward reference |
115 return; | 115 return; |
116 | 116 |
117 if (symtab) | 117 if (sizeok == 1 || symtab) |
118 { if (!scope_) | 118 { |
119 if (!scope_) | |
120 { | |
121 // writef("already completed\n"); | |
122 scope_ = null; | |
119 return; // semantic() already completed | 123 return; // semantic() already completed |
124 } | |
120 } | 125 } |
121 else | 126 else |
122 symtab = new DsymbolTable(); | 127 symtab = new DsymbolTable(); |
123 | 128 |
124 Scope scx = null; | 129 Scope scx = null; |
365 structalign = 0; | 370 structalign = 0; |
366 | 371 |
367 scope_ = scx ? scx : sc.clone(); | 372 scope_ = scx ? scx : sc.clone(); |
368 scope_.setNoFree(); | 373 scope_.setNoFree(); |
369 scope_.module_.addDeferredSemantic(this); | 374 scope_.module_.addDeferredSemantic(this); |
370 //printf("\tdeferring %s\n", toChars()); | 375 writef("\tdeferring %s\n", toChars()); |
371 return; | 376 return; |
372 } | 377 } |
373 | 378 |
374 // 0 sized struct's are set to 1 byte | 379 // 0 sized struct's are set to 1 byte |
375 if (structsize == 0) | 380 if (structsize == 0) |