15 static constexpr size_t Num_Ops = std::dynamic_extent;
32 Sigma*
set(
size_t i,
const Def* def) {
return Def::set(i, def)->as<Sigma>(); }
143 const Def* immutabilize() final;
150 const Def* check(
size_t,
const Def*)
final;
151 const Def* check() final;
190 const Def* immutabilize() final;
206class Extract :
public Def,
public Setters<Extract> {
233class Insert :
public Def,
public Setters<Insert> {
236 : Def(
Node,
tuple->type(), {tuple, index, value}, 0) {}
A (possibly paramterized) Array.
const Def * arity() const final
static constexpr auto Node
constexpr size_t reduction_offset() const noexcept final
First Def::op that needs to be dealt with during reduction; e.g.
Arr * set(const Def *arity, const Def *body)
static constexpr size_t Num_Ops
Arr * set_body(const Def *body)
const Def * reduce(const Def *arg) const final
Arr * set_arity(const Def *arity)
Arr * stub_(World &, const Def *) final
const Def * rebuild_(World &, const Def *, Defs) const final
Arr * stub(const Def *type)
constexpr Node node() const noexcept
Def * set(size_t i, const Def *)
Successively set from left to right.
World & world() const noexcept
constexpr auto ops() const noexcept
const Def * op(size_t i) const noexcept
const Def * type() const noexcept
Yields the "raw" type of this Def (maybe nullptr).
virtual const Def * arity() const
Def * unset()
Unsets all Def::ops; works even, if not set at all or only partially set.
constexpr auto reduce(const Def *arg) const
Def * stub(World &w, const Def *type)
const Def * rebuild_(World &, const Def *, Defs) const final
static constexpr auto Node
const Def * tuple() const
const Def * index() const
static constexpr size_t Num_Ops
const Def * value() const
Pack * stub_(World &, const Def *) final
const Def * arity() const final
static constexpr size_t Num_Ops
const Def * rebuild_(World &, const Def *, Defs) const final
const Def * reduce(const Def *arg) const final
static constexpr auto Node
Pack * set(const Def *body)
Pack * stub(const Def *type)
constexpr size_t reduction_offset() const noexcept final
First Def::op that needs to be dealt with during reduction; e.g.
Base class for Sigma and Tuple.
static constexpr size_t Num_Ops
Def(World *, Node, const Def *type, Defs ops, flags_t flags)
Constructor for an immutable Def.
Base class for Arr and Pack.
Seq * set(const Def *arity, const Def *body)
Common setter for Packs and Arrays.
virtual const Def * reduce(const Def *arg) const =0
Seq * stub(World &w, const Def *type)
Def(World *, Node, const Def *type, Defs ops, flags_t flags)
Constructor for an immutable Def.
CRTP-based Mixin to declare setters for Def::loc & Def::name using a covariant return type.
const Tuple * set(Loc l) const
Sigma * stub(const Def *type)
const Def * rebuild_(World &, const Def *, Defs) const final
constexpr size_t reduction_offset() const noexcept final
const Def * immutabilize() final
Tries to make an immutable from a mutable.
const Def * check() final
After all Def::ops have ben Def::set, this method will be invoked to check the type of this mutable.
Sigma * stub_(World &, const Def *) final
static const Def * infer(World &, Defs)
static constexpr auto Node
const Def * arity() const final
Sigma * set(size_t i, const Def *def)
static constexpr auto Node
The World represents the whole program and manages creation of MimIR nodes (Defs).
const Def * flatten(const Def *def)
Flattens a sigma/array/pack/tuple.
Vector< const Def * > DefVec
bool is_unit(const Def *)
const Def * merge_sigma(const Def *def, Defs defs)
std::string tuple2str(const Def *)
const Def * unflatten(const Def *def, const Def *type)
Applies the reverse transformation on a Pack / Tuple, given the original type.
const Def * tuple_of_types(const Def *t)
const Def * merge_tuple(const Def *def, Defs defs)