MimIR
MimIR is my Intermediate Representation
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
7
8/// @namespace mim::plug::mem @ref mem
9namespace mim {
10namespace plug::mem {
11
12static constexpr plugin_t Plugin_Id = 0x3863800000000000;
13
16
17/// @name `mem.Ptr0`
18///@{
19enum class Ptr0 : flags_t {
20};
21
22///@}
23
24/// @name `mem.Char`
25///@{
26enum class Char : flags_t {
27};
28
29///@}
30
31/// @name `mem.Str`
32///@{
33enum class Str : flags_t {
34};
35
36///@}
37
38/// @name `mem.load`
39///@{
40enum class load : flags_t {
41};
42
43const Def* normalize_load(const Def*, const Def*, const Def*);
44///@}
45
46/// @name `mem.store`
47///@{
48enum class store : flags_t {
49};
50
51const Def* normalize_store(const Def*, const Def*, const Def*);
52///@}
53
54/// @name `mem.fresh`
55///@{
56enum class fresh : flags_t {
57};
58
59///@}
60
61/// @name `mem.alloc`
62///@{
63enum class alloc : flags_t {
64};
65
66///@}
67
68/// @name `mem.slot`
69///@{
70enum class slot : flags_t {
71};
72
73///@}
74
75/// @name `mem.malloc`
76///@{
77enum class malloc : flags_t {
78};
79
80///@}
81
82/// @name `mem.free`
83///@{
84enum class free : flags_t {
85};
86
87///@}
88
89/// @name `mem.mslot`
90///@{
91enum class mslot : flags_t {
92};
93
94///@}
95
96/// @name `mem.lea`
97///@{
98enum class lea : flags_t {
99};
100
101const Def* normalize_lea(const Def*, const Def*, const Def*);
102///@}
103
104/// @name `mem.decay`
105///@{
106enum class decay : flags_t {
107};
108
109///@}
110
111/// @name `mem.assume`
112///@{
113enum class assume : flags_t {
114};
115
116///@}
117
118/// @name `mem.cstr`
119///@{
120enum class cstr : flags_t {
121};
122
123///@}
124
125/// @name `mem.add_mem`
126///@{
127enum class add_mem : flags_t {
128};
129
130///@}
131
132/// @name `mem.free_locals`
133///@{
134enum class free_locals : flags_t {
135};
136
137///@}
138
139/// @name `mem.heap2stack`
140///@{
141enum class heap2stack : flags_t {
142};
143
144///@}
145
146/// @name `mem.seo`
147///@{
148enum class seo : flags_t {
149};
150
151///@}
152
153/// @name `mem.alloc2malloc_repl`
154///@{
156};
157
158///@}
159
161
162#define MIM_mem_NORMALIZER_IMPL \
163 void register_normalizers(Normalizers& normalizers) {\
164 normalizers[flags_t(Annex::Base<load>)] = &normalize_load; \
165 normalizers[flags_t(Annex::Base<store>)] = &normalize_store; \
166 normalizers[flags_t(Annex::Base<lea>)] = &normalize_lea; \
167 }
168} // namespace plug::mem
169
170#ifndef DOXYGEN // don't include in Doxygen documentation
171
172template<> constexpr flags_t Annex::Base<plug::mem::Ptr0> = 0x3863800000000000;
173template<> constexpr size_t Annex::Num<plug::mem::Ptr0> = 0;
174template<> constexpr flags_t Annex::Base<plug::mem::Char> = 0x3863800000000100;
175template<> constexpr size_t Annex::Num<plug::mem::Char> = 0;
176template<> constexpr flags_t Annex::Base<plug::mem::Str> = 0x3863800000000200;
177template<> constexpr size_t Annex::Num<plug::mem::Str> = 0;
178template<> constexpr flags_t Annex::Base<plug::mem::load> = 0x3863800000000300;
179template<> constexpr size_t Annex::Num<plug::mem::load> = 0;
180template<> constexpr flags_t Annex::Base<plug::mem::store> = 0x3863800000000400;
181template<> constexpr size_t Annex::Num<plug::mem::store> = 0;
182template<> constexpr flags_t Annex::Base<plug::mem::fresh> = 0x3863800000000500;
183template<> constexpr size_t Annex::Num<plug::mem::fresh> = 0;
184template<> constexpr flags_t Annex::Base<plug::mem::alloc> = 0x3863800000000600;
185template<> constexpr size_t Annex::Num<plug::mem::alloc> = 0;
186template<> constexpr flags_t Annex::Base<plug::mem::slot> = 0x3863800000000700;
187template<> constexpr size_t Annex::Num<plug::mem::slot> = 0;
188template<> constexpr flags_t Annex::Base<plug::mem::malloc> = 0x3863800000000800;
189template<> constexpr size_t Annex::Num<plug::mem::malloc> = 0;
190template<> constexpr flags_t Annex::Base<plug::mem::free> = 0x3863800000000900;
191template<> constexpr size_t Annex::Num<plug::mem::free> = 0;
192template<> constexpr flags_t Annex::Base<plug::mem::mslot> = 0x3863800000000a00;
193template<> constexpr size_t Annex::Num<plug::mem::mslot> = 0;
194template<> constexpr flags_t Annex::Base<plug::mem::lea> = 0x3863800000000b00;
195template<> constexpr size_t Annex::Num<plug::mem::lea> = 0;
196template<> constexpr flags_t Annex::Base<plug::mem::decay> = 0x3863800000000c00;
197template<> constexpr size_t Annex::Num<plug::mem::decay> = 0;
198template<> constexpr flags_t Annex::Base<plug::mem::assume> = 0x3863800000000d00;
199template<> constexpr size_t Annex::Num<plug::mem::assume> = 0;
200template<> constexpr flags_t Annex::Base<plug::mem::cstr> = 0x3863800000000e00;
201template<> constexpr size_t Annex::Num<plug::mem::cstr> = 0;
202template<> constexpr flags_t Annex::Base<plug::mem::add_mem> = 0x3863800000000f00;
203template<> constexpr size_t Annex::Num<plug::mem::add_mem> = 0;
204template<> constexpr flags_t Annex::Base<plug::mem::free_locals> = 0x3863800000001000;
205template<> constexpr size_t Annex::Num<plug::mem::free_locals> = 0;
206template<> constexpr flags_t Annex::Base<plug::mem::heap2stack> = 0x3863800000001100;
207template<> constexpr size_t Annex::Num<plug::mem::heap2stack> = 0;
208template<> constexpr flags_t Annex::Base<plug::mem::seo> = 0x3863800000001200;
209template<> constexpr size_t Annex::Num<plug::mem::seo> = 0;
210template<> constexpr flags_t Annex::Base<plug::mem::alloc2malloc_repl> = 0x3863800000001300;
211template<> constexpr size_t Annex::Num<plug::mem::alloc2malloc_repl> = 0;
212
213template<> struct Axm::IsANode<plug::mem::Ptr0> { using type = Axm; };
214template<> struct Axm::IsANode<plug::mem::Char> { using type = Axm; };
215template<> struct Axm::IsANode<plug::mem::Str> { using type = Axm; };
216template<> struct Axm::IsANode<plug::mem::decay> { using type = Axm; };
217template<> struct Axm::IsANode<plug::mem::cstr> { using type = Axm; };
218template<> struct Axm::IsANode<plug::mem::add_mem> { using type = Axm; };
219template<> struct Axm::IsANode<plug::mem::free_locals> { using type = Axm; };
220template<> struct Axm::IsANode<plug::mem::heap2stack> { using type = Axm; };
221template<> struct Axm::IsANode<plug::mem::seo> { using type = Axm; };
222template<> struct Axm::IsANode<plug::mem::alloc2malloc_repl> { using type = Axm; };
223
224#endif
225} // namespace mim
226
227#ifndef DOXYGEN // don't include in Doxygen documentation
228
229
230#endif
Base class for all Defs.
Definition def.h:289
The mem Plugin
void register_normalizers(Normalizers &normalizers)
const Def * normalize_lea(const Def *, const Def *, const Def *arg)
plug::core::Ptr Ptr
Definition autogen.h:15
static constexpr plugin_t Plugin_Id
Definition autogen.h:12
const Def * normalize_store(const Def *, const Def *, const Def *arg)
const Def * normalize_load(const Def *type, const Def *, const Def *arg)
plug::core::M M
Definition autogen.h:14
Definition ast.h:16
u64 flags_t
Definition types.h:39
ankerl::unordered_dense::map< flags_t, NormalizeFn > Normalizers
Definition plugin.h:27
u64 plugin_t
Definition types.h:40
@ Axm
Definition def.h:125
static constexpr size_t Num
Number of Axm::subtags.
Definition plugin.h:273
static constexpr flags_t Base
Definition plugin.h:274