75#ifdef MIM_ENABLE_CHECKS
76 template<Mode>
bool fail();
79 template<Mode>
bool fail() {
return false; }
80 Ref fail() {
return {}; }
83 template<Mode>
bool alpha_(Ref d1, Ref d2);
84 template<Mode>
bool alpha_internal(Ref, Ref);
85 [[nodiscard]] Ref assignable_(Ref type, Ref value);
@ Test
In Mode::Test, no type inference is happening and Infers will not be touched.
@ Check
In Mode::Check, type inference is happening and Infers will be resolved, if possible.
static Ref is_uniform(Defs defs)
Yields defs.front(), if all defs are Check::alpha-equivalent (Mode::Test) and nullptr otherwise.
static bool alpha(Ref d1, Ref d2)
static Ref assignable(Ref type, Ref value)
Can value be assigned to sth of type?
Def * set(size_t i, Ref)
Successively set from left to right.
Def * reset(size_t i, Ref def)
Successively reset from left to right.
Def * unset()
Unsets all Def::ops; works even, if not set at all or partially.
This node is a hole in the IR that is inferred by its context later on.
Ref tuplefy()
If unset, explode to Tuple.
Infer * stub_(World &, Ref) override
static const Def * find(const Def *)
Union-Find to unify Infer nodes.
static constexpr auto Node
Infer * reset(const Def *op)
Infer * set(const Def *op)
Ref rebuild_(World &, Ref, Defs) const override
Helper class to retrieve Infer::arg if present.
CRTP-based Mixin to declare setters for Def::loc & Def::name using a covariant return type.
This is a thin wrapper for std::span<T, N> with the following additional features:
The World represents the whole program and manages creation of MimIR nodes (Defs).
GIDMap< Def *, To > MutMap