Skip to content

Commit aab2b0e

Browse files
committed
Always set __interfaceInfosZ linkage correctly.
GitHub: Fixes #535.
1 parent 407adff commit aab2b0e

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

ir/irclass.cpp

+3-1
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,8 @@ LLGlobalVariable * IrAggr::getInterfaceArraySymbol()
135135
name.append(cd->mangle());
136136
name.append("16__interfaceInfosZ");
137137

138+
// We keep this as external for now and only consider template linkage if
139+
// we emit the initializer later.
138140
classInterfacesArray = getOrCreateGlobal(cd->loc, *gIR->module,
139141
array_type, true, llvm::GlobalValue::ExternalLinkage, NULL, name);
140142

@@ -292,7 +294,6 @@ llvm::GlobalVariable * IrAggr::getInterfaceVtbl(BaseClass * b, bool new_instance
292294
};
293295

294296
llvm::GlobalVariable* interfaceInfosZ = getInterfaceArraySymbol();
295-
interfaceInfosZ->setLinkage(DtoExternalLinkage(cd, false));
296297
llvm::Constant* c = llvm::ConstantExpr::getGetElementPtr(
297298
interfaceInfosZ, idxs, true);
298299

@@ -484,6 +485,7 @@ LLConstant * IrAggr::getClassInfoInterfaces()
484485
// create and apply initializer
485486
LLConstant* arr = LLConstantArray::get(array_type, constants);
486487
classInterfacesArray->setInitializer(arr);
488+
classInterfacesArray->setLinkage(DtoExternalLinkage(cd, false));
487489

488490
// return null, only baseclass provide interfaces
489491
if (cd->vtblInterfaces->dim == 0)

0 commit comments

Comments
 (0)