[pkg-d-commits] [ldc] 06/14: fix build against LLVM trunk svn rev 273030
Matthias Klumpp
mak at moszumanska.debian.org
Sun Apr 23 22:35:54 UTC 2017
This is an automated email from the git hooks/post-receive script.
mak pushed a commit to annotated tag v0.17.2
in repository ldc.
commit 0f9bf9db3d26fbb4034fb89259217317e071895b
Author: Rainer Schuetze <r.sagitario at gmx.de>
Date: Sat Jun 18 10:54:23 2016 +0200
fix build against LLVM trunk svn rev 273030
(cherry picked from commit f9995b1883d23fcc03b086b53b8b7c6789ff6c6f)
---
driver/main.cpp | 4 ++++
gen/arrays.cpp | 4 ++++
gen/toconstelem.cpp | 8 ++++++++
gen/toir.cpp | 4 ++++
gen/tollvm.cpp | 4 ++++
ir/irclass.cpp | 4 ++++
6 files changed, 28 insertions(+)
diff --git a/driver/main.cpp b/driver/main.cpp
index 3c1835b..f86bdc6 100644
--- a/driver/main.cpp
+++ b/driver/main.cpp
@@ -906,7 +906,11 @@ static void emitJson(Modules &modules) {
int main(int argc, char **argv) {
// stack trace on signals
+#if LDC_LLVM_VER >= 309
+ llvm::sys::PrintStackTraceOnErrorSignal(argv[0]);
+#else
llvm::sys::PrintStackTraceOnErrorSignal();
+#endif
exe_path::initialize(argv[0], reinterpret_cast<void *>(main));
diff --git a/gen/arrays.cpp b/gen/arrays.cpp
index 9b4ecdc..e96d0e3 100644
--- a/gen/arrays.cpp
+++ b/gen/arrays.cpp
@@ -563,7 +563,11 @@ void initializeArrayLiteral(IRState *p, ArrayLiteralExp *ale, LLValue *dstMem) {
auto gvar = new llvm::GlobalVariable(gIR->module, constarr->getType(),
true, LLGlobalValue::InternalLinkage,
constarr, ".arrayliteral");
+#if LDC_LLVM_VER >= 309
+ gvar->setUnnamedAddr(llvm::GlobalValue::UnnamedAddr::Global);
+#else
gvar->setUnnamedAddr(true);
+#endif
DtoMemCpy(dstMem, gvar,
DtoConstSize_t(getTypeAllocSize(constarr->getType())));
}
diff --git a/gen/toconstelem.cpp b/gen/toconstelem.cpp
index d24f641..7e2bb36 100644
--- a/gen/toconstelem.cpp
+++ b/gen/toconstelem.cpp
@@ -204,7 +204,11 @@ public:
llvm::GlobalValue::PrivateLinkage;
gvar = new llvm::GlobalVariable(gIR->module, _init->getType(), true,
_linkage, _init, ".str");
+#if LDC_LLVM_VER >= 309
+ gvar->setUnnamedAddr(llvm::GlobalValue::UnnamedAddr::Global);
+#else
gvar->setUnnamedAddr(true);
+#endif
(*stringLiteralCache)[key] = gvar;
}
@@ -568,7 +572,11 @@ public:
auto gvar = new llvm::GlobalVariable(
gIR->module, initval->getType(), canBeConst,
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);
+#endif
llvm::Constant *store = DtoBitCast(gvar, getPtrToType(arrtype));
if (bt->ty == Tpointer) {
diff --git a/gen/toir.cpp b/gen/toir.cpp
index 23a6916..9093040 100644
--- a/gen/toir.cpp
+++ b/gen/toir.cpp
@@ -464,7 +464,11 @@ public:
}
gvar = new llvm::GlobalVariable(gIR->module, at, true, _linkage, _init,
".str");
+#if LDC_LLVM_VER >= 309
+ gvar->setUnnamedAddr(llvm::GlobalValue::UnnamedAddr::Global);
+#else
gvar->setUnnamedAddr(true);
+#endif
(*stringLiteralCache)[key] = gvar;
}
diff --git a/gen/tollvm.cpp b/gen/tollvm.cpp
index cd75707..d74c855 100644
--- a/gen/tollvm.cpp
+++ b/gen/tollvm.cpp
@@ -465,7 +465,11 @@ LLConstant *DtoConstString(const char *str) {
gvar = new llvm::GlobalVariable(gIR->module, init->getType(), true,
llvm::GlobalValue::PrivateLinkage, init,
".str");
+#if LDC_LLVM_VER >= 309
+ gvar->setUnnamedAddr(llvm::GlobalValue::UnnamedAddr::Global);
+#else
gvar->setUnnamedAddr(true);
+#endif
gIR->stringLiteral1ByteCache[s] = gvar;
}
LLConstant *idxs[] = {DtoConstUint(0), DtoConstUint(0)};
diff --git a/ir/irclass.cpp b/ir/irclass.cpp
index 1793e9d..1f261d3 100644
--- a/ir/irclass.cpp
+++ b/ir/irclass.cpp
@@ -350,7 +350,11 @@ llvm::GlobalVariable *IrAggr::getInterfaceVtbl(BaseClass *b, bool new_instance,
// Thunks themselves don't have an identity, only the target
// function has.
+#if LDC_LLVM_VER >= 309
+ thunk->setUnnamedAddr(llvm::GlobalValue::UnnamedAddr::Global);
+#else
thunk->setUnnamedAddr(true);
+#endif
// create entry and end blocks
llvm::BasicBlock *beginbb =
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-d/ldc.git
More information about the pkg-d-commits
mailing list