diff gen/typinf.cpp @ 1147:dbe4af57b240

Changed use of toObjFile to a new codegen method. More versioning of DMD specific codegen code.
author Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
date Fri, 27 Mar 2009 17:54:27 +0100
parents 1860414bf3b7
children 3d1b16dabd25
line wrap: on
line diff
--- a/gen/typinf.cpp	Thu Mar 26 20:45:53 2009 +0100
+++ b/gen/typinf.cpp	Fri Mar 27 17:54:27 2009 +0100
@@ -138,13 +138,17 @@
         }
         else            // if in obj generation pass
         {
+#if IN_DMD
         t->vtinfo->toObjFile(0); // TODO: multiobj
+#else
+        t->vtinfo->codegen(sir);
+#endif
         }
     }
     }
     e = new VarExp(0, t->vtinfo);
-    //e = e->addressOf(sc);
-    //e->type = t->vtinfo->type;      // do this so we don't get redundant dereference
+    e = e->addressOf(sc);
+    e->type = t->vtinfo->type;      // do this so we don't get redundant dereference
     return e;
 }
 
@@ -267,11 +271,6 @@
 //                             MAGIC   PLACE
 //////////////////////////////////////////////////////////////////////////////
 
-void TypeInfoDeclaration::toObjFile(int multiobj)
-{
-    gIR->resolveList.push_back(this);
-}
-
 void DtoResolveTypeInfo(TypeInfoDeclaration* tid)
 {
     if (tid->ir.resolved) return;
@@ -285,6 +284,11 @@
     gIR->declareList.push_back(tid);
 }
 
+void TypeInfoDeclaration::codegen(Ir*)
+{
+    DtoResolveTypeInfo(this);
+}
+
 void DtoDeclareTypeInfo(TypeInfoDeclaration* tid)
 {
     if (tid->ir.declared) return;