mirror of
https://github.com/ldc-developers/ldc.git
synced 2025-05-01 15:40:55 +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())
|
||||
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:
|
||||
/* 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)
|
||||
{
|
||||
Logger::println("building type %s from expression (%s) of type %s", base->toChars(), exp->toChars(), exp->type->toChars());
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue