changeset 1322:b8c2f3e05b52

Fixed compile unit for debug info for array operations, fixed ticket #280 .
author Tomas Lindquist Olsen <tomas.l.olsen gmail com>
date Sat, 09 May 2009 15:27:27 +0200
parents d55945bcb02d
children c74dfdcc5043
files gen/todebug.cpp
diffstat 1 files changed, 13 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/gen/todebug.cpp	Sat May 09 08:58:55 2009 +0200
+++ b/gen/todebug.cpp	Sat May 09 15:27:27 2009 +0200
@@ -95,10 +95,19 @@
 // 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();
 }
 
 //////////////////////////////////////////////////////////////////////////////////////////////////