[pkg-d-commits] [ldc] 198/211: Fix LLVM trunk build. (#1936)
Matthias Klumpp
mak at moszumanska.debian.org
Sun Apr 23 22:36:23 UTC 2017
This is an automated email from the git hooks/post-receive script.
mak pushed a commit to annotated tag v1.1.0
in repository ldc.
commit ca80254ed62e6fa6eabbca824122cb023f711253
Author: Johan Engelen <jbc.engelen at gmail.com>
Date: Thu Dec 22 17:59:03 2016 +0100
Fix LLVM trunk build. (#1936)
---
gen/dibuilder.cpp | 30 ++++++++++++++++++------------
gen/tollvm.cpp | 20 +++++++++++++++-----
2 files changed, 33 insertions(+), 17 deletions(-)
diff --git a/gen/dibuilder.cpp b/gen/dibuilder.cpp
index ab76ba0..a105b50 100644
--- a/gen/dibuilder.cpp
+++ b/gen/dibuilder.cpp
@@ -780,7 +780,12 @@ void ldc::DIBuilder::EmitCompileUnit(Module *m) {
CUNode = DBuilder.createCompileUnit(
global.params.symdebug == 2 ? llvm::dwarf::DW_LANG_C
: llvm::dwarf::DW_LANG_D,
+#if LDC_LLVM_VER >= 400
+ DBuilder.createFile(llvm::sys::path::filename(srcpath),
+ llvm::sys::path::parent_path(srcpath)),
+#else
llvm::sys::path::filename(srcpath), llvm::sys::path::parent_path(srcpath),
+#endif
"LDC (http://wiki.dlang.org/LDC)",
isOptimizationEnabled(), // isOptimized
llvm::StringRef(), // Flags TODO
@@ -1210,24 +1215,25 @@ void ldc::DIBuilder::EmitGlobalVariable(llvm::GlobalVariable *llVar,
(vd->storage_class & (STCconst | STCimmutable) && vd->_init));
#if LDC_LLVM_VER >= 400
- auto DIVar =
+ auto DIVar = DBuilder.createGlobalVariableExpression(
+#else
+ DBuilder.createGlobalVariable(
#endif
- DBuilder.createGlobalVariable(
#if LDC_LLVM_VER >= 306
- GetCU(), // context
+ GetCU(), // context
#endif
- vd->toChars(), // name
- mangle(vd), // linkage name
- CreateFile(vd), // file
- vd->loc.linnum, // line num
- CreateTypeDescription(vd->type, false), // type
- vd->protection.kind == PROTprivate, // is local to unit
+ vd->toChars(), // name
+ mangle(vd), // linkage name
+ CreateFile(vd), // file
+ vd->loc.linnum, // line num
+ CreateTypeDescription(vd->type, false), // type
+ vd->protection.kind == PROTprivate, // is local to unit
#if LDC_LLVM_VER >= 400
- nullptr // relative location of field
+ nullptr // relative location of field
#else
- llVar // value
+ llVar // value
#endif
- );
+ );
#if LDC_LLVM_VER >= 400
llVar->addDebugInfo(DIVar);
diff --git a/gen/tollvm.cpp b/gen/tollvm.cpp
index 554ce2d..85e0cc0 100644
--- a/gen/tollvm.cpp
+++ b/gen/tollvm.cpp
@@ -412,6 +412,16 @@ llvm::ConstantInt *DtoConstUbyte(unsigned char i) {
}
LLConstant *DtoConstFP(Type *t, longdouble value) {
+#if LDC_LLVM_VER >= 400
+ auto &x87DoubleExtended = APFloat::x87DoubleExtended();
+ auto &IEEEquad = APFloat::IEEEquad();
+ auto &PPCDoubleDouble = APFloat::PPCDoubleDouble();
+#else
+ auto &x87DoubleExtended = APFloat::x87DoubleExtended;
+ auto &IEEEquad = APFloat::IEEEquad;
+ auto &PPCDoubleDouble = APFloat::PPCDoubleDouble;
+#endif
+
LLType *llty = DtoType(t);
assert(llty->isFloatingPointTy());
@@ -424,8 +434,8 @@ LLConstant *DtoConstFP(Type *t, longdouble value) {
bits[0] = *reinterpret_cast<uint64_t *>(&value);
bits[1] =
*reinterpret_cast<uint16_t *>(reinterpret_cast<uint64_t *>(&value) + 1);
- return LLConstantFP::get(gIR->context(), APFloat(APFloat::x87DoubleExtended,
- APInt(80, 2, bits)));
+ return LLConstantFP::get(gIR->context(),
+ APFloat(x87DoubleExtended, APInt(80, 2, bits)));
}
if (llty == LLType::getFP128Ty(gIR->context())) {
union {
@@ -434,15 +444,15 @@ LLConstant *DtoConstFP(Type *t, longdouble value) {
} t;
t.ld = value;
return LLConstantFP::get(gIR->context(),
- APFloat(APFloat::IEEEquad, APInt(128, 2, t.bits)));
+ APFloat(IEEEquad, APInt(128, 2, t.bits)));
}
if (llty == LLType::getPPC_FP128Ty(gIR->context())) {
uint64_t bits[] = {0, 0};
bits[0] = *reinterpret_cast<uint64_t *>(&value);
bits[1] =
*reinterpret_cast<uint16_t *>(reinterpret_cast<uint64_t *>(&value) + 1);
- return LLConstantFP::get(
- gIR->context(), APFloat(APFloat::PPCDoubleDouble, APInt(128, 2, bits)));
+ return LLConstantFP::get(gIR->context(),
+ APFloat(PPCDoubleDouble, APInt(128, 2, bits)));
}
llvm_unreachable("Unknown floating point type encountered");
--
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