changeset 947:9a10fa839dc5

Switch some getModule to getCompilationModule to make sure templates are emitted in the right module.
author Christian Kamm <kamm incasoftware de>
date Sun, 08 Feb 2009 18:51:32 +0100
parents 1714836f2c0b
children 780530d1cad3
files gen/functions.cpp gen/llvmhelpers.cpp gen/structs.cpp
diffstat 3 files changed, 4 insertions(+), 9 deletions(-) [+]
line wrap: on
line diff
--- a/gen/functions.cpp	Sun Feb 08 16:50:22 2009 +0100
+++ b/gen/functions.cpp	Sun Feb 08 18:51:32 2009 +0100
@@ -646,7 +646,6 @@
 
     // debug info
     if (global.params.symdebug) {
-        Module* mo = fd->getModule();
         fd->ir.irFunc->diSubprogram = DtoDwarfSubProgram(fd);
     }
 
--- a/gen/llvmhelpers.cpp	Sun Feb 08 16:50:22 2009 +0100
+++ b/gen/llvmhelpers.cpp	Sun Feb 08 18:51:32 2009 +0100
@@ -1563,9 +1563,10 @@
     Module* M = DtoIsTemplateInstance(s);
     // if it's a template instance, check the instantiating module
     // not the module that defines the template
-    if (M)
+    if (M) {
         return M == gIR->dmodule;
-    return s->getModule() == gIR->dmodule;
+    }
+    return s->getCompilationModule() == gIR->dmodule;
 #endif
 }
 
--- a/gen/structs.cpp	Sun Feb 08 16:50:22 2009 +0100
+++ b/gen/structs.cpp	Sun Feb 08 18:51:32 2009 +0100
@@ -533,11 +533,6 @@
     // set irstruct info
     irstruct->packed = ispacked;
 
-    // defined in this module?
-    bool thisModule = false;
-    if (sd->getModule() == gIR->dmodule)
-        thisModule = true;
-
     // methods, fields
     Array* arr = sd->members;
     for (int k=0; k < arr->dim; k++) {
@@ -647,7 +642,7 @@
     gIR->structs.pop_back();
 
     // emit typeinfo
-    if (sd->getModule() == gIR->dmodule && sd->llvmInternal != LLVMno_typeinfo)
+    if (sd->getCompilationModule() == gIR->dmodule && sd->llvmInternal != LLVMno_typeinfo)
         DtoTypeInfoOf(sd->type, false);
 }