MimIR
0.6-dev
MimIR is my Intermediate Representation
Toggle main menu visibility
Loading...
Searching...
No Matches
mach.cpp
Go to the documentation of this file.
1
#include "
mim/plug/mach/mach.h
"
2
3
#include <
mim/phase.h
>
4
#include <
mim/plugin.h
>
5
6
#include "
mim/plug/mach/close.h
"
7
#include "
mim/plug/mach/emit.h
"
8
#include "
mim/plug/mach/gen.h
"
9
#include "
mim/plug/mach/isel.h
"
10
#include "
mim/plug/mach/legalize.h
"
11
#include "
mim/plug/mach/libcall.h
"
12
#include "
mim/plug/mach/regalloc.h
"
13
#include "
mim/plug/mach/schedule.h
"
14
15
using namespace
mim
;
16
using namespace
plug::mach
;
17
18
static
void
reg_phases
(
Flags2Phases
& phases) {
19
Phase::hook<legalize, Legalize>
(phases);
20
Phase::hook<libcall, LibCall>
(phases);
21
hook<schedule, Schedule>
(phases);
22
hook<plug::mach::close, Close>
(phases);
23
hook<spilling, Spilling>
(phases);
24
hook<constrain, Constrain>
(phases);
25
hook<regalloc, RegAlloc>
(phases);
26
hook<live, Live>
(phases);
27
}
28
29
// MIM_PLUGIN_SYM stringifies its argument, so the name must stay unqualified.
30
static
const
PluginSym
known_syms
[] = {
31
MIM_PLUGIN_SYM
(
mim_mach_gen
),
32
MIM_PLUGIN_SYM
(
mim_mach_emit
),
33
MIM_PLUGIN_SYM
(
mim_mach_isel
),
34
};
35
36
MIM_PLUGIN_ENTRY
(mach) {
37
plugin.register_normalizers =
register_normalizers
;
38
plugin.register_phases =
reg_phases
;
39
plugin.syms =
known_syms
;
40
plugin.num_syms = std::size(
known_syms
);
41
}
mim::Phase::hook
static void hook(Flags2Phases &phases)
Definition
phase.h:53
close.h
isel.h
legalize.h
libcall.h
emit.h
gen.h
known_syms
static const PluginSym known_syms[]
Definition
mach.cpp:30
reg_phases
static void reg_phases(Flags2Phases &phases)
Definition
mach.cpp:18
mach.h
mim::plug::mach
The mach Plugin
Definition
asm.h:15
mim::plug::mach::mim_mach_gen
void mim_mach_gen(Gen &)
Gen::start, compiled once into libmim_mach; Gen reaches it via GET_FUN_PTR.
Definition
gen.cpp:1006
mim::plug::mach::mim_mach_emit
void mim_mach_emit(Emitter &, bool global)
Emitter::emit, compiled once into libmim_mach; Emitter reaches it via GET_FUN_PTR.
Definition
emit.cpp:371
mim::plug::mach::register_normalizers
void register_normalizers(Normalizers &normalizers)
mim::plug::mach::mim_mach_isel
Phase * mim_mach_isel(World &, flags_t annex, const rules::Table &table)
A new ISel for the annex annex of a backend, with the rules table; compiled once into libmim_mach.
Definition
isel.cpp:421
mim::plug::mach::hook
void hook(Flags2Phases &phases)
Registers the Phase P for the annex A, constructed with the Target of the one loaded backend.
Definition
phase.h:17
mim
Definition
ast.h:16
mim::Flags2Phases
ankerl::unordered_dense::map< flags_t, std::function< std::unique_ptr< Phase >(World &)> > Flags2Phases
Maps an axiom of a Phase to a function that creates one.
Definition
plugin.h:31
mim::PluginSym
One symbol a Plugin offers to other Plugins; see Driver::get_fun_ptr.
Definition
plugin.h:49
phase.h
schedule.h
plugin.h
MIM_PLUGIN_SYM
#define MIM_PLUGIN_SYM(f)
Builds a PluginSym for f, so name and address cannot drift apart.
Definition
plugin.h:55
MIM_PLUGIN_ENTRY
#define MIM_PLUGIN_ENTRY(p)
Defines a Plugin's entry point; the body fills in the plugin handed to it, as in MIM_PLUGIN_ENTRY(dem...
Definition
plugin.h:198
regalloc.h
src
mim
plug
mach
mach.cpp
Generated by
1.18.0