Thorin 1.9.0
The Higher ORder INtermediate representation
Loading...
Searching...
No Matches
lattice.cpp
Go to the documentation of this file.
1#include "thorin/lattice.h"
2
3#include "thorin/lam.h"
4#include "thorin/world.h"
5
6#include "thorin/util/util.h"
7
8namespace thorin {
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 thorin
size_t find(const Def *type) const
Definition lattice.cpp:10
Base class for all Defs.
Definition def.h:222
auto ops() const
Definition def.h:268
const Def * type() const
Yields the raw type of this Def, i.e. maybe nullptr.
Definition def.h:248
T * isa_mut() const
If this is *mut*able, it will cast constness away and perform a dynamic_cast to T.
Definition def.h:449
Definition cfg.h:11
I binary_find(I begin, I end, T val, Cmp cmp)
Definition util.h:58