mirror of
https://github.com/ldc-developers/ldc.git
synced 2025-05-01 15:40:55 +03: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:
parent
0305d3bce2
commit
acd508945a
9 changed files with 63 additions and 34 deletions
|
@ -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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue