11 static constexpr size_t Type = -1_s;
18 size_t index()
const {
return index_; }
19 const Def*
def()
const {
return def_; }
20 operator const Def*()
const {
return def_; }
22 bool operator==(
Use other)
const {
return this->def_ == other.def_ && this->index_ == other.index_; }
31 if constexpr (
sizeof(size_t) == 8)
42using Uses = absl::flat_hash_set<Use, UseHash, UseEq>;
62 Def*
root()
const {
return nest_->root()->mut(); }
64 if (
auto i = def2uses_.find(def); i != def2uses_.end())
return i->second;
85 swap(s1.nest_, s2.nest_);
86 swap(s1.early_, s2.early_);
87 swap(s1.late_, s2.late_);
88 swap(s1.smart_, s2.smart_);
89 swap(s1.def2uses_, s2.def2uses_);
93 const Nest* nest_ =
nullptr;
constexpr u32 gid() const noexcept
Global id - unique number for this Def.
Builds a nesting tree of all immutables‍/binders.
const Nest::Node * smart(Def *curr, const Def *)
Scheduler(Scheduler &&other) noexcept
Scheduler(const Scheduler &)=delete
Scheduler & operator=(Scheduler other) noexcept
const Nest::Node * late(Def *curr, const Def *)
const Uses & uses(const Def *def) const
static Schedule schedule(const Nest &)
const Nest & nest() const
const Nest::Node * early(const Def *)
friend void swap(Scheduler &s1, Scheduler &s2) noexcept
const Def*erences a user.
Use(const Def *def, size_t index)
static constexpr size_t Type
const Def * operator->() const
bool operator==(Use other) const
This is a thin wrapper for absl::InlinedVector<T, N, A> which is a drop-in replacement for std::vecto...
The World represents the whole program and manages creation of MimIR nodes (Defs).
constexpr size_t hash_combine(size_t seed, T v) noexcept
GIDMap< const Def *, To > DefMap
absl::flat_hash_set< Use, UseHash, UseEq > Uses
consteval size_t hash_begin() noexcept
constexpr size_t hash(size_t h) noexcept
bool operator()(Use u1, Use u2) const
size_t operator()(Use use) const