MimIR 0.1
MimIR is my Intermediate Representation
Loading...
Searching...
No Matches
lower_typed_clos_prep.h
Go to the documentation of this file.
1#pragma once
2
3#include <mim/pass.h>
4
5#include <mim/pass/eta_exp.h>
6
8
9namespace mim::plug::clos {
10
11class LowerTypedClosPrep : public FPPass<LowerTypedClosPrep, Lam> {
12public:
15
16private:
17 const Def* rewrite(const Def*) override;
18 undo_t analyze(const Def*) override;
19
20 bool is_esc(const Def* def) {
21 if (auto [_, lam] = ca_isa_var<Lam>(def); lam && !lam->is_set()) return true;
22 return esc_.contains(def);
23 }
24 undo_t set_esc(const Def*);
25
26 DefSet esc_;
27};
28
29} // namespace mim::plug::clos
Base class for all Defs.
Definition def.h:251
FPPass(World &world, std::string name)
Definition pass.h:323
World & world()
Definition pass.h:64
flags_t annex() const
Definition pass.h:68
The World represents the whole program and manages creation of MimIR nodes (Defs).
Definition world.h:36
LowerTypedClosPrep(World &world, flags_t annex)
const Def * rewrite(const Def *) override
The clos Plugin
Definition clos.h:7
std::tuple< const Extract *, N * > ca_isa_var(const Def *def)
Checks is def is the variable of a mut of type N.
Definition clos.h:79
u64 flags_t
Definition types.h:45
GIDSet< const Def * > DefSet
Definition def.h:74
size_t undo_t
Definition pass.h:21