Mercurial > projects > ldc
changeset 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 | 73b56541152c |
children | ff1b4cc2e9be |
files | gen/structs.cpp |
diffstat | 1 files changed, 7 insertions(+), 3 deletions(-) [+] |
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); + } } //////////////////////////////////////////////////////////////////////////////////////////