comparison gen/toir.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 9014d7f0433f
children 0686701178d3
comparison
equal deleted inserted replaced
1269:b8a51aa44d4c 1270:dd135ff697fa
215 assert(sdecltype->ty == Tstruct); 215 assert(sdecltype->ty == Tstruct);
216 TypeStruct* ts = (TypeStruct*)sdecltype; 216 TypeStruct* ts = (TypeStruct*)sdecltype;
217 assert(ts->sym); 217 assert(ts->sym);
218 ts->sym->codegen(Type::sir); 218 ts->sym->codegen(Type::sir);
219 219
220 return new DVarValue(type, ts->sym->ir.irStruct->getInitSymbol()); 220 LLValue* initsym = ts->sym->ir.irStruct->getInitSymbol();
221 initsym = DtoBitCast(initsym, DtoType(ts->pointerTo()));
222 return new DVarValue(type, initsym);
221 } 223 }
222 else 224 else
223 { 225 {
224 assert(0 && "Unimplemented VarExp type"); 226 assert(0 && "Unimplemented VarExp type");
225 } 227 }
1643 DtoAggrZeroInit(mem); 1645 DtoAggrZeroInit(mem);
1644 } 1646 }
1645 else { 1647 else {
1646 assert(ts->sym); 1648 assert(ts->sym);
1647 ts->sym->codegen(Type::sir); 1649 ts->sym->codegen(Type::sir);
1648 DtoAggrCopy(mem,ts->sym->ir.irStruct->getInitSymbol()); 1650 DtoAggrCopy(mem, ts->sym->ir.irStruct->getInitSymbol());
1649 } 1651 }
1650 return new DImValue(type, mem); 1652 return new DImValue(type, mem);
1651 } 1653 }
1652 // new basic type 1654 // new basic type
1653 else 1655 else