Add changes for LLVM 3.2.

This commit is contained in:
kai 2012-07-29 17:31:50 +02:00
parent bf2aaaca84
commit dbb5a34eda
7 changed files with 34 additions and 1 deletions

View file

@ -159,8 +159,16 @@ void VarDeclaration::codegen(Ir* p)
LLType *_type = DtoConstInitializerType(type, init);
// create the global variable
#if LDC_LLVM_VER >= 302
// FIXME: clang uses a command line option for the thread model
LLGlobalVariable* gvar = new LLGlobalVariable(*gIR->module, _type, _isconst,
DtoLinkage(this), NULL, _name, 0,
isThreadlocal() ? LLGlobalVariable::GeneralDynamicTLSModel
: LLGlobalVariable::NotThreadLocal);
#else
LLGlobalVariable* gvar = new LLGlobalVariable(*gIR->module, _type, _isconst,
DtoLinkage(this), NULL, _name, 0, isThreadlocal());
#endif
this->ir.irGlobal->value = gvar;
// set the alignment