MimIR 0.1
MimIR is my Intermediate Representation
Loading...
Searching...
No Matches
compile.cpp
Go to the documentation of this file.
2
3#include <memory>
4
5#include <mim/config.h>
6#include <mim/driver.h>
7#include <mim/pass.h>
8#include <mim/phase.h>
9
10#include <mim/pass/beta_red.h>
11#include <mim/pass/eta_exp.h>
12#include <mim/pass/eta_red.h>
13#include <mim/pass/lam_spec.h>
14#include <mim/pass/scalarize.h>
21#include <mim/phase/ret_wrap.h>
22
24
25using namespace mim;
26using namespace mim::plug;
27
28void reg_stages(Flags2Stages& stages) {
29 // clang-format off
30 assert_emplace(stages, Annex::base<compile::null_phase>(), [](World&) { return std::unique_ptr<Phase>{}; });
31 assert_emplace(stages, Annex::base<compile::null_repl >(), [](World&) { return std::unique_ptr<Repl >{}; });
32 assert_emplace(stages, Annex::base<compile::null_pass >(), [](World&) { return std::unique_ptr<Pass >{}; });
33 // phases
43 // repls
45 // passes
54 // clang-format on
55}
56
58 return {"compile", compile::register_normalizers, reg_stages, nullptr};
59}
void reg_stages(Flags2Stages &stages)
Definition affine.cpp:11
static void hook(Flags2Stages &stages)
Definition pass.h:57
The World represents the whole program and manages creation of MimIR nodes (Defs).
Definition world.h:36
void reg_stages(Flags2Stages &stages)
Definition compile.cpp:28
#define MIM_EXPORT
Definition config.h:16
void register_normalizers(Normalizers &normalizers)
Definition ast.h:14
auto assert_emplace(C &container, Args &&... args)
Invokes emplace on container, asserts that insertion actually happened, and returns the iterator.
Definition util.h:118
absl::flat_hash_map< flags_t, std::function< std::unique_ptr< Stage >(World &)> > Flags2Stages
Maps an an axiom of a Stage to a function that creates one.
Definition plugin.h:22
mim::Plugin mim_get_plugin()
static consteval flags_t base()
Definition plugin.h:119
Basic info and registration function pointer to be returned from a specific plugin.
Definition plugin.h:30