12 if (
auto [_, ins] = analyzed_.emplace(def); !ins)
return;
14 for (
auto d : def->
deps())
18void BetaRed::visit(
const Def* def,
bool candidate) {
19 if (
auto lam = def->isa_mut<
Lam>()) {
20 if (
auto [i, ins] = candidates_.emplace(lam, candidate); !ins) i->second =
false;
28 if (
auto var = old_lam->has_var()) {
34 return rewrite(old_lam->body());
37 return RWPhase::rewrite_imm_App(app);
const Def * callee() const
const Def * rewrite_imm_App(const App *) final
bool analyze() final
Runs the optional pre-analysis on RWPhase::old_world(), typically to a fixed point,...
bool is_set() const
Yields true if empty or the last op is set.
Defs deps() const noexcept
T * isa_mut() const
If this is mutable, it will cast constness away and perform a dynamic_cast to T.
void invalidate(bool todo=true)
Signals that another round of fixed-point iteration is required, either as part of.
void profile_count(std::string_view key, uint64_t n=1)
Adds n to the custom Profiler counter key of the current run; no-op unless profiling is enabled.
World & old_world()
Get old Defs from here.
virtual const Def * map(const Def *old_def, const Def *new_def)
virtual const Def * rewrite(const Def *)