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::clos @ref clos
7namespace thorin {
8namespace plug::clos {
9
10static constexpr plugin_t Plugin_Id = 0x10d4140000000000;
11
12/// @name %%clos.BufPtr
13///@{
14#ifdef DOXYGEN // see https://github.com/doxygen/doxygen/issues/9668
16#else
17enum class BufPtr : flags_t {
18#endif
19};
20
21///@}
22
23/// @name %%clos.alloc_jmpbuf
24///@{
25#ifdef DOXYGEN // see https://github.com/doxygen/doxygen/issues/9668
27#else
28enum class alloc_jmpbuf : flags_t {
29#endif
30};
31
32///@}
33
34/// @name %%clos.setjmp
35///@{
36#ifdef DOXYGEN // see https://github.com/doxygen/doxygen/issues/9668
38#else
39enum class setjmp : flags_t {
40#endif
41};
42
43///@}
44
45/// @name %%clos.longjmp
46///@{
47#ifdef DOXYGEN // see https://github.com/doxygen/doxygen/issues/9668
49#else
50enum class longjmp : flags_t {
51#endif
52};
53
54///@}
55
56/// @name %%clos.attr
57///@{
58#ifdef DOXYGEN // see https://github.com/doxygen/doxygen/issues/9668
59enum attr : flags_t {
60#else
61enum class attr : flags_t {
62#endif
63 ret = 0x10d4140000000400,
64 freeBB = 0x10d4140000000401,
65 fstclassBB = 0x10d4140000000402,
66 esc = 0x10d4140000000403,
67 bot = 0x10d4140000000404,
68};
69
71template<attr>
73
74///@}
75
76/// @name %%clos.clos_conv_prep_pass
77///@{
78#ifdef DOXYGEN // see https://github.com/doxygen/doxygen/issues/9668
80#else
81enum class clos_conv_prep_pass : flags_t {
82#endif
83};
84
85///@}
86
87/// @name %%clos.branch_clos_pass
88///@{
89#ifdef DOXYGEN // see https://github.com/doxygen/doxygen/issues/9668
91#else
92enum class branch_clos_pass : flags_t {
93#endif
94};
95
96///@}
97
98/// @name %%clos.lower_typed_clos_prep_pass
99///@{
100#ifdef DOXYGEN // see https://github.com/doxygen/doxygen/issues/9668
102#else
104#endif
105};
106
107///@}
108
109/// @name %%clos.clos2sjlj_pass
110///@{
111#ifdef DOXYGEN // see https://github.com/doxygen/doxygen/issues/9668
113#else
114enum class clos2sjlj_pass : flags_t {
115#endif
116};
117
118///@}
119
120/// @name %%clos.eta_red_bool_pass
121///@{
122#ifdef DOXYGEN // see https://github.com/doxygen/doxygen/issues/9668
124#else
125enum class eta_red_bool_pass : flags_t {
126#endif
127};
128
129///@}
130
131/// @name %%clos.clos_conv_phase
132///@{
133#ifdef DOXYGEN // see https://github.com/doxygen/doxygen/issues/9668
135#else
136enum class clos_conv_phase : flags_t {
137#endif
138};
139
140///@}
141
142/// @name %%clos.lower_typed_clos_phase
143///@{
144#ifdef DOXYGEN // see https://github.com/doxygen/doxygen/issues/9668
146#else
147enum class lower_typed_clos_phase : flags_t {
148#endif
149};
150
151///@}
152
154
155#define THORIN_clos_NORMALIZER_IMPL \
156 void register_normalizers(Normalizers& normalizers) {\
157 normalizers[flags_t(attr::ret)] = &normalize_clos<attr::ret>; \
158 normalizers[flags_t(attr::freeBB)] = &normalize_clos<attr::freeBB>; \
159 normalizers[flags_t(attr::fstclassBB)] = &normalize_clos<attr::fstclassBB>; \
160 normalizers[flags_t(attr::esc)] = &normalize_clos<attr::esc>; \
161 normalizers[flags_t(attr::bot)] = &normalize_clos<attr::bot>; \
162 }
163} // namespace plug::clos
164
165#ifndef DOXYGEN // don't include in Doxygen documentation
166template<> constexpr flags_t Annex::Base<plug::clos::BufPtr> = 0x10d4140000000000;
167template<> constexpr size_t Annex::Num<plug::clos::BufPtr> = 0;
168template<> constexpr flags_t Annex::Base<plug::clos::alloc_jmpbuf> = 0x10d4140000000100;
169template<> constexpr size_t Annex::Num<plug::clos::alloc_jmpbuf> = 0;
170template<> constexpr flags_t Annex::Base<plug::clos::setjmp> = 0x10d4140000000200;
171template<> constexpr size_t Annex::Num<plug::clos::setjmp> = 0;
172template<> constexpr flags_t Annex::Base<plug::clos::longjmp> = 0x10d4140000000300;
173template<> constexpr size_t Annex::Num<plug::clos::longjmp> = 0;
174template<> constexpr flags_t Annex::Base<plug::clos::attr> = 0x10d4140000000400;
175template<> constexpr size_t Annex::Num<plug::clos::attr> = 5;
176template<> constexpr flags_t Annex::Base<plug::clos::clos_conv_prep_pass> = 0x10d4140000000500;
177template<> constexpr size_t Annex::Num<plug::clos::clos_conv_prep_pass> = 0;
178template<> constexpr flags_t Annex::Base<plug::clos::branch_clos_pass> = 0x10d4140000000600;
179template<> constexpr size_t Annex::Num<plug::clos::branch_clos_pass> = 0;
180template<> constexpr flags_t Annex::Base<plug::clos::lower_typed_clos_prep_pass> = 0x10d4140000000700;
181template<> constexpr size_t Annex::Num<plug::clos::lower_typed_clos_prep_pass> = 0;
182template<> constexpr flags_t Annex::Base<plug::clos::clos2sjlj_pass> = 0x10d4140000000800;
183template<> constexpr size_t Annex::Num<plug::clos::clos2sjlj_pass> = 0;
184template<> constexpr flags_t Annex::Base<plug::clos::eta_red_bool_pass> = 0x10d4140000000900;
185template<> constexpr size_t Annex::Num<plug::clos::eta_red_bool_pass> = 0;
186template<> constexpr flags_t Annex::Base<plug::clos::clos_conv_phase> = 0x10d4140000000a00;
187template<> constexpr size_t Annex::Num<plug::clos::clos_conv_phase> = 0;
188template<> constexpr flags_t Annex::Base<plug::clos::lower_typed_clos_phase> = 0x10d4140000000b00;
189template<> constexpr size_t Annex::Num<plug::clos::lower_typed_clos_phase> = 0;
190
191template<> struct Axiom::Match<plug::clos::BufPtr> { using type = Axiom; };
192template<> struct Axiom::Match<plug::clos::clos_conv_prep_pass> { using type = Axiom; };
193template<> struct Axiom::Match<plug::clos::branch_clos_pass> { using type = Axiom; };
194template<> struct Axiom::Match<plug::clos::lower_typed_clos_prep_pass> { using type = Axiom; };
195template<> struct Axiom::Match<plug::clos::clos2sjlj_pass> { using type = Axiom; };
196template<> struct Axiom::Match<plug::clos::clos_conv_phase> { using type = Axiom; };
197template<> struct Axiom::Match<plug::clos::lower_typed_clos_phase> { using type = Axiom; };
198#endif
199} // namespace thorin
Helper class to retrieve Infer::arg if present.
Definition def.h:85
@ Axiom
Definition def.h:39
void register_normalizers(Normalizers &normalizers)
Ref normalize_clos(Ref type, Ref callee, Ref arg)
static constexpr plugin_t Plugin_Id
Definition autogen.h:10
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:121
#define THORIN_ENUM_OPERATORS(E)
Use this to declare all kind of bit and comparison operators for an enum E.
Definition util.h:189