Mercurial > projects > ldc
diff gen/llvmhelpers.cpp @ 918:a4fcc13da3cd
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.
author | Tomas Lindquist Olsen <tomas.l.olsen@gmail.com> |
---|---|
date | Mon, 02 Feb 2009 01:44:51 +0100 |
parents | d128381e086e |
children | 545f54041d91 |
line wrap: on
line diff
--- a/gen/llvmhelpers.cpp Mon Feb 02 00:58:36 2009 +0100 +++ b/gen/llvmhelpers.cpp Mon Feb 02 01:44:51 2009 +0100 @@ -844,7 +844,7 @@ 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);