comparison gen/structs.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 3ddec21fe2b6
children 8fb39f7f1a7c
comparison
equal deleted inserted replaced
1269:b8a51aa44d4c 1270:dd135ff697fa
42 42
43 // create the IrStruct 43 // create the IrStruct
44 IrStruct* irstruct = new IrStruct(sd); 44 IrStruct* irstruct = new IrStruct(sd);
45 sd->ir.irStruct = irstruct; 45 sd->ir.irStruct = irstruct;
46 46
47 // emit the initZ symbol
48 LLGlobalVariable* initZ = irstruct->getInitSymbol();
49
50 // perform definition 47 // perform definition
51 bool needs_def = mustDefineSymbol(sd); 48 bool needs_def = mustDefineSymbol(sd);
52 if (needs_def) 49 if (needs_def)
53 { 50 {
51 // emit the initZ symbol
52 LLGlobalVariable* initZ = irstruct->getInitSymbol();
53
54 // set initZ initializer 54 // set initZ initializer
55 initZ->setInitializer(irstruct->getDefaultInit()); 55 initZ->setInitializer(irstruct->getDefaultInit());
56 } 56 }
57 57
58 // emit members 58 // emit members