[pkg-d-commits] [ldc] 128/149: Fix LLVM 5.0 compilation
Matthias Klumpp
mak at moszumanska.debian.org
Sun Apr 23 22:37:05 UTC 2017
This is an automated email from the git hooks/post-receive script.
mak pushed a commit to annotated tag v1.2.0
in repository ldc.
commit c2b539c348bce872ff60224de0e1c86dfdba99c6
Author: Johan Engelen <jbc.engelen at gmail.com>
Date: Tue Mar 14 23:45:56 2017 +0100
Fix LLVM 5.0 compilation
---
gen/dibuilder.cpp | 16 +++++++++++++++-
1 file changed, 15 insertions(+), 1 deletion(-)
diff --git a/gen/dibuilder.cpp b/gen/dibuilder.cpp
index 360fa03..a207722 100644
--- a/gen/dibuilder.cpp
+++ b/gen/dibuilder.cpp
@@ -289,9 +289,18 @@ ldc::DIType ldc::DIBuilder::CreatePointerType(Type *type) {
if (nt->toBasetype()->ty == Tvoid)
nt = Type::tuns8;
+#if LDC_LLVM_VER >= 500
+ // TODO: The addressspace is important for dcompute targets.
+ // See e.g. https://www.mail-archive.com/dwarf-discuss@lists.dwarfstd.org/msg00326.html
+ const llvm::Optional<unsigned> DWARFAddressSpace = llvm::None;
+#endif
+
return DBuilder.createPointerType(CreateTypeDescription(nt, false),
getTypeAllocSize(T) * 8, // size (bits)
getABITypeAlign(T) * 8, // align (bits)
+#if LDC_LLVM_VER >= 500
+ DWARFAddressSpace,
+#endif
type->toChars() // name
);
}
@@ -692,7 +701,12 @@ ldc::DIType ldc::DIBuilder::CreateTypeDescription(Type *type, bool derefclass) {
#endif
if (t->ty == Tnull) // display null as void*
return DBuilder.createPointerType(CreateTypeDescription(Type::tvoid, false),
- 8, 8, "typeof(null)");
+ 8, 8,
+#if LDC_LLVM_VER >= 500
+ /* DWARFAddressSpace */ llvm::None,
+#endif
+
+ "typeof(null)");
if (t->ty == Tvector)
return CreateVectorType(type);
if (t->isintegral() || t->isfloating()) {
--
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