mirror of
https://github.com/ldc-developers/ldc.git
synced 2025-05-05 17:43:35 +03:00
MSVC: Emit EH type descriptors as COMDATs
This commit is contained in:
parent
f38a7972a5
commit
9079e5cbed
1 changed files with 5 additions and 1 deletions
|
@ -187,9 +187,13 @@ llvm::GlobalVariable *getTypeDescriptor(IRState &irs, ClassDeclaration *cd) {
|
||||||
llvm::ConstantDataArray::getString(gIR->context(), TypeNameString)};
|
llvm::ConstantDataArray::getString(gIR->context(), TypeNameString)};
|
||||||
llvm::StructType *TypeDescriptorType =
|
llvm::StructType *TypeDescriptorType =
|
||||||
getTypeDescriptorType(irs, classInfoPtr, TypeNameString);
|
getTypeDescriptorType(irs, classInfoPtr, TypeNameString);
|
||||||
|
|
||||||
|
const LinkageWithCOMDAT lwc = {LLGlobalVariable::LinkOnceODRLinkage, true};
|
||||||
Var = defineGlobal(cd->loc, gIR->module, TypeDescName,
|
Var = defineGlobal(cd->loc, gIR->module, TypeDescName,
|
||||||
llvm::ConstantStruct::get(TypeDescriptorType, Fields),
|
llvm::ConstantStruct::get(TypeDescriptorType, Fields),
|
||||||
LLGlobalVariable::InternalLinkage, false);
|
lwc.first, /*isConstant=*/true);
|
||||||
|
setLinkage(lwc, Var);
|
||||||
|
|
||||||
return Var;
|
return Var;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue