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 <fe/algo.h>
4
5#include "mim/util/gid.h"
6
7namespace mim {
8
9size_t Bound::find(const Def* type) const {
10 auto lt = GIDLt<const Def*>();
11 auto i = isa_mut() ? std::find(ops().begin(), ops().end(), type) : fe::binary_find(ops(), type, lt);
12 return i == ops().end() ? size_t(-1) : i - ops().begin();
13}
14
15} // namespace mim
size_t find(const Def *type) const
Definition lattice.cpp:9
constexpr auto ops() const noexcept
Definition def.h:348
T * isa_mut() const
If this is mutable, it will cast constness away and perform a dynamic_cast to T.
Definition def.h:580
const Def * type() const noexcept
Yields the "raw" type of this Def (maybe nullptr).
Definition def.h:1111
Definition ast.h:16