comparison gen/structs.cpp @ 1238:3ddec21fe2b6

Make typeinfo for struct
author Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
date Thu, 16 Apr 2009 22:19:36 +0200
parents 9201e0d41ee5
children dd135ff697fa
comparison
equal deleted inserted replaced
1237:73b56541152c 1238:3ddec21fe2b6
46 46
47 // emit the initZ symbol 47 // emit the initZ symbol
48 LLGlobalVariable* initZ = irstruct->getInitSymbol(); 48 LLGlobalVariable* initZ = irstruct->getInitSymbol();
49 49
50 // perform definition 50 // perform definition
51 if (mustDefineSymbol(sd)) 51 bool needs_def = mustDefineSymbol(sd);
52 if (needs_def)
52 { 53 {
53 // set initZ initializer 54 // set initZ initializer
54 initZ->setInitializer(irstruct->getDefaultInit()); 55 initZ->setInitializer(irstruct->getDefaultInit());
55 } 56 }
56 57
65 member->codegen(Type::sir); 66 member->codegen(Type::sir);
66 it.next(); 67 it.next();
67 } 68 }
68 } 69 }
69 70
70 // emit typeinfo 71 if (needs_def)
71 DtoTypeInfoOf(sd->type); 72 {
73 // emit typeinfo
74 DtoTypeInfoOf(sd->type);
75 }
72 } 76 }
73 77
74 ////////////////////////////////////////////////////////////////////////////////////////// 78 //////////////////////////////////////////////////////////////////////////////////////////
75 //////////////////////////// D STRUCT UTILITIES //////////////////////////////////// 79 //////////////////////////// D STRUCT UTILITIES ////////////////////////////////////
76 ////////////////////////////////////////////////////////////////////////////////////////// 80 //////////////////////////////////////////////////////////////////////////////////////////