diff dmd2/template.c @ 953:5fa3e0ea06e9

Merged a bunch recent dmd v1 frontend changes into the dmd v2 tree.
author Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
date Fri, 13 Feb 2009 22:20:30 +0100
parents 356e65836fb5
children 638d16625da2
line wrap: on
line diff
--- a/dmd2/template.c	Thu Feb 12 18:39:14 2009 +0100
+++ b/dmd2/template.c	Fri Feb 13 22:20:30 2009 +0100
@@ -3013,7 +3013,10 @@
     this->havetempdecl = 0;
     this->isnested = NULL;
     this->errors = 0;
+
+    // LDC
     this->tinst = NULL;
+    this->tmodule = NULL;
 }
 
 /*****************
@@ -3041,7 +3044,10 @@
     this->havetempdecl = 1;
     this->isnested = NULL;
     this->errors = 0;
+
+    // LDC
     this->tinst = NULL;
+    this->tmodule = NULL;
 
     assert((size_t)tempdecl->scope > 0x10000);
 }
@@ -3112,6 +3118,13 @@
     // get the enclosing template instance from the scope tinst
     tinst = sc->tinst;
 
+    // get the module of the outermost enclosing instantiation
+    if (tinst)
+    tmodule = tinst->tmodule;
+    else
+    tmodule = sc->module;
+    //printf("%s in %s\n", toChars(), tmodule->toChars());
+
 #if LOG
     printf("\tdo semantic\n");
 #endif