diff --git a/gen/asm-x86.h b/gen/asm-x86.h index dfd3f9a76a..41d17a1c10 100644 --- a/gen/asm-x86.h +++ b/gen/asm-x86.h @@ -2371,7 +2371,7 @@ struct AsmProcessor { } // print out the mangle - if (prependExtraUnderscore(vd->linkage)) { + if (prependExtraUnderscore(vd->resolvedLinkage())) { insnTemplate << "_"; } OutBuffer buf; @@ -3043,7 +3043,7 @@ struct AsmProcessor { { use_star = false; // simply write out the mangle - if (prependExtraUnderscore(decl->linkage)) { + if (prependExtraUnderscore(decl->resolvedLinkage())) { insnTemplate << "_"; } OutBuffer buf; diff --git a/gen/functions.cpp b/gen/functions.cpp index e1189981a1..d7e8427e8d 100644 --- a/gen/functions.cpp +++ b/gen/functions.cpp @@ -155,7 +155,7 @@ llvm::FunctionType *DtoFunctionType(Type *type, IrFuncTy &irFty, Type *thistype, } bool hasObjCSelector = false; - if (fd && fd->linkage == LINK::objc && thistype) { + if (fd && fd->_linkage == LINK::objc && thistype) { if (fd->objc.selector) { hasObjCSelector = true; } else if (fd->parent->isClassDeclaration()) { @@ -433,7 +433,7 @@ void DtoResolveFunction(FuncDeclaration *fdecl, const bool willDeclare) { } else if (tempdecl->llvmInternal == LLVMinline_ir) { Logger::println("magic inline ir found"); fdecl->llvmInternal = LLVMinline_ir; - fdecl->linkage = LINK::c; + fdecl->_linkage = LINK::c; Type *type = fdecl->type; assert(type->ty == TY::Tfunction); static_cast(type)->linkage = LINK::c; @@ -1398,7 +1398,7 @@ void DtoDefineFunction(FuncDeclaration *fd, bool linkageAvailableExternally) { if (func->getLinkage() == LLGlobalValue::WeakAnyLinkage && !func->hasDLLExportStorageClass() && global.params.targetTriple->isWindowsMSVCEnvironment()) { - emulateWeakAnyLinkageForMSVC(irFunc, fd->linkage); + emulateWeakAnyLinkageForMSVC(irFunc, fd->resolvedLinkage()); } } diff --git a/gen/llvmhelpers.cpp b/gen/llvmhelpers.cpp index 74469da20e..6e38b27c08 100644 --- a/gen/llvmhelpers.cpp +++ b/gen/llvmhelpers.cpp @@ -1860,7 +1860,7 @@ FuncDeclaration *getParentFunc(Dsymbol *sym) { if (auto fld = fd->isFuncLiteralDeclaration()) { if (fld->tok == TOK::function_) return nullptr; - } else if (fd->isStatic() || (!fd->isThis() && fd->linkage != LINK::d)) { + } else if (fd->isStatic() || (!fd->isThis() && fd->_linkage != LINK::d)) { return nullptr; } } diff --git a/gen/mangling.cpp b/gen/mangling.cpp index a0e86ec240..2fae4e3543 100644 --- a/gen/mangling.cpp +++ b/gen/mangling.cpp @@ -121,7 +121,7 @@ std::string getIRMangledName(VarDeclaration *vd) { // TODO: Cache the result? - return getIRMangledVarName(mangleBuf.peekChars(), vd->linkage); + return getIRMangledVarName(mangleBuf.peekChars(), vd->resolvedLinkage()); } std::string getIRMangledFuncName(std::string baseMangle, LINK link) { diff --git a/gen/naked.cpp b/gen/naked.cpp index cdb42fa868..b04f36df56 100644 --- a/gen/naked.cpp +++ b/gen/naked.cpp @@ -277,7 +277,7 @@ void emitABIReturnAsmStmt(IRAsmBlock *asmblock, const Loc &loc, } } else if (rt->isfloating()) { if (rt->iscomplex()) { - if (fdecl->linkage == LINK::d) { + if (fdecl->_linkage == LINK::d) { // extern(D) always returns on the FPU stack as->out_c = "={st},={st(1)},"; asmblock->retn = 2; diff --git a/gen/toir.cpp b/gen/toir.cpp index e83aa51f99..a62497dc11 100644 --- a/gen/toir.cpp +++ b/gen/toir.cpp @@ -708,7 +708,7 @@ public: // as requested by bearophile, see if it's a C printf call and that it's // valid. if (global.params.warnings != DIAGNOSTICoff && checkPrintf) { - if (fndecl->linkage == LINK::c && + if (fndecl->resolvedLinkage() == LINK::c && strcmp(fndecl->ident->toChars(), "printf") == 0) { warnInvalidPrintfCall(e->loc, (*e->arguments)[0], e->arguments->length); diff --git a/ir/irclass.cpp b/ir/irclass.cpp index 341d47f04e..0477a16812 100644 --- a/ir/irclass.cpp +++ b/ir/irclass.cpp @@ -560,7 +560,7 @@ LLConstant *IrClass::getInterfaceVtblInit(BaseClass *b, nameBuf.writestring(mangledTargetName + 2); const auto thunkIRMangle = - getIRMangledFuncName(nameBuf.peekChars(), fd->linkage); + getIRMangledFuncName(nameBuf.peekChars(), fd->resolvedLinkage()); llvm::Function *thunk = gIR->module.getFunction(thunkIRMangle); if (!thunk) { diff --git a/ir/irvar.cpp b/ir/irvar.cpp index 751528293a..7c329020d9 100644 --- a/ir/irvar.cpp +++ b/ir/irvar.cpp @@ -87,7 +87,7 @@ void IrGlobal::declare() { if (!V->isThreadlocal()) { // implicitly include extern(D) globals with -dllimport useDLLImport = - (V->isExport() || V->linkage == LINK::d) && dllimportDataSymbol(V); + (V->isExport() || V->_linkage == LINK::d) && dllimportDataSymbol(V); } }