mirror of
https://github.com/ldc-developers/ldc.git
synced 2025-05-04 17:11:44 +03: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:
parent
8d7f0bf0eb
commit
6fe28e1660
5 changed files with 46 additions and 88 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue