MimIR 0.1
MimIR is my Intermediate Representation
Loading...
Searching...
No Matches
phase.h File Reference
#include <memory>
#include <fe/assert.h>
#include <fe/cast.h>
#include "mim/def.h"
#include "mim/nest.h"
#include "mim/pass.h"
#include "mim/rewrite.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
 As opposed to a Pass, a Phase does one thing at a time and does not mix with other Phases. More...
 
class  mim::RWPhase
 Rewrites the RWPhase::old_world into the RWPhase::new_world and swaps them afterwards. More...
 
class  mim::Repl
 Simple Stage that searches for a pattern and replaces it. More...
 
class  mim::ReplMan
 
class  mim::ReplManPhase
 
class  mim::Cleanup
 Removes unreachable and dead code by rebuilding the whole World into a new one and swapping them afterwards. More...
 
class  mim::PassManPhase
 Wraps a PassMan pipeline as a Phase. More...
 
class  mim::PhaseMan
 Organizes several Phases in a 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(__stages, __annex, ...)
 
#define MIM_REPL_IMPL(__stages, __annex, __id, ...)
 

Typedefs

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

Macro Definition Documentation

◆ MIM_CONCAT

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

Definition at line 139 of file phase.h.

◆ MIM_CONCAT_INNER

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

Definition at line 138 of file phase.h.

◆ MIM_REPL

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

Definition at line 141 of file phase.h.

Referenced by reg_stages().

◆ MIM_REPL_IMPL

#define MIM_REPL_IMPL ( __stages,
__annex,
__id,
... )
Value:
struct MIM_CONCAT(Repl_, __id) : ::mim::Repl { \
MIM_CONCAT(Repl_, __id)(::mim::World & world, ::mim::flags_t annex) \
: Repl(world, annex) {} \
\
const ::mim::Def* replace(const ::mim::Def* def) final __VA_ARGS__ \
}; \
::mim::Stage::hook<__annex, MIM_CONCAT(Repl_, __id)>(__stages)
Simple Stage that searches for a pattern and replaces it.
Definition phase.h:112
virtual const Def * replace(const Def *def)=0
Repl(World &world, flags_t annex)
Definition phase.h:114
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
u64 flags_t
Definition types.h:45
#define MIM_CONCAT(a, b)
Definition phase.h:139

Definition at line 144 of file phase.h.