MimIR 0.1
MimIR is my Intermediate Representation
Loading...
Searching...
No Matches
lattice.cpp
Go to the documentation of this file.
1#include "mim/lattice.h"
2
3#include "mim/util/util.h"
4
5namespace mim {
6
7size_t Bound::find(const Def* type) const {
8 auto i = isa_mut() ? std::find(ops().begin(), ops().end(), type)
9 : binary_find(ops().begin(), ops().end(), type, GIDLt<const Def*>());
10 return i == ops().end() ? size_t(-1) : i - ops().begin();
11}
12
13} // namespace mim
size_t find(const Def *type) const
Definition lattice.cpp:7
Base class for all Defs.
Definition def.h:212
constexpr auto ops() const noexcept
Definition def.h:261
T * isa_mut() const
If this is *mut*able, it will cast constness away and perform a dynamic_cast to T.
Definition def.h:432
Ref type() const noexcept
Yields the raw type of this Def, i.e. maybe nullptr.
Definition def.h:241
Definition ast.h:14
I binary_find(I begin, I end, T val, L lt)
Definition util.h:55