Changed use of toObjFile to a new codegen method.

More versioning of DMD specific codegen code.
This commit is contained in:
Tomas Lindquist Olsen
2009-03-27 17:54:27 +01:00
parent c42c90ea80
commit daef67acc3
23 changed files with 446 additions and 351 deletions

View File

@@ -138,13 +138,17 @@ Expression *Type::getTypeInfo(Scope *sc)
}
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 @@ Expression *createTypeInfoArray(Scope *sc, Expression *exps[], int dim)
// 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 @@ void DtoResolveTypeInfo(TypeInfoDeclaration* tid)
gIR->declareList.push_back(tid);
}
void TypeInfoDeclaration::codegen(Ir*)
{
DtoResolveTypeInfo(this);
}
void DtoDeclareTypeInfo(TypeInfoDeclaration* tid)
{
if (tid->ir.declared) return;