Mercurial > projects > ldc
diff gen/typinf.cpp @ 1364:46f6365a50d7
Added IrTypeFunction and IrTypeDelegate and eliminated IrDType. This means the Type::ir field can be removed. It's the final part needed for the move to a slightly more sane type system. Now the whole thing just needs to be cleaned up :P
Added -v-cg switch, which right now just prints "codegen: module.name (module/name.d)" to stdout, this can really help figuring out where, in some complex build command, things go wrong.
author | Tomas Lindquist Olsen <tomas.l.olsen gmail com> |
---|---|
date | Sat, 16 May 2009 18:19:52 +0200 |
parents | 78038e540342 |
children | 8026319762be |
line wrap: on
line diff
--- a/gen/typinf.cpp Sat May 16 14:22:23 2009 +0200 +++ b/gen/typinf.cpp Sat May 16 18:19:52 2009 +0200 @@ -43,6 +43,7 @@ #include "gen/metadata.h" #include "ir/irvar.h" +#include "ir/irtype.h" /******************************************* * Get a canonicalized form of the TypeInfo for use with the internal @@ -331,7 +332,7 @@ // this is a declaration of a builtin __initZ var if (tid->tinfo->builtinTypeInfo()) { // fixup the global - const llvm::Type* rty = Type::typeinfo->type->ir.type->get(); + const llvm::Type* rty = Type::typeinfo->type->irtype->getPA().get(); llvm::cast<llvm::OpaqueType>(irg->type.get())->refineAbstractTypeTo(rty); LLGlobalVariable* g = isaGlobalVar(irg->value); g->setLinkage(llvm::GlobalValue::ExternalLinkage); @@ -544,7 +545,7 @@ base->codegen(Type::sir); // get type of typeinfo class - const LLStructType* stype = isaStruct(base->type->ir.type->get()); + const LLStructType* stype = isaStruct(base->type->irtype->getPA().get()); // initializer vector std::vector<LLConstant*> sinits; @@ -665,7 +666,7 @@ ClassDeclaration* base = Type::typeinfostruct; base->codegen(Type::sir); - const LLStructType* stype = isaStruct(base->type->ir.type->get()); + const LLStructType* stype = isaStruct(base->type->irtype->getPA()); // vtbl std::vector<LLConstant*> sinits; @@ -691,7 +692,7 @@ else #endif { - size_t cisize = getTypeStoreSize(tc->ir.type->get()); + size_t cisize = getTypeStoreSize(tc->irtype->getPA().get()); LLConstant* cicast = llvm::ConstantExpr::getBitCast(sd->ir.irStruct->getInitSymbol(), initpt); sinits.push_back(DtoConstSlice(DtoConstSize_t(cisize), cicast)); } @@ -903,7 +904,7 @@ base->codegen(Type::sir); // get type of typeinfo class - const LLStructType* stype = isaStruct(base->type->ir.type->get()); + const LLStructType* stype = isaStruct(base->type->irtype->getPA()); // initializer vector std::vector<LLConstant*> sinits; @@ -939,7 +940,7 @@ base->codegen(Type::sir); // get type of typeinfo class - const LLStructType* stype = isaStruct(base->type->ir.type->get()); + const LLStructType* stype = isaStruct(base->type->irtype->getPA()); // initializer vector std::vector<LLConstant*> sinits; @@ -956,7 +957,7 @@ size_t dim = tu->arguments->dim; std::vector<LLConstant*> arrInits; - const LLType* tiTy = Type::typeinfo->type->ir.type->get(); + const LLType* tiTy = Type::typeinfo->type->irtype->getPA(); tiTy = getPtrToType(tiTy); for (size_t i = 0; i < dim; i++)