Fix for shared static constructors and destructors

This commit is contained in:
Alexey Prokhin
2010-12-30 14:04:24 +03:00
parent 023b55a772
commit 6c2ccaf945

View File

@@ -501,6 +501,20 @@ void DtoDeclareFunction(FuncDeclaration* fdecl)
gIR->mainFunc = func;
}
#if DMDV2
// shared static ctor
if (fdecl->isSharedStaticCtorDeclaration()) {
if (mustDefineSymbol(fdecl)) {
gIR->sharedCtors.push_back(fdecl);
}
}
// shared static dtor
else if (fdecl->isSharedStaticDtorDeclaration()) {
if (mustDefineSymbol(fdecl)) {
gIR->sharedDtors.push_back(fdecl);
}
} else
#endif
// static ctor
if (fdecl->isStaticCtorDeclaration()) {
if (mustDefineSymbol(fdecl)) {
@@ -513,20 +527,7 @@ void DtoDeclareFunction(FuncDeclaration* fdecl)
gIR->dtors.push_back(fdecl);
}
}
#if DMDV2
// shared static ctor
else if (fdecl->isSharedStaticCtorDeclaration()) {
if (mustDefineSymbol(fdecl)) {
gIR->sharedCtors.push_back(fdecl);
}
}
// static dtor
else if (fdecl->isSharedStaticDtorDeclaration()) {
if (mustDefineSymbol(fdecl)) {
gIR->sharedDtors.push_back(fdecl);
}
}
#endif
// we never reference parameters of function prototypes
std::string str;
// if (!declareOnly)