From 7ef533b136c2a5eecea84b645c2a1b00ec684eb0 Mon Sep 17 00:00:00 2001 From: Tomas Lindquist Olsen Date: Thu, 26 Feb 2009 18:02:13 +0100 Subject: [PATCH] Fixed debug info for globals in D2. --- gen/todebug.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/gen/todebug.cpp b/gen/todebug.cpp index 2d3dbc0b..9b969b87 100644 --- a/gen/todebug.cpp +++ b/gen/todebug.cpp @@ -364,7 +364,11 @@ static llvm::DICompositeType dwarfCompositeType(Type* type, llvm::DICompileUnit 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(