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
6
#include "
mim/plug/clos/clos.h
"
7
8
namespace
mim::plug::clos
{
9
10
class
LowerTypedClosPrep
:
public
FPPass
<LowerTypedClosPrep, Lam> {
11
public
:
12
LowerTypedClosPrep
(
PassMan
&
man
)
13
:
FPPass
<
LowerTypedClosPrep
,
Lam
>(
man
,
"lower_typed_clos_prep"
) {}
14
15
private
:
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
mim::Def
Base class for all Defs.
Definition
def.h:198
mim::FPPass< LowerTypedClosPrep, Lam >::FPPass
FPPass(PassMan &man, std::string_view name)
Definition
pass.h:247
mim::Lam
A function.
Definition
lam.h:105
mim::Pass::man
PassMan & man()
Definition
pass.h:30
mim::Pass::PassMan
friend class PassMan
Definition
pass.h:101
mim::plug::clos::LowerTypedClosPrep::LowerTypedClosPrep
LowerTypedClosPrep(PassMan &man)
Definition
lower_typed_clos_prep.h:12
mim::plug::clos::LowerTypedClosPrep::rewrite
const Def * rewrite(const Def *) override
Definition
lower_typed_clos_prep.cpp:66
mim::plug::clos::LowerTypedClosPrep::analyze
undo_t analyze(const Def *) override
Definition
lower_typed_clos_prep.cpp:77
clos.h
eta_exp.h
mim::plug::clos
The clos Plugin
Definition
clos.h:7
mim::plug::clos::ca_isa_var
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
mim::DefSet
GIDSet< const Def * > DefSet
Definition
def.h:47
mim::undo_t
size_t undo_t
Definition
pass.h:14
pass.h
include
mim
plug
clos
pass
lower_typed_clos_prep.h
Generated by
1.13.2