diff gen/typinf.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 a8cd9bc1021a
line wrap: on
line diff
--- a/gen/typinf.cpp	Thu May 01 13:05:53 2008 +0200
+++ b/gen/typinf.cpp	Thu May 01 13:32:08 2008 +0200
@@ -353,7 +353,7 @@
     ClassDeclaration* base = Type::typeinfotypedef;
     DtoResolveClass(base);
 
-    const llvm::StructType* stype = isaStruct(base->type->llvmType->get());
+    const llvm::StructType* stype = isaStruct(gIR->irType[base->type].type->get());
 
     // create the symbol
     gIR->irDsymbol[this].irGlobal->value = new llvm::GlobalVariable(stype,true,llvm::GlobalValue::WeakLinkage,NULL,toChars(),gIR->module);
@@ -367,7 +367,7 @@
     ClassDeclaration* base = Type::typeinfotypedef;
     DtoForceConstInitDsymbol(base);
 
-    const llvm::StructType* stype = isaStruct(base->type->llvmType->get());
+    const llvm::StructType* stype = isaStruct(gIR->irType[base->type].type->get());
     Logger::cout() << "got stype: " << *stype << '\n';
 
     // vtbl
@@ -439,7 +439,7 @@
     ClassDeclaration* base = Type::typeinfoenum;
     DtoResolveClass(base);
 
-    const llvm::StructType* stype = isaStruct(base->type->llvmType->get());
+    const llvm::StructType* stype = isaStruct(gIR->irType[base->type].type->get());
 
     // create the symbol
     gIR->irDsymbol[this].irGlobal->value = new llvm::GlobalVariable(stype,true,llvm::GlobalValue::WeakLinkage,NULL,toChars(),gIR->module);
@@ -453,7 +453,7 @@
     ClassDeclaration* base = Type::typeinfoenum;
     DtoForceConstInitDsymbol(base);
 
-    const llvm::StructType* stype = isaStruct(base->type->llvmType->get());
+    const llvm::StructType* stype = isaStruct(gIR->irType[base->type].type->get());
 
     // vtbl
     std::vector<llvm::Constant*> sinits;
@@ -521,7 +521,7 @@
     ClassDeclaration* base = cd;
     DtoResolveClass(base);
 
-    const llvm::StructType* stype = isaStruct(base->type->llvmType->get());
+    const llvm::StructType* stype = isaStruct(gIR->irType[base->type].type->get());
 
     // create the symbol
     gIR->irDsymbol[tid].irGlobal->value = new llvm::GlobalVariable(stype,true,llvm::GlobalValue::WeakLinkage,NULL,tid->toChars(),gIR->module);
@@ -532,7 +532,7 @@
     ClassDeclaration* base = cd;
     DtoForceConstInitDsymbol(base);
 
-    const llvm::StructType* stype = isaStruct(base->type->llvmType->get());
+    const llvm::StructType* stype = isaStruct(gIR->irType[base->type].type->get());
 
     // vtbl
     std::vector<llvm::Constant*> sinits;
@@ -626,7 +626,7 @@
     DtoResolveClass(base);
 
     // get type of typeinfo class
-    const llvm::StructType* stype = isaStruct(base->type->llvmType->get());
+    const llvm::StructType* stype = isaStruct(gIR->irType[base->type].type->get());
 
     // create the symbol
     gIR->irDsymbol[this].irGlobal->value = new llvm::GlobalVariable(stype,true,llvm::GlobalValue::WeakLinkage,NULL,toChars(),gIR->module);
@@ -642,7 +642,7 @@
     DtoForceConstInitDsymbol(base);
 
     // get type of typeinfo class
-    const llvm::StructType* stype = isaStruct(base->type->llvmType->get());
+    const llvm::StructType* stype = isaStruct(gIR->irType[base->type].type->get());
 
     // initializer vector
     std::vector<llvm::Constant*> sinits;
@@ -689,7 +689,7 @@
     DtoResolveClass(base);
 
     // get type of typeinfo class
-    const llvm::StructType* stype = isaStruct(base->type->llvmType->get());
+    const llvm::StructType* stype = isaStruct(gIR->irType[base->type].type->get());
 
     // create the symbol
     gIR->irDsymbol[this].irGlobal->value = new llvm::GlobalVariable(stype,true,llvm::GlobalValue::WeakLinkage,NULL,toChars(),gIR->module);
@@ -705,7 +705,7 @@
     DtoForceConstInitDsymbol(base);
 
     // get type of typeinfo class
