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::ord @ref ord
7
namespace
mim
{
8
namespace
plug::ord
{
9
10
static
constexpr
plugin_t
Plugin_Id
= 0x4131400000000000;
11
12
/// @name `ord.Key`
13
///@{
14
enum class
Key
:
flags_t
{
15
};
16
17
/// The fields of `ord.Key`, by index.
18
struct
Key_field
{ enum :
nat_t
{
T
= 0,
lt
= 1, }; };
19
20
///@}
21
22
/// @name `ord.Set`
23
///@{
24
enum class
Set
:
flags_t
{
25
};
26
27
///@}
28
29
/// @name `ord.Map`
30
///@{
31
enum class
Map
:
flags_t
{
32
};
33
34
///@}
35
36
/// @name `ord.init`
37
///@{
38
enum class
init
:
flags_t
{
39
set
= 0x4131400000000300,
40
map = 0x4131400000000301,
41
};
42
43
template
<init>
44
const
Def
*
normalize_init
(
const
Def
*,
const
Def
*,
const
Def
*);
45
46
///@}
47
48
/// @name `ord.create_set`
49
///@{
50
enum class
create_set
:
flags_t
{
51
};
52
53
///@}
54
55
/// @name `ord.create_map`
56
///@{
57
enum class
create_map
:
flags_t
{
58
};
59
60
///@}
61
62
/// @name `ord.size`
63
///@{
64
enum class
size
:
flags_t
{
65
set
= 0x4131400000000600,
66
map = 0x4131400000000601,
67
};
68
69
template
<size>
70
const
Def
*
normalize_size
(
const
Def
*,
const
Def
*,
const
Def
*);
71
72
///@}
73
74
/// @name `ord.is_empty_set`
75
///@{
76
enum class
is_empty_set
:
flags_t
{
77
};
78
79
///@}
80
81
/// @name `ord.is_empty_map`
82
///@{
83
enum class
is_empty_map
:
flags_t
{
84
};
85
86
///@}
87
88
/// @name `ord.get`
89
///@{
90
enum class
get
:
flags_t
{
91
};
92
93
const
Def
*
normalize_get
(
const
Def
*,
const
Def
*,
const
Def
*);
94
///@}
95
96
/// @name `ord.contains`
97
///@{
98
enum class
contains
:
flags_t
{
99
set
= 0x4131400000000a00,
100
map = 0x4131400000000a01,
101
};
102
103
template
<contains>
104
const
Def
*
normalize_contains
(
const
Def
*,
const
Def
*,
const
Def
*);
105
106
///@}
107
108
/// @name `ord.insert`
109
///@{
110
enum class
insert
:
flags_t
{
111
set
= 0x4131400000000b00,
112
map = 0x4131400000000b01,
113
};
114
115
template
<insert>
116
const
Def
*
normalize_insert
(
const
Def
*,
const
Def
*,
const
Def
*);
117
118
///@}
119
120
void
register_normalizers
(
Normalizers
& normalizers);
121
122
#define MIM_ord_NORMALIZER_IMPL \
123
void register_normalizers(Normalizers& normalizers) {\
124
normalizers[flags_t(init::set)] = &normalize_init<init::set>; \
125
normalizers[flags_t(init::map)] = &normalize_init<init::map>; \
126
normalizers[flags_t(size::set)] = &normalize_size<size::set>; \
127
normalizers[flags_t(size::map)] = &normalize_size<size::map>; \
128
normalizers[flags_t(Annex::Base<get>)] = &normalize_get; \
129
normalizers[flags_t(contains::set)] = &normalize_contains<contains::set>; \
130
normalizers[flags_t(contains::map)] = &normalize_contains<contains::map>; \
131
normalizers[flags_t(insert::set)] = &normalize_insert<insert::set>; \
132
normalizers[flags_t(insert::map)] = &normalize_insert<insert::map>; \
133
}
134
}
// namespace plug::ord
135
136
#ifndef DOXYGEN
// don't include in Doxygen documentation
137
138
template
<>
constexpr
flags_t
Annex::Base<plug::ord::Key>
= 0x4131400000000000;
139
template
<>
constexpr
size_t
Annex::Num<plug::ord::Key>
= 0;
140
template
<>
constexpr
flags_t
Annex::Base<plug::ord::Set>
= 0x4131400000000100;
141
template
<>
constexpr
size_t
Annex::Num<plug::ord::Set>
= 0;
142
template
<>
constexpr
flags_t
Annex::Base<plug::ord::Map>
= 0x4131400000000200;
143
template
<>
constexpr
size_t
Annex::Num<plug::ord::Map>
= 0;
144
template
<>
constexpr
flags_t
Annex::Base<plug::ord::init>
= 0x4131400000000300;
145
template
<>
constexpr
size_t
Annex::Num<plug::ord::init>
= 2;
146
template
<>
constexpr
flags_t
Annex::Base<plug::ord::create_set>
= 0x4131400000000400;
147
template
<>
constexpr
size_t
Annex::Num<plug::ord::create_set>
= 0;
148
template
<>
constexpr
flags_t
Annex::Base<plug::ord::create_map>
= 0x4131400000000500;
149
template
<>
constexpr
size_t
Annex::Num<plug::ord::create_map>
= 0;
150
template
<>
constexpr
flags_t
Annex::Base<plug::ord::size>
= 0x4131400000000600;
151
template
<>
constexpr
size_t
Annex::Num<plug::ord::size>
= 2;
152
template
<>
constexpr
flags_t
Annex::Base<plug::ord::is_empty_set>
= 0x4131400000000700;
153
template
<>
constexpr
size_t
Annex::Num<plug::ord::is_empty_set>
= 0;
154
template
<>
constexpr
flags_t
Annex::Base<plug::ord::is_empty_map>
= 0x4131400000000800;
155
template
<>
constexpr
size_t
Annex::Num<plug::ord::is_empty_map>
= 0;
156
template
<>
constexpr
flags_t
Annex::Base<plug::ord::get>
= 0x4131400000000900;
157
template
<>
constexpr
size_t
Annex::Num<plug::ord::get>
= 0;
158
template
<>
constexpr
flags_t
Annex::Base<plug::ord::contains>
= 0x4131400000000a00;
159
template
<>
constexpr
size_t
Annex::Num<plug::ord::contains>
= 2;
160
template
<>
constexpr
flags_t
Annex::Base<plug::ord::insert>
= 0x4131400000000b00;
161
template
<>
constexpr
size_t
Annex::Num<plug::ord::insert>
= 2;
162
163
template
<>
struct
Axm::IsANode
<
plug
::ord::Key> {
using
type
=
Axm
; };
164
template
<>
struct
Axm::IsANode
<
plug
::ord::create_set> {
using
type
=
Axm
; };
165
template
<>
struct
Axm::IsANode
<
plug
::ord::create_map> {
using
type
=
Axm
; };
166
template
<>
struct
Axm::IsANode
<
plug
::ord::is_empty_set> {
using
type
=
Axm
; };
167
template
<>
struct
Axm::IsANode
<
plug
::ord::is_empty_map> {
using
type
=
Axm
; };
168
169
#endif
170
}
// namespace mim
171
172
#ifndef DOXYGEN
// don't include in Doxygen documentation
173
174
template
<>
struct
fe::is_bit_enum<
mim
::plug::ord::init> : std::true_type {};
175
template
<>
struct
fe::is_bit_enum<
mim
::plug::ord::size> : std::true_type {};
176
template
<>
struct
fe::is_bit_enum<
mim
::plug::ord::contains> : std::true_type {};
177
template
<>
struct
fe::is_bit_enum<
mim
::plug::ord::insert> : std::true_type {};
178
179
#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::ord
The ord Plugin
Definition
normalizers.cpp:12
mim::plug::ord::create_map
create_map
Definition
autogen.h:57
mim::plug::ord::create_set
create_set
Definition
autogen.h:50
mim::plug::ord::register_normalizers
void register_normalizers(Normalizers &normalizers)
mim::plug::ord::size
size
Definition
autogen.h:64
mim::plug::ord::is_empty_map
is_empty_map
Definition
autogen.h:83
mim::plug::ord::normalize_contains
const Def * normalize_contains(const Def *, const Def *callee, const Def *arg)
Definition
normalizers.cpp:75
mim::plug::ord::normalize_size
const Def * normalize_size(const Def *, const Def *, const Def *arg)
Definition
normalizers.cpp:43
mim::plug::ord::Set
Set
Definition
autogen.h:24
mim::plug::ord::Plugin_Id
static constexpr plugin_t Plugin_Id
Definition
autogen.h:10
mim::plug::ord::Key
Key
Definition
autogen.h:14
mim::plug::ord::normalize_insert
const Def * normalize_insert(const Def *type, const Def *callee, const Def *arg)
Definition
normalizers.cpp:105
mim::plug::ord::contains
contains
Definition
autogen.h:98
mim::plug::ord::get
get
Definition
autogen.h:90
mim::plug::ord::Map
Map
Definition
autogen.h:31
mim::plug::ord::insert
insert
Definition
autogen.h:110
mim::plug::ord::normalize_init
const Def * normalize_init(const Def *type, const Def *callee, const Def *arg)
Definition
normalizers.cpp:27
mim::plug::ord::is_empty_set
is_empty_set
Definition
autogen.h:76
mim::plug::ord::normalize_get
const Def * normalize_get(const Def *type, const Def *callee, const Def *arg)
Definition
normalizers.cpp:48
mim::plug::ord::init
init
Definition
autogen.h:38
mim::plug::ord::init::set
@ set
Definition
autogen.h:39
mim::plug
Definition
affine.h:10
mim
Definition
ast.h:16
mim::nat_t
u64 nat_t
Definition
types.h:37
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
mim::plug::ord::Key_field
The fields of ord.Key, by index.
Definition
autogen.h:18
mim::plug::ord::Key_field::T
@ T
Definition
autogen.h:18
mim::plug::ord::Key_field::lt
@ lt
Definition
autogen.h:18
build
include
mim
plug
ord
autogen.h
Generated by
1.18.0