diff --git a/dmd2/declaration.c b/dmd2/declaration.c index b44307b2..f5b6cb22 100644 --- a/dmd2/declaration.c +++ b/dmd2/declaration.c @@ -1881,7 +1881,7 @@ void VarDeclaration::setFieldOffset(AggregateDeclaration *ad, unsigned *poffset, void VarDeclaration::semantic3(Scope *sc) { // LDC - if (!global.params.useAvailableExternally) + if (!global.inExtraInliningSemantic) availableExternally = false; if (aliassym) @@ -2355,7 +2355,7 @@ void TypeInfoDeclaration::semantic(Scope *sc) { assert(linkage == LINKc); #if IN_LLVM - if (!global.params.useAvailableExternally) + if (!global.inExtraInliningSemantic) availableExternally = false; #endif } diff --git a/dmd2/func.c b/dmd2/func.c index 55b30f84..7cb016e1 100644 --- a/dmd2/func.c +++ b/dmd2/func.c @@ -938,7 +938,7 @@ void FuncDeclaration::semantic3(Scope *sc) semantic3Errors = 0; #if IN_LLVM - if (!global.params.useAvailableExternally) + if (!global.inExtraInliningSemantic) availableExternally = false; #endif diff --git a/dmd2/mars.h b/dmd2/mars.h index 5645093a..544e074a 100644 --- a/dmd2/mars.h +++ b/dmd2/mars.h @@ -294,7 +294,6 @@ struct Param OUTPUTFLAG output_o; bool useInlineAsm; bool verbose_cg; - bool useAvailableExternally; // target stuff llvm::Triple targetTriple; @@ -338,6 +337,8 @@ struct Global #if IN_LLVM char *ldc_version; char *llvm_version; + + bool inExtraInliningSemantic; #endif Param params; diff --git a/dmd2/struct.c b/dmd2/struct.c index 6c7135d2..a2bbafac 100644 --- a/dmd2/struct.c +++ b/dmd2/struct.c @@ -101,7 +101,7 @@ void AggregateDeclaration::semantic2(Scope *sc) void AggregateDeclaration::semantic3(Scope *sc) { #if IN_LLVM - if (!global.params.useAvailableExternally) + if (!global.inExtraInliningSemantic) availableExternally = false; #endif diff --git a/driver/main.cpp b/driver/main.cpp index 3ebafbc5..bd108dfd 100644 --- a/driver/main.cpp +++ b/driver/main.cpp @@ -1009,7 +1009,7 @@ int main(int argc, char** argv) // inlining is unlikely to be important for test builds anyway. if (!global.params.symdebug && willInline() && !global.params.useUnitTests) { - global.params.useAvailableExternally = true; + global.inExtraInliningSemantic = true; Logger::println("Running some extra semantic3's for inlining purposes"); { // Do pass 3 semantic analysis on all imported modules, diff --git a/gen/llvmhelpers.cpp b/gen/llvmhelpers.cpp index 85736c33..3ab33053 100644 --- a/gen/llvmhelpers.cpp +++ b/gen/llvmhelpers.cpp @@ -1606,7 +1606,7 @@ bool mustDefineSymbol(Dsymbol* s) if (fd->isArrayOp == 1) return true; - if (global.params.useAvailableExternally && fd->availableExternally) { + if (global.inExtraInliningSemantic && fd->availableExternally) { // Emit extra functions if we're inlining. // These will get available_externally linkage, // so they shouldn't end up in object code. @@ -1637,7 +1637,7 @@ bool mustDefineSymbol(Dsymbol* s) // Inlining checks may create some variable and class declarations // we don't need to emit. - if (global.params.useAvailableExternally) + if (global.inExtraInliningSemantic) { if (VarDeclaration* vd = s->isVarDeclaration()) if (vd->availableExternally)