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/eta_exp.h>
4#include <mim/pass/pass.h>
5
7
8namespace mim::plug::clos {
9
10class LowerTypedClosPrep : public FPPass<LowerTypedClosPrep, Lam> {
11public:
13 : FPPass<LowerTypedClosPrep, Lam>(man, "lower_typed_clos_prep") {}
14
15private:
16 const Def* rewrite(const Def*) override;
17 undo_t analyze(const Def*) override;
18
19 bool is_esc(const Def* def) {
20 if (auto [_, lam] = ca_isa_var<Lam>(def); lam && !lam->is_set()) return true;
21 return esc_.contains(def);
22 }
23 undo_t set_esc(const Def*);
24
25 DefSet esc_;
26};
27
28} // namespace mim::plug::clos
Base class for all Defs.
Definition def.h:198
FPPass(PassMan &man, std::string_view name)
Definition pass.h:247
A function.
Definition lam.h:105
PassMan & man()
Definition pass.h:30
friend class PassMan
Definition pass.h:101
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
GIDSet< const Def * > DefSet
Definition def.h:47
size_t undo_t
Definition pass.h:14