6 auto new_mut = rewrite_no_eta(old_mut)->as_mut();
7 if (old_mut->
is_external()) new_mut->make_external();
10const Def* EtaRedPhase::rewrite(
const Def* old_def) {
11 if (
auto lam = old_def->isa<
Lam>()) {
12 if (
auto callee = lam->eta_reduce()) {
13 DLOG(
"eta-reduce: `{}` -> `{}`", lam, callee);
15 return rewrite(callee);
bool is_external() const noexcept
const Def * rewrite_imm_Var(const Var *) final
void rewrite_external(Def *) final
bool todo_
Set to true to indicate that you want to rerun all Phasees in current your fixed-point PhaseMan.
World & new_world()
Create new Defs into this.
virtual const Def * rewrite(const Def *)
A variable introduced by a binder (mutable).
const Def * var(Def *mut)
#define DLOG(...)
Vaporizes to nothingness in Debug build.