mirror of
https://github.com/ldc-developers/ldc.git
synced 2025-05-04 09:00:33 +03:00
Adapt glue layer to renamed/changed Declaration::linkage
This commit is contained in:
parent
1fb01cfbf0
commit
be9d5817a1
8 changed files with 11 additions and 11 deletions
|
@ -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;
|
||||
|
|
|
@ -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<TypeFunction *>(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());
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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) {
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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) {
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue