diff gen/tollvm.cpp @ 157:5c17f81fc1c1 trunk

[svn r173] moved IR state previously stored in Type into IrType and a Type->IrType map; fixes #7
author ChristianK
date Thu, 01 May 2008 13:32:08 +0200
parents ccd07d9f2ce9
children b77664331d06
line wrap: on
line diff
--- a/gen/tollvm.cpp	Thu May 01 13:05:53 2008 +0200
+++ b/gen/tollvm.cpp	Thu May 01 13:32:08 2008 +0200
@@ -98,7 +98,7 @@
 
     // aggregates
     case Tstruct:    {
-        if (!t->llvmType || *t->llvmType == NULL) {
+        if (!gIR->irType[t].type || *gIR->irType[t].type == NULL) {
             // recursive or cyclic declaration
             if (!gIR->structs.empty())
             {
@@ -116,11 +116,11 @@
         TypeStruct* ts = (TypeStruct*)t;
         assert(ts->sym);
         DtoResolveDsymbol(ts->sym);
-        return gIR->irDsymbol[ts->sym].irStruct->recty.get();//t->llvmType->get();
+        return gIR->irDsymbol[ts->sym].irStruct->recty.get(); // gIR->irType[t].type->get();
     }
 
     case Tclass:    {
-        /*if (!t->llvmType || *t->llvmType == NULL) {
+        /*if (!gIR->irType[t].type || *gIR->irType[t].type == NULL) {
             // recursive or cyclic declaration
             if (!gIR->structs.empty())
             {
@@ -139,28 +139,28 @@
         TypeClass* tc = (TypeClass*)t;
         assert(tc->sym);
         DtoResolveDsymbol(tc->sym);
-        return getPtrToType(gIR->irDsymbol[tc->sym].irStruct->recty.get());//t->llvmType->get());
+        return getPtrToType(gIR->irDsymbol[tc->sym].irStruct->recty.get()); // gIR->irType[t].type->get());
     }
 
     // functions
     case Tfunction:
     {
-        if (!t->llvmType || *t->llvmType == NULL) {
+        if (!gIR->irType[t].type || *gIR->irType[t].type == NULL) {
             return DtoFunctionType(t,NULL);
         }
         else {
-            return t->llvmType->get();
+            return gIR->irType[t].type->get();
         }
     }
 
     // delegates
     case Tdelegate:
     {
-        if (!t->llvmType || *t->llvmType == NULL) {
+        if (!gIR->irType[t].type || *gIR->irType[t].type == NULL) {
             return DtoDelegateType(t);
         }
         else {
-            return t->llvmType->get();
+            return gIR->irType[t].type->get();
         }
     }
 
@@ -1797,7 +1797,7 @@
     // ClassInfo classinfo
     ClassDeclaration* cd2 = ClassDeclaration::classinfo;
     DtoResolveClass(cd2);
-    types.push_back(getPtrToType(cd2->type->llvmType->get()));
+    types.push_back(getPtrToType(gIR->irType[cd2->type].type->get()));
     // void*[] vtbl
     std::vector<const llvm::Type*> vtbltypes;
     vtbltypes.push_back(DtoSize_t());