MimIR
MimIR is my Intermediate Representation
Loading...
Searching...
No Matches
autogen.h
Go to the documentation of this file.
1#pragma once
2
3#include <mim/axm.h>
4#include <mim/plugin.h>
5
6/// @namespace mim::plug::refly @ref refly
7namespace mim {
8namespace plug::refly {
9
10static constexpr plugin_t Plugin_Id = 0x4c61cd6800000000;
11
12/// @name `refly.Code`
13///@{
14enum class Code : flags_t {
15};
16
17///@}
18
19/// @name `refly.reify`
20///@{
21enum class reify : flags_t {
22};
23
24const Def* normalize_reify(const Def*, const Def*, const Def*);
25///@}
26
27/// @name `refly.reflect`
28///@{
29enum class reflect : flags_t {
30};
31
32const Def* normalize_reflect(const Def*, const Def*, const Def*);
33///@}
34
35/// @name `refly.type`
36///@{
37enum class type : flags_t {
38};
39
40const Def* normalize_type(const Def*, const Def*, const Def*);
41///@}
42
43/// @name `refly.gid`
44///@{
45enum class gid : flags_t {
46};
47
48const Def* normalize_gid(const Def*, const Def*, const Def*);
49///@}
50
51/// @name `refly.error`
52///@{
53enum class error : flags_t {
54};
55
56///@}
57
58/// @name `refly.warn`
59///@{
60enum class warn : flags_t {
61};
62
63///@}
64
65/// @name `refly.info`
66///@{
67enum class info : flags_t {
68};
69
70///@}
71
72/// @name `refly.verbose`
73///@{
74enum class verbose : flags_t {
75};
76
77///@}
78
79/// @name `refly.debug`
80///@{
81enum class debug : flags_t {
82};
83
84///@}
85
86/// @name `refly.dbg`
87///@{
88enum class dbg : flags_t {
89 tmp = 0x4c61cd6800000a00,
90 perm = 0x4c61cd6800000a01,
91};
92
93template<dbg>
94const Def* normalize_dbg(const Def*, const Def*, const Def*);
95
96///@}
97
98/// @name `refly.struc`
99///@{
100enum class struc : flags_t {
101 ne = 0x4c61cd6800000b00,
102 e = 0x4c61cd6800000b01,
103};
104
105template<struc>
106const Def* normalize_struc(const Def*, const Def*, const Def*);
107
108///@}
109
110/// @name `refly.alpha`
111///@{
112enum class alpha : flags_t {
113 ne = 0x4c61cd6800000c00,
114 e = 0x4c61cd6800000c01,
115};
116
117template<alpha>
118const Def* normalize_alpha(const Def*, const Def*, const Def*);
119
120///@}
121
122/// @name `refly.check_bot`
123///@{
124enum class check_bot : flags_t {
125};
126
127const Def* normalize_check_bot(const Def*, const Def*, const Def*);
128///@}
129
130/// @name `refly.check`
131///@{
132enum class check : flags_t {
133};
134
135const Def* normalize_check(const Def*, const Def*, const Def*);
136///@}
137
138/// @name `refly.remove_dbg_repl`
139///@{
141};
142
143///@}
144
146
147#define MIM_refly_NORMALIZER_IMPL \
148 void register_normalizers(Normalizers& normalizers) {\
149 normalizers[flags_t(Annex::Base<reify>)] = &normalize_reify; \
150 normalizers[flags_t(Annex::Base<reflect>)] = &normalize_reflect; \
151 normalizers[flags_t(Annex::Base<type>)] = &normalize_type; \
152 normalizers[flags_t(Annex::Base<gid>)] = &normalize_gid; \
153 normalizers[flags_t(dbg::tmp)] = &normalize_dbg<dbg::tmp>; \
154 normalizers[flags_t(dbg::perm)] = &normalize_dbg<dbg::perm>; \
155 normalizers[flags_t(struc::ne)] = &normalize_struc<struc::ne>; \
156 normalizers[flags_t(struc::e)] = &normalize_struc<struc::e>; \
157 normalizers[flags_t(alpha::ne)] = &normalize_alpha<alpha::ne>; \
158 normalizers[flags_t(alpha::e)] = &normalize_alpha<alpha::e>; \
159 normalizers[flags_t(Annex::Base<check_bot>)] = &normalize_check_bot; \
160 normalizers[flags_t(Annex::Base<check>)] = &normalize_check; \
161 }
162} // namespace plug::refly
163
164#ifndef DOXYGEN // don't include in Doxygen documentation
165
166template<> constexpr flags_t Annex::Base<plug::refly::Code> = 0x4c61cd6800000000;
167template<> constexpr size_t Annex::Num<plug::refly::Code> = 0;
168template<> constexpr flags_t Annex::Base<plug::refly::reify> = 0x4c61cd6800000100;
169template<> constexpr size_t Annex::Num<plug::refly::reify> = 0;
170template<> constexpr flags_t Annex::Base<plug::refly::reflect> = 0x4c61cd6800000200;
171template<> constexpr size_t Annex::Num<plug::refly::reflect> = 0;
172template<> constexpr flags_t Annex::Base<plug::refly::type> = 0x4c61cd6800000300;
173template<> constexpr size_t Annex::Num<plug::refly::type> = 0;
174template<> constexpr flags_t Annex::Base<plug::refly::gid> = 0x4c61cd6800000400;
175template<> constexpr size_t Annex::Num<plug::refly::gid> = 0;
176template<> constexpr flags_t Annex::Base<plug::refly::error> = 0x4c61cd6800000500;
177template<> constexpr size_t Annex::Num<plug::refly::error> = 0;
178template<> constexpr flags_t Annex::Base<plug::refly::warn> = 0x4c61cd6800000600;
179template<> constexpr size_t Annex::Num<plug::refly::warn> = 0;
180template<> constexpr flags_t Annex::Base<plug::refly::info> = 0x4c61cd6800000700;
181template<> constexpr size_t Annex::Num<plug::refly::info> = 0;
182template<> constexpr flags_t Annex::Base<plug::refly::verbose> = 0x4c61cd6800000800;
183template<> constexpr size_t Annex::Num<plug::refly::verbose> = 0;
184template<> constexpr flags_t Annex::Base<plug::refly::debug> = 0x4c61cd6800000900;
185template<> constexpr size_t Annex::Num<plug::refly::debug> = 0;
186template<> constexpr flags_t Annex::Base<plug::refly::dbg> = 0x4c61cd6800000a00;
187template<> constexpr size_t Annex::Num<plug::refly::dbg> = 2;
188template<> constexpr flags_t Annex::Base<plug::refly::struc> = 0x4c61cd6800000b00;
189template<> constexpr size_t Annex::Num<plug::refly::struc> = 2;
190template<> constexpr flags_t Annex::Base<plug::refly::alpha> = 0x4c61cd6800000c00;
191template<> constexpr size_t Annex::Num<plug::refly::alpha> = 2;
192template<> constexpr flags_t Annex::Base<plug::refly::check_bot> = 0x4c61cd6800000d00;
193template<> constexpr size_t Annex::Num<plug::refly::check_bot> = 0;
194template<> constexpr flags_t Annex::Base<plug::refly::check> = 0x4c61cd6800000e00;
195template<> constexpr size_t Annex::Num<plug::refly::check> = 0;
196template<> constexpr flags_t Annex::Base<plug::refly::remove_dbg_repl> = 0x4c61cd6800000f00;
197template<> constexpr size_t Annex::Num<plug::refly::remove_dbg_repl> = 0;
198
199template<> struct Axm::IsANode<plug::refly::error> { using type = Axm; };
200template<> struct Axm::IsANode<plug::refly::warn> { using type = Axm; };
201template<> struct Axm::IsANode<plug::refly::info> { using type = Axm; };
202template<> struct Axm::IsANode<plug::refly::verbose> { using type = Axm; };
203template<> struct Axm::IsANode<plug::refly::debug> { using type = Axm; };
204template<> struct Axm::IsANode<plug::refly::remove_dbg_repl> { using type = Axm; };
205
206#endif
207} // namespace mim
208
209#ifndef DOXYGEN // don't include in Doxygen documentation
210
211template<> struct fe::is_bit_enum<mim::plug::refly::dbg> : std::true_type {};
212template<> struct fe::is_bit_enum<mim::plug::refly::struc> : std::true_type {};
213template<> struct fe::is_bit_enum<mim::plug::refly::alpha> : std::true_type {};
214
215#endif
Base class for all Defs.
Definition def.h:289
The refly Plugin
const Def * normalize_reify(const Def *, const Def *, const Def *arg)
const Def * normalize_dbg(const Def *, const Def *, const Def *arg)
const Def * normalize_check(const Def *type, const Def *, const Def *arg)
const Def * normalize_check_bot(const Def *, const Def *c, const Def *arg)
const Def * normalize_gid(const Def *, const Def *, const Def *arg)
static constexpr plugin_t Plugin_Id
Definition autogen.h:10
const Def * normalize_alpha(const Def *, const Def *, const Def *arg)
const Def * normalize_type(const Def *, const Def *, const Def *arg)
const Def * normalize_struc(const Def *, const Def *, const Def *arg)
const Def * normalize_reflect(const Def *, const Def *, const Def *arg)
void register_normalizers(Normalizers &normalizers)
Definition ast.h:16
u64 flags_t
Definition types.h:39
ankerl::unordered_dense::map< flags_t, NormalizeFn > Normalizers
Definition plugin.h:27
u64 plugin_t
Definition types.h:40
@ Axm
Definition def.h:125
static constexpr size_t Num
Number of Axm::subtags.
Definition plugin.h:273
static constexpr flags_t Base
Definition plugin.h:274