fix build against LLVM trunk svn rev 273030

This commit is contained in:
Rainer Schuetze 2016-06-18 10:54:23 +02:00
parent 235f392ec8
commit f9995b1883
6 changed files with 28 additions and 0 deletions

View file

@ -1007,7 +1007,11 @@ static void emitJson(Modules &modules) {
} }
int cppmain(int argc, char **argv) { int cppmain(int argc, char **argv) {
#if LDC_LLVM_VER >= 309
llvm::sys::PrintStackTraceOnErrorSignal(argv[0]);
#else
llvm::sys::PrintStackTraceOnErrorSignal(); llvm::sys::PrintStackTraceOnErrorSignal();
#endif
exe_path::initialize(argv[0], reinterpret_cast<void *>(main)); exe_path::initialize(argv[0], reinterpret_cast<void *>(main));

View file

@ -579,7 +579,11 @@ void initializeArrayLiteral(IRState *p, ArrayLiteralExp *ale, LLValue *dstMem) {
auto gvar = new llvm::GlobalVariable(gIR->module, constarr->getType(), auto gvar = new llvm::GlobalVariable(gIR->module, constarr->getType(),
true, LLGlobalValue::InternalLinkage, true, LLGlobalValue::InternalLinkage,
constarr, ".arrayliteral"); constarr, ".arrayliteral");
#if LDC_LLVM_VER >= 309
gvar->setUnnamedAddr(llvm::GlobalValue::UnnamedAddr::Global);
#else
gvar->setUnnamedAddr(true); gvar->setUnnamedAddr(true);
#endif
DtoMemCpy(dstMem, gvar, DtoMemCpy(dstMem, gvar,
DtoConstSize_t(getTypeAllocSize(constarr->getType()))); DtoConstSize_t(getTypeAllocSize(constarr->getType())));
} }

View file

@ -179,7 +179,11 @@ public:
llvm::GlobalValue::PrivateLinkage; llvm::GlobalValue::PrivateLinkage;
gvar = new llvm::GlobalVariable(gIR->module, _init->getType(), true, gvar = new llvm::GlobalVariable(gIR->module, _init->getType(), true,
_linkage, _init, ".str"); _linkage, _init, ".str");
#if LDC_LLVM_VER >= 309
gvar->setUnnamedAddr(llvm::GlobalValue::UnnamedAddr::Global);
#else
gvar->setUnnamedAddr(true); gvar->setUnnamedAddr(true);
#endif
(*stringLiteralCache)[key] = gvar; (*stringLiteralCache)[key] = gvar;
} }
@ -543,7 +547,11 @@ public:
auto gvar = new llvm::GlobalVariable( auto gvar = new llvm::GlobalVariable(
gIR->module, initval->getType(), canBeConst, gIR->module, initval->getType(), canBeConst,
llvm::GlobalValue::InternalLinkage, initval, ".dynarrayStorage"); llvm::GlobalValue::InternalLinkage, initval, ".dynarrayStorage");
#if LDC_LLVM_VER >= 309
gvar->setUnnamedAddr(canBeConst ? llvm::GlobalValue::UnnamedAddr::Global : llvm::GlobalValue::UnnamedAddr::None);
#else
gvar->setUnnamedAddr(canBeConst); gvar->setUnnamedAddr(canBeConst);
#endif
llvm::Constant *store = DtoBitCast(gvar, getPtrToType(arrtype)); llvm::Constant *store = DtoBitCast(gvar, getPtrToType(arrtype));
if (bt->ty == Tpointer) { if (bt->ty == Tpointer) {

View file

@ -469,7 +469,11 @@ public:
} }
gvar = new llvm::GlobalVariable(gIR->module, at, true, _linkage, _init, gvar = new llvm::GlobalVariable(gIR->module, at, true, _linkage, _init,
".str"); ".str");
#if LDC_LLVM_VER >= 309
gvar->setUnnamedAddr(llvm::GlobalValue::UnnamedAddr::Global);
#else
gvar->setUnnamedAddr(true); gvar->setUnnamedAddr(true);
#endif
(*stringLiteralCache)[key] = gvar; (*stringLiteralCache)[key] = gvar;
} }

View file

@ -462,7 +462,11 @@ LLConstant *DtoConstString(const char *str) {
gvar = new llvm::GlobalVariable(gIR->module, init->getType(), true, gvar = new llvm::GlobalVariable(gIR->module, init->getType(), true,
llvm::GlobalValue::PrivateLinkage, init, llvm::GlobalValue::PrivateLinkage, init,
".str"); ".str");
#if LDC_LLVM_VER >= 309
gvar->setUnnamedAddr(llvm::GlobalValue::UnnamedAddr::Global);
#else
gvar->setUnnamedAddr(true); gvar->setUnnamedAddr(true);
#endif
gIR->stringLiteral1ByteCache[s] = gvar; gIR->stringLiteral1ByteCache[s] = gvar;
} }
LLConstant *idxs[] = {DtoConstUint(0), DtoConstUint(0)}; LLConstant *idxs[] = {DtoConstUint(0), DtoConstUint(0)};

View file

@ -353,7 +353,11 @@ llvm::GlobalVariable *IrAggr::getInterfaceVtbl(BaseClass *b, bool new_instance,
// Thunks themselves don't have an identity, only the target // Thunks themselves don't have an identity, only the target
// function has. // function has.
#if LDC_LLVM_VER >= 309
thunk->setUnnamedAddr(llvm::GlobalValue::UnnamedAddr::Global);
#else
thunk->setUnnamedAddr(true); thunk->setUnnamedAddr(true);
#endif
#if LDC_LLVM_VER >= 307 #if LDC_LLVM_VER >= 307
// thunks don't need exception handling themselves // thunks don't need exception handling themselves