diff --git a/gen/functions.cpp b/gen/functions.cpp index 6425c38c..e431169e 100644 --- a/gen/functions.cpp +++ b/gen/functions.cpp @@ -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)