comparison ir/irtypeclass.cpp @ 1309:0c03ba6f7c24

Fixed deal breaker bug for more-at-once compilation when any module contained aggregates. Fixes ticket #272 .
author Tomas Lindquist Olsen <tomas.l.olsen gmail com>
date Thu, 07 May 2009 02:10:29 +0200
parents 8fb39f7f1a7c
children 49fd0c8040e6
comparison
equal deleted inserted replaced
1308:316e9ecfeb7d 1309:0c03ba6f7c24
157 157
158 // advance offset to right past this field 158 // advance offset to right past this field
159 offset = vd->offset + vd->type->size(); 159 offset = vd->offset + vd->type->size();
160 160
161 // create ir field 161 // create ir field
162 if (vd->ir.irField == NULL) 162 vd->aggrIndex = (unsigned)field_index;
163 new IrField(vd, field_index); 163 ++field_index;
164 else
165 assert(vd->ir.irField->index == field_index &&
166 vd->ir.irField->unionOffset == 0 &&
167 "inconsistent field data");
168 field_index++;
169 }
170
171 // make sure all fields really get their ir field
172 ArrayIter<VarDeclaration> it(base->fields);
173 for (; !it.done(); it.next())
174 {
175 VarDeclaration* vd = it.get();
176 if (vd->ir.irField == NULL)
177 new IrField(vd, 0, vd->offset);
178 } 164 }
179 165
180 // any interface implementations? 166 // any interface implementations?
181 if (base->vtblInterfaces && base->vtblInterfaces->dim > 0) 167 if (base->vtblInterfaces && base->vtblInterfaces->dim > 0)
182 { 168 {