Thorin 1.9.0
The Higher ORder INtermediate representation
Loading...
Searching...
No Matches
autogen.h
Go to the documentation of this file.
1#pragma once
2
3#include <thorin/axiom.h>
4#include <thorin/plugin.h>
5
6/// @namespace thorin::plug::refly @ref refly
7namespace thorin {
8namespace plug::refly {
9
10static constexpr plugin_t Plugin_Id = 0x4c61cd6800000000;
11
12/// @name %%refly.Code
13///@{
14#ifdef DOXYGEN // see https://github.com/doxygen/doxygen/issues/9668
15enum Code : flags_t {
16#else
17enum class Code : flags_t {
18#endif
19};
20
21///@}
22
23/// @name %%refly.reify
24///@{
25#ifdef DOXYGEN // see https://github.com/doxygen/doxygen/issues/9668
26enum reify : flags_t {
27#else
28enum class reify : flags_t {
29#endif
30};
31
33///@}
34
35/// @name %%refly.reflect
36///@{
37#ifdef DOXYGEN // see https://github.com/doxygen/doxygen/issues/9668
39#else
40enum class reflect : flags_t {
41#endif
42};
43
45///@}
46
47/// @name %%refly.gid
48///@{
49#ifdef DOXYGEN // see https://github.com/doxygen/doxygen/issues/9668
50enum gid : flags_t {
51#else
52enum class gid : flags_t {
53#endif
54};
55
57///@}
58
59/// @name %%refly.error
60///@{
61#ifdef DOXYGEN // see https://github.com/doxygen/doxygen/issues/9668
62enum error : flags_t {
63#else
64enum class error : flags_t {
65#endif
66};
67
68///@}
69
70/// @name %%refly.warn
71///@{
72#ifdef DOXYGEN // see https://github.com/doxygen/doxygen/issues/9668
73enum warn : flags_t {
74#else
75enum class warn : flags_t {
76#endif
77};
78
79///@}
80
81/// @name %%refly.info
82///@{
83#ifdef DOXYGEN // see https://github.com/doxygen/doxygen/issues/9668
84enum info : flags_t {
85#else
86enum class info : flags_t {
87#endif
88};
89
90///@}
91
92/// @name %%refly.verbose
93///@{
94#ifdef DOXYGEN // see https://github.com/doxygen/doxygen/issues/9668
96#else
97enum class verbose : flags_t {
98#endif
99};
100
101///@}
102
103/// @name %%refly.debug
104///@{
105#ifdef DOXYGEN // see https://github.com/doxygen/doxygen/issues/9668
107#else
108enum class debug : flags_t {
109#endif
110};
111
112///@}
113
114/// @name %%refly.dbg
115///@{
116#ifdef DOXYGEN // see https://github.com/doxygen/doxygen/issues/9668
117enum dbg : flags_t {
118#else
119enum class dbg : flags_t {
120#endif
121 tmp = 0x4c61cd6800000900,
122 perm = 0x4c61cd6800000901,
123};
124
126template<dbg>
128
129///@}
130
131/// @name %%refly.refine
132///@{
133#ifdef DOXYGEN // see https://github.com/doxygen/doxygen/issues/9668
135#else
136enum class refine : flags_t {
137#endif
138};
139
141///@}
142
143/// @name %%refly.remove_dbg_perm_pass
144///@{
145#ifdef DOXYGEN // see https://github.com/doxygen/doxygen/issues/9668
147#else
148enum class remove_dbg_perm_pass : flags_t {
149#endif
150};
151
152///@}
153
155
156#define THORIN_refly_NORMALIZER_IMPL \
157 void register_normalizers(Normalizers& normalizers) {\
158 normalizers[flags_t(Annex::Base<reify>)] = &normalize_reify; \
159 normalizers[flags_t(Annex::Base<reflect>)] = &normalize_reflect; \
160 normalizers[flags_t(Annex::Base<gid>)] = &normalize_gid; \
161 normalizers[flags_t(dbg::tmp)] = &normalize_dbg<dbg::tmp>; \
162 normalizers[flags_t(dbg::perm)] = &normalize_dbg<dbg::perm>; \
163 normalizers[flags_t(Annex::Base<refine>)] = &normalize_refine; \
164 }
165} // namespace plug::refly
166
167#ifndef DOXYGEN // don't include in Doxygen documentation
168template<> constexpr flags_t Annex::Base<plug::refly::Code> = 0x4c61cd6800000000;
169template<> constexpr size_t Annex::Num<plug::refly::Code> = 0;
170template<> constexpr flags_t Annex::Base<plug::refly::reify> = 0x4c61cd6800000100;
171template<> constexpr size_t Annex::Num<plug::refly::reify> = 0;
172template<> constexpr flags_t Annex::Base<plug::refly::reflect> = 0x4c61cd6800000200;
173template<> constexpr size_t Annex::Num<plug::refly::reflect> = 0;
174template<> constexpr flags_t Annex::Base<plug::refly::gid> = 0x4c61cd6800000300;
175template<> constexpr size_t Annex::Num<plug::refly::gid> = 0;
176template<> constexpr flags_t Annex::Base<plug::refly::error> = 0x4c61cd6800000400;
177template<> constexpr size_t Annex::Num<plug::refly::error> = 0;
178template<> constexpr flags_t Annex::Base<plug::refly::warn> = 0x4c61cd6800000500;
179template<> constexpr size_t Annex::Num<plug::refly::warn> = 0;
180template<> constexpr flags_t Annex::Base<plug::refly::info> = 0x4c61cd6800000600;
181template<> constexpr size_t Annex::Num<plug::refly::info> = 0;
182template<> constexpr flags_t Annex::Base<plug::refly::verbose> = 0x4c61cd6800000700;
183template<> constexpr size_t Annex::Num<plug::refly::verbose> = 0;
184template<> constexpr flags_t Annex::Base<plug::refly::debug> = 0x4c61cd6800000800;
185template<> constexpr size_t Annex::Num<plug::refly::debug> = 0;
186template<> constexpr flags_t Annex::Base<plug::refly::dbg> = 0x4c61cd6800000900;
187template<> constexpr size_t Annex::Num<plug::refly::dbg> = 2;
188template<> constexpr flags_t Annex::Base<plug::refly::refine> = 0x4c61cd6800000a00;
189template<> constexpr size_t Annex::Num<plug::refly::refine> = 0;
190template<> constexpr flags_t Annex::Base<plug::refly::remove_dbg_perm_pass> = 0x4c61cd6800000b00;
191template<> constexpr size_t Annex::Num<plug::refly::remove_dbg_perm_pass> = 0;
192
193template<> struct Axiom::Match<plug::refly::error> { using type = Axiom; };
194template<> struct Axiom::Match<plug::refly::warn> { using type = Axiom; };
195template<> struct Axiom::Match<plug::refly::info> { using type = Axiom; };
196template<> struct Axiom::Match<plug::refly::verbose> { using type = Axiom; };
197template<> struct Axiom::Match<plug::refly::debug> { using type = Axiom; };
198template<> struct Axiom::Match<plug::refly::remove_dbg_perm_pass> { using type = Axiom; };
199#endif
200} // namespace thorin
Helper class to retrieve Infer::arg if present.
Definition def.h:87
@ Axiom
Definition def.h:41
Ref normalize_gid(Ref, Ref, Ref arg)
Ref normalize_refine(Ref type, Ref callee, Ref arg)
void register_normalizers(Normalizers &normalizers)
static constexpr plugin_t Plugin_Id
Definition autogen.h:10
Ref normalize_dbg(Ref type, Ref callee, Ref arg)
Ref normalize_reify(Ref, Ref, Ref arg)
Ref normalize_reflect(Ref, Ref, Ref arg)
Definition cfg.h:11
absl::flat_hash_map< flags_t, NormalizeFn > Normalizers
Definition plugin.h:19
u64 plugin_t
Definition types.h:47
u64 flags_t
Definition types.h:46
static constexpr flags_t Base
Definition plugin.h:131
#define THORIN_ENUM_OPERATORS(E)
Use this to declare all kind of bit and comparison operators for an enum E.
Definition util.h:189