mirror of
https://github.com/ldc-developers/ldc.git
synced 2025-05-01 23:50:43 +03:00
Removed TODO-riddled DtoInitializer only used in DtoVarDeclaration.
This commit is contained in:
parent
0a7eec400f
commit
d9ce9ce67b
2 changed files with 9 additions and 35 deletions
|
@ -1071,7 +1071,15 @@ void DtoVarDeclaration(VarDeclaration* vd)
|
||||||
if (Logger::enabled())
|
if (Logger::enabled())
|
||||||
Logger::cout() << "llvm value for decl: " << *vd->ir.irLocal->value << '\n';
|
Logger::cout() << "llvm value for decl: " << *vd->ir.irLocal->value << '\n';
|
||||||
|
|
||||||
DtoInitializer(vd->ir.irLocal->value, vd->init); // TODO: Remove altogether?
|
if (vd->init)
|
||||||
|
{
|
||||||
|
if (ExpInitializer* ex = vd->init->isExpInitializer())
|
||||||
|
{
|
||||||
|
// TODO: Refactor this so that it doesn't look like toElem has no effect.
|
||||||
|
Logger::println("expression initializer");
|
||||||
|
ex->exp->toElem(gIR);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
Lexit:
|
Lexit:
|
||||||
/* Mark the point of construction of a variable that needs to be destructed.
|
/* Mark the point of construction of a variable that needs to be destructed.
|
||||||
|
@ -1300,39 +1308,6 @@ LLConstant* DtoConstInitializer(Loc loc, Type* type, Initializer* init)
|
||||||
|
|
||||||
//////////////////////////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
DValue* DtoInitializer(LLValue* target, Initializer* init)
|
|
||||||
{
|
|
||||||
if (!init)
|
|
||||||
return 0;
|
|
||||||
|
|
||||||
if (ExpInitializer* ex = init->isExpInitializer())
|
|
||||||
{
|
|
||||||
Logger::println("expression initializer");
|
|
||||||
assert(ex->exp);
|
|
||||||
return ex->exp->toElem(gIR);
|
|
||||||
}
|
|
||||||
else if (init->isArrayInitializer())
|
|
||||||
{
|
|
||||||
// TODO: do nothing ?
|
|
||||||
}
|
|
||||||
else if (init->isVoidInitializer())
|
|
||||||
{
|
|
||||||
// do nothing
|
|
||||||
}
|
|
||||||
else if (init->isStructInitializer())
|
|
||||||
{
|
|
||||||
// TODO: again nothing ?
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
llvm_unreachable("Unknown initializer type.");
|
|
||||||
}
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
//////////////////////////////////////////////////////////////////////////////////////////
|
|
||||||
|
|
||||||
static LLConstant* expand_to_sarray(Type *base, Expression* exp)
|
static LLConstant* expand_to_sarray(Type *base, Expression* exp)
|
||||||
{
|
{
|
||||||
Logger::println("building type %s from expression (%s) of type %s", base->toChars(), exp->toChars(), exp->type->toChars());
|
Logger::println("building type %s from expression (%s) of type %s", base->toChars(), exp->toChars(), exp->type->toChars());
|
||||||
|
|
|
@ -116,7 +116,6 @@ LLValue* DtoRawVarDeclaration(VarDeclaration* var, LLValue* addr = 0);
|
||||||
// initializer helpers
|
// initializer helpers
|
||||||
LLConstant* DtoConstInitializer(Loc loc, Type* type, Initializer* init);
|
LLConstant* DtoConstInitializer(Loc loc, Type* type, Initializer* init);
|
||||||
LLConstant* DtoConstExpInit(Loc loc, Type* t, Expression* exp);
|
LLConstant* DtoConstExpInit(Loc loc, Type* t, Expression* exp);
|
||||||
DValue* DtoInitializer(LLValue* target, Initializer* init);
|
|
||||||
|
|
||||||
// getting typeinfo of type, base=true casts to object.TypeInfo
|
// getting typeinfo of type, base=true casts to object.TypeInfo
|
||||||
LLConstant* DtoTypeInfoOf(Type* ty, bool base=true);
|
LLConstant* DtoTypeInfoOf(Type* ty, bool base=true);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue