comparison gen/classes.cpp @ 1270:dd135ff697fa

Fixed class default initializers and type generation. Bug #260 is fixed.
author Tomas Lindquist Olsen <tomas.l.olsen gmail com>
date Mon, 27 Apr 2009 03:40:40 +0200
parents ec1d9dc1d32a
children 0c03ba6f7c24
comparison
equal deleted inserted replaced
1269:b8a51aa44d4c 1270:dd135ff697fa
203 if (n == 0) 203 if (n == 0)
204 return; 204 return;
205 205
206 // copy the rest from the static initializer 206 // copy the rest from the static initializer
207 LLValue* dstarr = DtoGEPi(dst,0,2,"tmp"); 207 LLValue* dstarr = DtoGEPi(dst,0,2,"tmp");
208 LLValue* srcarr = DtoGEPi(tc->sym->ir.irStruct->getInitSymbol(),0,2,"tmp"); 208
209 // init symbols might not have valid types
210 LLValue* initsym = tc->sym->ir.irStruct->getInitSymbol();
211 initsym = DtoBitCast(initsym, DtoType(tc));
212 LLValue* srcarr = DtoGEPi(initsym,0,2,"tmp");
209 213
210 DtoMemCpy(dstarr, srcarr, DtoConstSize_t(n)); 214 DtoMemCpy(dstarr, srcarr, DtoConstSize_t(n));
211 } 215 }
212 216
213 ////////////////////////////////////////////////////////////////////////////////////////// 217 //////////////////////////////////////////////////////////////////////////////////////////