[pkg-d-commits] [ldc] 06/211: Fix LLVM 4.0 build, there was another debuginfo change.

Matthias Klumpp mak at moszumanska.debian.org
Sun Apr 23 22:36:04 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 a561b6a496bda1e25620d7f413d911bdd9651eea
Author: Johan Engelen <jbc.engelen at gmail.com>
Date:   Wed Sep 14 11:07:58 2016 +0200

    Fix LLVM 4.0 build, there was another debuginfo change.
---
 gen/dibuilder.cpp | 25 +++++++++++++------------
 gen/dibuilder.h   |  4 ++--
 2 files changed, 15 insertions(+), 14 deletions(-)

diff --git a/gen/dibuilder.cpp b/gen/dibuilder.cpp
index acb6e41..f75ed51 100644
--- a/gen/dibuilder.cpp
+++ b/gen/dibuilder.cpp
@@ -1070,16 +1070,10 @@ void ldc::DIBuilder::EmitLocalVariable(llvm::Value *ll, VarDeclaration *vd,
 #endif
 }
 
-ldc::DIGlobalVariable
-ldc::DIBuilder::EmitGlobalVariable(llvm::GlobalVariable *ll,
-                                   VarDeclaration *vd) {
-  if (!global.params.symdebug) {
-#if LDC_LLVM_VER >= 307
-    return nullptr;
-#else
-    return llvm::DIGlobalVariable();
-#endif
-  }
+void ldc::DIBuilder::EmitGlobalVariable(llvm::GlobalVariable *llVar,
+                                        VarDeclaration *vd) {
+  if (!global.params.symdebug)
+    return;
 
   Logger::println("D to dwarf global_variable");
   LOG_SCOPE;
@@ -1087,7 +1081,7 @@ ldc::DIBuilder::EmitGlobalVariable(llvm::GlobalVariable *ll,
   assert(vd->isDataseg() ||
          (vd->storage_class & (STCconst | STCimmutable) && vd->_init));
 
-  return DBuilder.createGlobalVariable(
+  auto DIVar = DBuilder.createGlobalVariable(
 #if LDC_LLVM_VER >= 306
       GetCU(), // context
 #endif
@@ -1097,8 +1091,15 @@ ldc::DIBuilder::EmitGlobalVariable(llvm::GlobalVariable *ll,
       vd->loc.linnum,                         // line num
       CreateTypeDescription(vd->type, false), // type
       vd->protection.kind == PROTprivate,     // is local to unit
-      ll                                      // value
+#if LDC_LLVM_VER >= 400
+      nullptr // relative location of field
+#else
+      llVar // value
+#endif
       );
+#if LDC_LLVM_VER >= 400
+  llVar->addDebugInfo(DIVar);
+#endif
 }
 
 void ldc::DIBuilder::Finalize() {
diff --git a/gen/dibuilder.h b/gen/dibuilder.h
index c189f48..bccf376 100644
--- a/gen/dibuilder.h
+++ b/gen/dibuilder.h
@@ -157,8 +157,8 @@ public:
   /// variable vd.
   /// \param ll       LLVM global variable
   /// \param vd       Variable declaration to emit debug info for.
-  DIGlobalVariable EmitGlobalVariable(llvm::GlobalVariable *ll,
-                                      VarDeclaration *vd); // FIXME
+  void EmitGlobalVariable(llvm::GlobalVariable *ll,
+                          VarDeclaration *vd); // FIXME
 
   void Finalize();
 

-- 
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