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