From e01917bc0df174d0f0de890d1f9213c41e495d75 Mon Sep 17 00:00:00 2001 From: Tomas Lindquist Olsen Date: Thu, 16 Apr 2009 22:19:36 +0200 Subject: [PATCH] Make typeinfo for struct --- gen/structs.cpp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/gen/structs.cpp b/gen/structs.cpp index 3cc96564..0016a410 100644 --- a/gen/structs.cpp +++ b/gen/structs.cpp @@ -48,7 +48,8 @@ void DtoResolveStruct(StructDeclaration* sd) 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 @@ void DtoResolveStruct(StructDeclaration* sd) } } - // emit typeinfo - DtoTypeInfoOf(sd->type); + if (needs_def) + { + // emit typeinfo + DtoTypeInfoOf(sd->type); + } } //////////////////////////////////////////////////////////////////////////////////////////