mirror of
https://github.com/xomboverlord/ldc.git
synced 2026-04-19 18:29:03 +02:00
Changed templates and typeinfo to use linkonce linkage instead of weak linkage, this should fix inlining problems, fixing bug #197 . If problems show up, it's easy to change it back by changing the define in mars.h . I'm 95% sure this is safe, given how we handle templates.
This commit is contained in:
@@ -844,7 +844,7 @@ bool DtoIsTemplateInstance(Dsymbol* s)
|
||||
void DtoLazyStaticInit(bool istempl, LLValue* gvar, Initializer* init, Type* t)
|
||||
{
|
||||
// create a flag to make sure initialization only happens once
|
||||
llvm::GlobalValue::LinkageTypes gflaglink = istempl ? llvm::GlobalValue::WeakLinkage : llvm::GlobalValue::InternalLinkage;
|
||||
llvm::GlobalValue::LinkageTypes gflaglink = istempl ? TEMPLATE_LINKAGE_TYPE : llvm::GlobalValue::InternalLinkage;
|
||||
std::string gflagname(gvar->getName());
|
||||
gflagname.append("__initflag");
|
||||
llvm::GlobalVariable* gflag = new llvm::GlobalVariable(LLType::Int1Ty,false,gflaglink,DtoConstBool(false),gflagname,gIR->module);
|
||||
|
||||
Reference in New Issue
Block a user