-    const llvm::StructType* stype = isaStruct(base->type->llvmType->get());
+    const llvm::StructType* stype = isaStruct(gIR->irType[base->type].type->get());
 
     // initializer vector
     std::vector<llvm::Constant*> sinits;
@@ -822,7 +822,7 @@
     ClassDeclaration* base = Type::typeinfostruct;
     DtoResolveClass(base);
 
-    const llvm::StructType* stype = isaStruct(((TypeClass*)base->type)->llvmType->get());
+    const llvm::StructType* stype = isaStruct(gIR->irType[base->type].type->get());
 
     // create the symbol
     gIR->irDsymbol[this].irGlobal->value = new llvm::GlobalVariable(stype,true,llvm::GlobalValue::WeakLinkage,NULL,toChars(),gIR->module);
@@ -841,7 +841,7 @@
     ClassDeclaration* base = Type::typeinfostruct;
     DtoForceConstInitDsymbol(base);
 
-    const llvm::StructType* stype = isaStruct(((TypeClass*)base->type)->llvmType->get());
+    const llvm::StructType* stype = isaStruct(gIR->irType[base->type].type->get());
 
     // vtbl
     std::vector<llvm::Constant*> sinits;
@@ -864,7 +864,7 @@
     }
     else
     {
-        size_t cisize = getTypeStoreSize(tc->llvmType->get());
+        size_t cisize = getTypeStoreSize(gIR->irType[tc].type->get());
         llvm::Constant* cicast = llvm::ConstantExpr::getBitCast(gIR->irDsymbol[sd].irStruct->init, initpt);
         sinits.push_back(DtoConstSlice(DtoConstSize_t(cisize), cicast));
     }
@@ -1022,7 +1022,7 @@
     DtoResolveClass(base);
 
     // get type of typeinfo class
-    const llvm::StructType* stype = isaStruct(base->type->llvmType->get());
+    const llvm::StructType* stype = isaStruct(gIR->irType[base->type].type->get());
 
     // create the symbol
     gIR->irDsymbol[this].irGlobal->value = new llvm::GlobalVariable(stype,true,llvm::GlobalValue::WeakLinkage,NULL,toChars(),gIR->module);
@@ -1039,7 +1039,7 @@
     DtoForceConstInitDsymbol(base);
 
     // get type of typeinfo class
-    const llvm::StructType* stype = isaStruct(base->type->llvmType->get());
+    const llvm::StructType* stype = isaStruct(gIR->irType[base->type].type->get());
 
     // initializer vector
     std::vector<llvm::Constant*> sinits;
@@ -1078,7 +1078,7 @@
     DtoResolveClass(base);
 
     // get type of typeinfo class
-    const llvm::StructType* stype = isaStruct(base->type->llvmType->get());
+    const llvm::StructType* stype = isaStruct(gIR->irType[base->type].type->get());
 
     // create the symbol
     gIR->irDsymbol[this].irGlobal->value = new llvm::GlobalVariable(stype,true,llvm::GlobalValue::WeakLinkage,NULL,toChars(),gIR->module);
@@ -1095,7 +1095,7 @@
     DtoForceConstInitDsymbol(base);
 
     // get type of typeinfo class
-    const llvm::StructType* stype = isaStruct(base->type->llvmType->get());
+    const llvm::StructType* stype = isaStruct(gIR->irType[base->type].type->get());
 
     // initializer vector
     std::vector<llvm::Constant*> sinits;
@@ -1134,7 +1134,7 @@
     DtoResolveClass(base);
 
     // get type of typeinfo class
-    const llvm::StructType* stype = isaStruct(base->type->llvmType->get());
+    const llvm::StructType* stype = isaStruct(gIR->irType[base->type].type->get());
 
     // create the symbol
     gIR->irDsymbol[this].irGlobal->value = new llvm::GlobalVariable(stype,true,llvm::GlobalValue::WeakLinkage,NULL,toChars(),gIR->module);
@@ -1151,7 +1151,7 @@
     DtoForceConstInitDsymbol(base);
 
     // get type of typeinfo class
-    const llvm::StructType* stype = isaStruct(base->type->llvmType->get());
+    const llvm::StructType* stype = isaStruct(gIR->irType[base->type].type->get());
 
     // initializer vector
     std::vector<llvm::Constant*> sinits;
@@ -1168,7 +1168,7 @@
     size_t dim = tu->arguments->dim;
     std::vector<llvm::Constant*> arrInits;
 
-    const llvm::Type* tiTy = Type::typeinfo->type->llvmType->get();
+    const llvm::Type* tiTy = gIR->irType[Type::typeinfo->type].type->get();
     tiTy = getPtrToType(tiTy);
 
     for (size_t i = 0; i < dim; i++)