mirror of
https://github.com/xomboverlord/ldc.git
synced 2026-03-02 02:23:13 +01:00
Small code modifications to Ir-Classes.
Adds some constructors and moves the code to the header file. Uses some of the new constructors. A big problem with the source are the different strategies used for otherwise similar classes. E.g. a IrField registers itself with the VarDeclaration. Same is required for IrParameter, but in this case it is done by the caller.
This commit is contained in:
@@ -1121,8 +1121,7 @@ void DtoVarDeclaration(VarDeclaration* vd)
|
||||
*/
|
||||
else if (gIR->func()->retArg && gIR->func()->decl->nrvo_can && gIR->func()->decl->nrvo_var == vd) {
|
||||
assert(!isSpecialRefVar(vd) && "Can this happen?");
|
||||
vd->ir.irLocal = new IrLocal(vd);
|
||||
vd->ir.irLocal->value = gIR->func()->retArg;
|
||||
vd->ir.irLocal = new IrLocal(vd, gIR->func()->retArg);
|
||||
}
|
||||
// normal stack variable, allocate storage on the stack if it has not already been done
|
||||
else {
|
||||
@@ -1339,8 +1338,7 @@ LLValue* DtoRawVarDeclaration(VarDeclaration* var, LLValue* addr)
|
||||
|
||||
assert(!var->ir.isSet());
|
||||
assert(addr);
|
||||
var->ir.irLocal = new IrLocal(var);
|
||||
var->ir.irLocal->value = addr;
|
||||
var->ir.irLocal = new IrLocal(var, addr);
|
||||
}
|
||||
|
||||
// return the alloca
|
||||
|
||||
Reference in New Issue
Block a user