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