Mercurial > projects > ldc
diff gen/classes.cpp @ 940:39519a1ff603
Changed the way LDC determines if a template instantiation needs to get a definition, seems to speed up compile times quite a bit in some cases.
author | Tomas Lindquist Olsen <tomas.l.olsen@gmail.com> |
---|---|
date | Wed, 04 Feb 2009 18:48:03 +0100 |
parents | 545f54041d91 |
children | 03d7c4aac654 |
line wrap: on
line diff
--- a/gen/classes.cpp Wed Feb 04 18:39:39 2009 +0100 +++ b/gen/classes.cpp Wed Feb 04 18:48:03 2009 +0100 @@ -324,7 +324,7 @@ gIR->constInitList.push_back(cd); // emit typeinfo and request definition - if (cd->getModule() == gIR->dmodule || DtoIsTemplateInstance(cd)) + if (mustDefineSymbol(cd)) { gIR->defineList.push_back(cd); DtoTypeInfoOf(cd->type, false); @@ -360,7 +360,7 @@ gIR->structs.push_back(irstruct); bool needs_definition = false; - if (cd->getModule() == gIR->dmodule || DtoIsTemplateInstance(cd)) { + if (mustDefineSymbol(cd)) { needs_definition = true; } @@ -821,7 +821,7 @@ DefineInterfaceInfos(cd->ir.irStruct); // define the classinfo - if (cd->getModule() == gIR->dmodule || DtoIsTemplateInstance(cd)) + if (mustDefineSymbol(cd)) { DtoDefineClassInfo(cd); } @@ -851,7 +851,7 @@ IrStruct* irstruct = cd->ir.irStruct; - assert(cd->getModule() == gIR->dmodule || DtoIsTemplateInstance(cd)); + assert(mustDefineSymbol(cd)); // sanity check assert(irstruct->init);