comparison gen/functions.cpp @ 958:89729c76b8ff

Static ctors/dtors added via template mixins should not be added to modules that just import a module containing such a mixin.
author Christian Kamm <kamm incasoftware de>
date Sun, 15 Feb 2009 14:54:36 +0100
parents 9a10fa839dc5
children 2667e3a145be
comparison
equal deleted inserted replaced
957:31bbc7f3b817 958:89729c76b8ff
534 gIR->mainFunc = func; 534 gIR->mainFunc = func;
535 } 535 }
536 536
537 // static ctor 537 // static ctor
538 if (fdecl->isStaticCtorDeclaration()) { 538 if (fdecl->isStaticCtorDeclaration()) {
539 if (fdecl->getModule() == gIR->dmodule || fdecl->inTemplateInstance()) { 539 if (mustDefineSymbol(fdecl)) {
540 gIR->ctors.push_back(fdecl); 540 gIR->ctors.push_back(fdecl);
541 } 541 }
542 } 542 }
543 // static dtor 543 // static dtor
544 else if (fdecl->isStaticDtorDeclaration()) { 544 else if (fdecl->isStaticDtorDeclaration()) {
545 if (fdecl->getModule() == gIR->dmodule || fdecl->inTemplateInstance()) { 545 if (mustDefineSymbol(fdecl)) {
546 gIR->dtors.push_back(fdecl); 546 gIR->dtors.push_back(fdecl);
547 } 547 }
548 } 548 }
549 549
550 // we never reference parameters of function prototypes 550 // we never reference parameters of function prototypes