diff gen/toobj.cpp @ 139:0ab29b838084 trunk

[svn r143] Fixed: a few bugs in debug information, still only line info, but should be correct files now :) Fixed: tango.io.Console seems to be working now.
author lindquist
date Tue, 22 Jan 2008 00:01:16 +0100
parents ce7b81fb957f
children 4c577c2b7229
line wrap: on
line diff
--- a/gen/toobj.cpp	Fri Jan 18 20:13:19 2008 +0100
+++ b/gen/toobj.cpp	Tue Jan 22 00:01:16 2008 +0100
@@ -42,6 +42,7 @@
 #include "gen/runtime.h"
 
 #include "ir/irvar.h"
+#include "ir/irmodule.h"
 
 //////////////////////////////////////////////////////////////////////////////////////////
 
@@ -59,10 +60,15 @@
     deleteObjFile();
 
     // create a new ir state
+    // TODO look at making the instance static and moving most functionality into IrModule where it belongs
     IRState ir;
     gIR = &ir;
     ir.dmodule = this;
 
+    // module ir state
+    // might already exist via import, just overwrite...
+    irModule = new IrModule(this);
+
     // name the module
     std::string mname(toChars());
     if (md != 0)
@@ -88,7 +94,7 @@
     // debug info
     if (global.params.symdebug) {
         RegisterDwarfSymbols(ir.module);
-        ir.dmodule->llvmCompileUnit = DtoDwarfCompileUnit(this,true);
+        DtoDwarfCompileUnit(this);
     }
 
     // start out by providing opaque for the built-in class types