MimIR
MimIR is my Intermediate Representation
Loading...
Searching...
No Matches
branch_normalize.h
Go to the documentation of this file.
1#pragma once
2
3#include "mim/phase.h"
4
5namespace mim {
6
7/// Normalizes branches: η-expands non-Lam branch targets so that both sides of a `(f, t)#cond`
8/// branch are Lam%s, as later phases and the backends expect.
9class BranchNormalize : public RWPhase {
10public:
13
14private:
15 const Def* normalize(const Def*);
16 const Def* rewrite_mut_Lam(Lam*) final;
17
18 DefSet analyzed_;
19 LamMap<bool> candidate_;
20};
21
22} // namespace mim
BranchNormalize(World &world, flags_t annex)
const Def * rewrite_mut_Lam(Lam *) final
Base class for all Defs.
Definition def.h:261
A function.
Definition lam.h:110
flags_t annex() const
Definition phase.h:81
RWPhase(World &world, std::string name, Analysis *analysis=nullptr)
Definition phase.h:316
World & world()=delete
Hides both and forbids direct access.
The World represents the whole program and manages creation of MimIR nodes (Defs).
Definition world.h:36
Definition ast.h:14
u64 flags_t
Definition types.h:39
GIDMap< Lam *, To > LamMap
Definition lam.h:219
GIDSet< const Def * > DefSet
Definition def.h:76