MimIR 0.1
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.equiv
99///@{
100enum class equiv : flags_t {
101 ae = 0x4c61cd6800000b00,
103 aE = 0x4c61cd6800000b01,
105 Ae = 0x4c61cd6800000b02,
107 AE = 0x4c61cd6800000b03,
109};
110
111template<equiv>
112const Def* normalize_equiv(const Def*, const Def*, const Def*);
113
114///@}
115
116/// @name %%refly.check
117///@{
118enum class check : flags_t {
119};
120
121const Def* normalize_check(const Def*, const Def*, const Def*);
122///@}
123
124/// @name %%refly.refine
125///@{
126enum class refine : flags_t {
127};
128
129const Def* normalize_refine(const Def*, const Def*, const Def*);
130///@}
131
132/// @name %%refly.remove_dbg_perm_pass
133///@{
135};
136
137///@}
138
140
141#define MIM_refly_NORMALIZER_IMPL \
142 void register_normalizers(Normalizers& normalizers) {\
143 normalizers[flags_t(Annex::Base<reify>)] = &normalize_reify; \
144 normalizers[flags_t(Annex::Base<reflect>)] = &normalize_reflect; \
145 normalizers[flags_t(Annex::Base<type>)] = &normalize_type; \
146 normalizers[flags_t(Annex::Base<gid>)] = &normalize_gid; \
147 normalizers[flags_t(dbg::tmp)] = &normalize_dbg<dbg::tmp>; \
148 normalizers[flags_t(dbg::perm)] = &normalize_dbg<dbg::perm>; \
149 normalizers[flags_t(equiv::ae)] = &normalize_equiv<equiv::ae>; \
150 normalizers[flags_t(equiv::aE)] = &normalize_equiv<equiv::aE>; \
151 normalizers[flags_t(equiv::Ae)] = &normalize_equiv<equiv::Ae>; \
152 normalizers[flags_t(equiv::AE)] = &normalize_equiv<equiv::AE>; \
153 normalizers[flags_t(Annex::Base<check>)] = &normalize_check; \
154 normalizers[flags_t(Annex::Base<refine>)] = &normalize_refine; \
155 }
156} // namespace plug::refly
157
158#ifndef DOXYGEN // don't include in Doxygen documentation
159
160template<> constexpr flags_t Annex::Base<plug::refly::Code> = 0x4c61cd6800000000;
161template<> constexpr size_t Annex::Num<plug::refly::Code> = 0;
162template<> constexpr flags_t Annex::Base<plug::refly::reify> = 0x4c61cd6800000100;
163template<> constexpr size_t Annex::Num<plug::refly::reify> = 0;
164template<> constexpr flags_t Annex::Base<plug::refly::reflect> = 0x4c61cd6800000200;
165template<> constexpr size_t Annex::Num<plug::refly::reflect> = 0;
166template<> constexpr flags_t Annex::Base<plug::refly::type> = 0x4c61cd6800000300;
167template<> constexpr size_t Annex::Num<plug::refly::type> = 0;
168template<> constexpr flags_t Annex::Base<plug::refly::gid> = 0x4c61cd6800000400;
169template<> constexpr size_t Annex::Num<plug::refly::gid> = 0;
170template<> constexpr flags_t Annex::Base<plug::refly::error> = 0x4c61cd6800000500;
171template<> constexpr size_t Annex::Num<plug::refly::error> = 0;
172template<> constexpr flags_t Annex::Base<plug::refly::warn> = 0x4c61cd6800000600;
173template<> constexpr size_t Annex::Num<plug::refly::warn> = 0;
174template<> constexpr flags_t Annex::Base<plug::refly::info> = 0x4c61cd6800000700;
175template<> constexpr size_t Annex::Num<plug::refly::info> = 0;
176template<> constexpr flags_t Annex::Base<plug::refly::verbose> = 0x4c61cd6800000800;
177template<> constexpr size_t Annex::Num<plug::refly::verbose> = 0;
178template<> constexpr flags_t Annex::Base<plug::refly::debug> = 0x4c61cd6800000900;
179template<> constexpr size_t Annex::Num<plug::refly::debug> = 0;
180template<> constexpr flags_t Annex::Base<plug::refly::dbg> = 0x4c61cd6800000a00;
181template<> constexpr size_t Annex::Num<plug::refly::dbg> = 2;
182template<> constexpr flags_t Annex::Base<plug::refly::equiv> = 0x4c61cd6800000b00;
183template<> constexpr size_t Annex::Num<plug::refly::equiv> = 4;
184template<> constexpr flags_t Annex::Base<plug::refly::check> = 0x4c61cd6800000c00;
185template<> constexpr size_t Annex::Num<plug::refly::check> = 0;
186template<> constexpr flags_t Annex::Base<plug::refly::refine> = 0x4c61cd6800000d00;
187template<> constexpr size_t Annex::Num<plug::refly::refine> = 0;
188template<> constexpr flags_t Annex::Base<plug::refly::remove_dbg_perm_pass> = 0x4c61cd6800000e00;
189template<> constexpr size_t Annex::Num<plug::refly::remove_dbg_perm_pass> = 0;
190
191template<> struct Axm::IsANode<plug::refly::error> { using type = Axm; };
192template<> struct Axm::IsANode<plug::refly::warn> { using type = Axm; };
193template<> struct Axm::IsANode<plug::refly::info> { using type = Axm; };
194template<> struct Axm::IsANode<plug::refly::verbose> { using type = Axm; };
195template<> struct Axm::IsANode<plug::refly::debug> { using type = Axm; };
196template<> struct Axm::IsANode<plug::refly::remove_dbg_perm_pass> { using type = Axm; };
197
198#endif
199} // namespace mim
200
201#ifndef DOXYGEN // don't include in Doxygen documentation
202
203template<> struct fe::is_bit_enum<mim::plug::refly::dbg> : std::true_type {};
204template<> struct fe::is_bit_enum<mim::plug::refly::equiv> : std::true_type {};
205
206#endif
Base class for all Defs.
Definition def.h:198
The refly Plugin
Definition remove_perm.h:7
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_refine(const Def *, const Def *, const Def *arg)
const Def * normalize_equiv(const Def *, const Def *, 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_type(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:14
u64 flags_t
Definition types.h:45
absl::flat_hash_map< flags_t, NormalizeFn > Normalizers
Definition plugin.h:19
u64 plugin_t
Definition types.h:46
@ Axm
Definition def.h:85
static constexpr size_t Num
Definition plugin.h:115
static constexpr flags_t Base
Definition plugin.h:118