16 Ref map(
Ref old_def,
Ref new_def) {
return old2new_[old_def] = new_def; }
36 if (
auto v = var->isa<
Var>()) {
const Def * op(size_t i) const
Ref var(nat_t a, nat_t i)
const Var * has_var()
Only returns not nullptr, if Var of this mutable has ever been created.
constexpr bool empty() const noexcept
Helper class to retrieve Infer::arg if present.
Recurseivly rewrites part of a program into the provided World.
virtual Ref rewrite_imm(Ref)
Ref map(Ref old_def, Ref new_def)
Map old_def to new_def and returns new_def;.
virtual Ref rewrite_mut(Def *)
VarRewriter(Ref var, Ref arg)
Ref rewrite_imm(Ref imm) override
Ref rewrite_mut(Def *mut) override
The World represents the whole program and manages creation of MimIR nodes (Defs).
Vars vars(const Var *var)
Ref insert(Ref d, Ref i, Ref val)
DefMap< const Def * > Def2Def
Vector< const Def * > DefVec
DefVec rewrite(Def *mut, Ref arg)