diff gen/todebug.cpp @ 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 8a70b4381369
children f0b6549055ab 186d44690036
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(