mirror of
https://github.com/xomboverlord/ldc.git
synced 2026-01-28 10: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:
@@ -17,6 +17,7 @@
|
||||
#include "root.h"
|
||||
#include "gen/irstate.h"
|
||||
#include "gen/llvm.h"
|
||||
#include "gen/llvmhelpers.h"
|
||||
#include "gen/logger.h"
|
||||
#include "gen/tollvm.h"
|
||||
#include "ir/irtype.h"
|
||||
@@ -121,8 +122,8 @@ llvm::GlobalVariable* LLVM_D_GetRuntimeGlobal(llvm::Module* target, const char*
|
||||
}
|
||||
|
||||
LLPointerType* t = g->getType();
|
||||
return new LLGlobalVariable(*target, t->getElementType(), g->isConstant(),
|
||||
g->getLinkage(), NULL, g->getName());
|
||||
return getOrCreateGlobal(Loc(), *target, t->getElementType(), g->isConstant(),
|
||||
g->getLinkage(), NULL, g->getName());
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
Reference in New Issue
Block a user