MimIR
MimIR is my Intermediate Representation
Loading...
Searching...
No Matches
phase.h File Reference
#include <memory>
#include <fe/cast.h>
#include <fe/term.h>
#include "mim/def.h"
#include "mim/nest.h"
#include "mim/rewrite.h"
#include "mim/world.h"
Include dependency graph for phase.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  mim::Phase
 A Phase performs one self-contained task over the whole World. More...
class  mim::Analysis
 Traverses the current World using Rewriter infrastructure while staying in the same world. More...
class  mim::RWPhase
 Rebuilds old_world() into new_world() and then swaps them. More...
class  mim::Repl
 An RWPhase that searches for a pattern and replaces it. More...
class  mim::Cleanup
 Removes unreachable and dead code by rebuilding the whole World into a new one and swapping them afterwards. More...
class  mim::PhaseMan
 Organizes several Phases into a pipeline. More...
class  mim::ClosedMutPhase< M >
 Transitively visits all reachable, closed mutables in the World. More...
class  mim::NestPhase< M >
 Like ClosedMutPhase but computes a Nest for each NestPhase::visit. More...

Namespaces

namespace  mim

Macros

#define MIM_CONCAT_INNER(a, b)
#define MIM_CONCAT(a, b)
#define MIM_REPL(__phases, __annex, ...)
#define MIM_REPL_IMPL(__phases, __annex, __id, ...)
Rewrite
#define CODE_MUT(N)

Typedefs

using mim::Phases = std::deque<std::unique_ptr<Phase>>

Macro Definition Documentation

◆ CODE_MUT

#define CODE_MUT ( N)
Value:
const Def* rewrite_mut_##N(N* mut) override { return mut; }

Definition at line 288 of file phase.h.

Referenced by mim::Rewriter::rewrite_mut(), mim::Analysis::rewrite_mut_Arr(), and mim::Rewriter::rewrite_mut_Arr().

◆ MIM_CONCAT

#define MIM_CONCAT ( a,
b )
Value:
#define MIM_CONCAT_INNER(a, b)
Definition phase.h:454

Definition at line 455 of file phase.h.

◆ MIM_CONCAT_INNER

#define MIM_CONCAT_INNER ( a,
b )
Value:
a##b

Definition at line 454 of file phase.h.

◆ MIM_REPL

#define MIM_REPL ( __phases,
__annex,
... )
Value:
MIM_REPL_IMPL(__phases, __annex, __LINE__, __VA_ARGS__)
#define MIM_REPL_IMPL(__phases, __annex, __id,...)
Definition phase.h:460

Definition at line 457 of file phase.h.

Referenced by reg_phases(), reg_phases(), reg_phases(), and reg_phases().

◆ MIM_REPL_IMPL

#define MIM_REPL_IMPL ( __phases,
__annex,
__id,
... )
Value:
struct MIM_CONCAT(Repl_, __id) : ::mim::Repl { \
using Repl::Repl; \
\
const ::mim::Def* replace(const ::mim::Def* def) final __VA_ARGS__ \
}; \
::mim::Phase::hook<__annex, MIM_CONCAT(Repl_, __id)>(__phases)
An RWPhase that searches for a pattern and replaces it.
Definition phase.h:435
virtual const Def * replace(const Def *def)=0
#define MIM_CONCAT(a, b)
Definition phase.h:455

Definition at line 460 of file phase.h.