Skip to content

Commit

Permalink
dinterpret.d: Remove special case for _d_arrayappend{cTX,T} (#17076)
Browse files Browse the repository at this point in the history
PR #14985 introduced `LoweredAssignExp` with a separate field to store the
lowering during semantic analysis. Then #15791 placed the lowering of
`CatAssignExp`s into this field, but did not remove the code that was
previously recreating the original `CatAssignExp` from the lowering
during CTFE.

Signed-off-by: Teodor Dutu <teodor.dutu@gmail.com>
  • Loading branch information
teodutu authored Nov 19, 2024
1 parent a130fa2 commit f1adbd1
Showing 1 changed file with 0 additions and 27 deletions.
27 changes: 0 additions & 27 deletions compiler/src/dmd/dinterpret.d
Original file line number Diff line number Diff line change
Expand Up @@ -4855,33 +4855,6 @@ public:

return;
}
else if (fd.ident == Id._d_arrayappendT || fd.ident == Id._d_arrayappendTTrace)
{
// In expressionsem.d `ea ~= eb` was lowered to `_d_arrayappendT{,Trace}({file, line, funcname}, ea, eb);`.
// The following code will rewrite it back to `ea ~= eb` and then interpret that expression.
Expression lhs, rhs;

if (fd.ident == Id._d_arrayappendT)
{
assert(e.arguments.length == 2);
lhs = (*e.arguments)[0];
rhs = (*e.arguments)[1];
}
else
{
assert(e.arguments.length == 5);
lhs = (*e.arguments)[3];
rhs = (*e.arguments)[4];
}

auto cae = new CatAssignExp(e.loc, lhs, rhs);
cae.type = e.type;

result = interpretRegion(cae, istate, CTFEGoal.LValue);
return;
}
else if (fd.ident == Id._d_arrayappendcTX)
assert(0, "CTFE cannot interpret _d_arrayappendcTX!");
}
else if (auto soe = ecall.isSymOffExp())
{
Expand Down

0 comments on commit f1adbd1

Please sign in to comment.