changeset 998:ff22650d0ca3

Fixed debug info for globals in D2.
author Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
date Thu, 26 Feb 2009 18:02:13 +0100
parents 4f12ec3216cf
children 2b6c2e961f25
files gen/todebug.cpp
diffstat 1 files changed, 4 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/gen/todebug.cpp	Thu Feb 26 15:51:19 2009 +0100
+++ b/gen/todebug.cpp	Thu Feb 26 18:02:13 2009 +0100
@@ -364,7 +364,11 @@
 
 static llvm::DIGlobalVariable dwarfGlobalVariable(LLGlobalVariable* ll, VarDeclaration* vd)
 {
+#if DMDV2
+    assert(vd->isDataseg() || (vd->storage_class & (STCconst | STCinvariant) && vd->init));
+#else
     assert(vd->isDataseg());
+#endif
     llvm::DICompileUnit compileUnit = DtoDwarfCompileUnit(gIR->dmodule);
 
     return gIR->difactory.CreateGlobalVariable(