27 Sigma*
set(
size_t i,
const Def* def) {
return Def::set(i, def)->as<Sigma>(); }
125 const Def* rebuild(
World& w,
const Def* shape,
const Def* body)
const final;
127 const Def* immutabilize() final;
135 const Def* check(
size_t,
const Def*)
final;
136 const Def* check() final;
174 const Def* rebuild(
World& w,
const Def* shape,
const Def* body)
const final;
176 const Def* immutabilize() final;
192class Extract :
public Def,
public Setters<Extract> {
218class Insert :
public Def,
public Setters<Insert> {
221 : Def(
Node,
tuple->type(), {tuple, index, value}, 0) {}
A (possibly paramterized) Array.
static constexpr auto Node
const Def * shape() const final
constexpr size_t reduction_offset() const noexcept final
First Def::op that needs to be dealt with during reduction; e.g.
Arr * set_body(const Def *body)
Arr * set(const Def *shape, const Def *body)
Arr * set_shape(const Def *shape)
Arr * stub_(World &, const Def *) final
const Def * rebuild_(World &, const Def *, Defs) const final
const Def * reduce(const Def *arg) const
Arr * stub(const Def *type)
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).
Def * unset()
Unsets all Def::ops; works even, if not set at all or partially.
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
const Def * value() const
Pack * stub_(World &, const Def *) final
Pack * reset(const Def *body)
const Def * rebuild_(World &, const Def *, Defs) const final
const Def * shape() const final
const Def * reduce(const Def *arg) const
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.
Def(World *, Node, const Def *type, Defs ops, flags_t flags)
Constructor for an immutable Def.
Base class for Arr and Pack.
virtual const Def * prod(World &w, Defs) const =0
Creates either a Tuple or Sigma.
virtual const Def * shape() const =0
virtual const Def * rebuild(World &, const Def *shape, const Def *body) 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
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)