Mercurial > projects > ldc
comparison gen/toobj.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 |
comparison
equal
deleted
inserted
replaced
156:ccd07d9f2ce9 | 157:5c17f81fc1c1 |
---|---|
96 RegisterDwarfSymbols(ir.module); | 96 RegisterDwarfSymbols(ir.module); |
97 DtoDwarfCompileUnit(this); | 97 DtoDwarfCompileUnit(this); |
98 } | 98 } |
99 | 99 |
100 // start out by providing opaque for the built-in class types | 100 // start out by providing opaque for the built-in class types |
101 if (!ClassDeclaration::object->type->llvmType) | 101 if (!gIR->irType[ClassDeclaration::object->type].type) |
102 ClassDeclaration::object->type->llvmType = new llvm::PATypeHolder(llvm::OpaqueType::get()); | 102 gIR->irType[ClassDeclaration::object->type].type = new llvm::PATypeHolder(llvm::OpaqueType::get()); |
103 | 103 |
104 if (!Type::typeinfo->type->llvmType) | 104 if (!gIR->irType[Type::typeinfo->type].type) |
105 Type::typeinfo->type->llvmType = new llvm::PATypeHolder(llvm::OpaqueType::get()); | 105 gIR->irType[Type::typeinfo->type].type = new llvm::PATypeHolder(llvm::OpaqueType::get()); |
106 | 106 |
107 if (!ClassDeclaration::classinfo->type->llvmType) | 107 if (!gIR->irType[ClassDeclaration::classinfo->type].type) |
108 ClassDeclaration::classinfo->type->llvmType = new llvm::PATypeHolder(llvm::OpaqueType::get()); | 108 gIR->irType[ClassDeclaration::classinfo->type].type = new llvm::PATypeHolder(llvm::OpaqueType::get()); |
109 | 109 |
110 /*if (!Type::typeinfoclass->type->llvmType) | 110 /*if (!gIR->irType[Type::typeinfoclass->type].type) |
111 Type::typeinfoclass->type->llvmType = new llvm::PATypeHolder(llvm::OpaqueType::get());*/ | 111 gIR->irType[Type::typeinfoclass->type].type = new llvm::PATypeHolder(llvm::OpaqueType::get());*/ |
112 | 112 |
113 // process module members | 113 // process module members |
114 for (int k=0; k < members->dim; k++) { | 114 for (int k=0; k < members->dim; k++) { |
115 Dsymbol* dsym = (Dsymbol*)(members->data[k]); | 115 Dsymbol* dsym = (Dsymbol*)(members->data[k]); |
116 assert(dsym); | 116 assert(dsym); |
287 // resolve ModuleInfo | 287 // resolve ModuleInfo |
288 assert(moduleinfo); | 288 assert(moduleinfo); |
289 DtoForceConstInitDsymbol(moduleinfo); | 289 DtoForceConstInitDsymbol(moduleinfo); |
290 | 290 |
291 // moduleinfo llvm struct type | 291 // moduleinfo llvm struct type |
292 const llvm::StructType* moduleinfoTy = isaStruct(moduleinfo->type->llvmType->get()); | 292 const llvm::StructType* moduleinfoTy = isaStruct(gIR->irType[moduleinfo->type].type->get()); |
293 | 293 |
294 // classinfo llvm struct type | 294 // classinfo llvm struct type |
295 const llvm::StructType* classinfoTy = isaStruct(ClassDeclaration::classinfo->type->llvmType->get()); | 295 const llvm::StructType* classinfoTy = isaStruct(gIR->irType[ClassDeclaration::classinfo->type].type->get()); |
296 | 296 |
297 // initializer vector | 297 // initializer vector |
298 std::vector<llvm::Constant*> initVec; | 298 std::vector<llvm::Constant*> initVec; |
299 llvm::Constant* c = 0; | 299 llvm::Constant* c = 0; |
300 | 300 |