mirror of
https://github.com/xomboverlord/ldc.git
synced 2026-01-30 11:33:14 +01:00
Allow multiple declarations to share the same mangled name/LLVM global.
This is necessary to enable aliasing compiler-generated symbols with pragma(mangle, …). Note that globals for internal use are still directly created.
This commit is contained in:
@@ -605,7 +605,8 @@ static LLConstant* build_offti_array(ClassDeclaration* cd, LLType* arrayT)
|
||||
name.append("__OffsetTypeInfos");
|
||||
|
||||
// create symbol
|
||||
llvm::GlobalVariable* gvar = new llvm::GlobalVariable(arrTy,true,DtoInternalLinkage(cd),arrInit,name,gIR->module);
|
||||
llvm::GlobalVariable* gvar = getOrCreateGlobal(cd->loc, *gIR->module, arrTy,
|
||||
true,DtoInternalLinkage(cd),arrInit,name);
|
||||
ptr = DtoBitCast(gvar, getPtrToType(arrTy->getElementType()));
|
||||
|
||||
return DtoConstSlice(size, ptr);
|
||||
|
||||
Reference in New Issue
Block a user