MimIR
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
7Bound::~Bound() = default;
8Ext::~Ext() = default;
9
10size_t Bound::find(const Def* type) const {
11 auto i = isa_mut() ? std::find(ops().begin(), ops().end(), type)
12 : binary_find(ops().begin(), ops().end(), type, GIDLt<const Def*>());
13 return i == ops().end() ? size_t(-1) : i - ops().begin();
14}
15
16} // namespace mim
~Bound() override
size_t find(const Def *type) const
Definition lattice.cpp:10
constexpr auto ops() const noexcept
Definition def.h:317
T * isa_mut() const
If this is mutable, it will cast constness away and perform a dynamic_cast to T.
Definition def.h:527
const Def * type() const noexcept
Yields the "raw" type of this Def (maybe nullptr).
Definition def.cpp:491
~Ext() override
Definition ast.h:14
constexpr I binary_find(I begin, I end, T val, L lt) noexcept
Definition util.h:56