From 3aeb56abec87c1ae5aa31a147bac15c97f49e7af Mon Sep 17 00:00:00 2001 From: Tomas Lindquist Olsen Date: Sat, 9 May 2009 15:27:27 +0200 Subject: [PATCH] Fixed compile unit for debug info for array operations, fixed ticket #280 . --- gen/todebug.cpp | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/gen/todebug.cpp b/gen/todebug.cpp index 47616097..a14b81c7 100644 --- a/gen/todebug.cpp +++ b/gen/todebug.cpp @@ -95,10 +95,19 @@ static const llvm::StructType* getDwarfGlobalVariableType() { // get the module the symbol is in, or - for template instances - the current module static Module* getDefinedModule(Dsymbol* s) { - if (!DtoIsTemplateInstance(s)) - return s->getModule(); - else - return gIR->dmodule; + // templates are defined in current module + if (DtoIsTemplateInstance(s)) + { + return gIR->dmodule; + } + // array operations as well + else if (FuncDeclaration* fd = s->isFuncDeclaration()) + { + if (fd->isArrayOp) + return gIR->dmodule; + } + // otherwise use the symbol's module + return s->getModule(); } //////////////////////////////////////////////////////////////////////////////////////////////////