Mercurial > projects > ldc
diff 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 |
line wrap: on
line diff
--- a/gen/structs.cpp Thu Apr 16 21:15:42 2009 +0200 +++ b/gen/structs.cpp Thu Apr 16 22:19:36 2009 +0200 @@ -48,7 +48,8 @@ LLGlobalVariable* initZ = irstruct->getInitSymbol(); // perform definition - if (mustDefineSymbol(sd)) + bool needs_def = mustDefineSymbol(sd); + if (needs_def) { // set initZ initializer initZ->setInitializer(irstruct->getDefaultInit()); @@ -67,8 +68,11 @@ } } - // emit typeinfo - DtoTypeInfoOf(sd->type); + if (needs_def) + { + // emit typeinfo + DtoTypeInfoOf(sd->type); + } } //////////////////////////////////////////////////////////////////////////////////////////