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::tuple @ref tuple
7
namespace
mim
{
8
namespace
plug::tuple
{
9
10
static
constexpr
plugin_t
Plugin_Id
= 0x55644d1800000000;
11
12
/// @name %%tuple.typecat
13
///@{
14
enum class
typecat
:
flags_t
{
15
};
16
17
///@}
18
19
/// @name %%tuple.cat
20
///@{
21
enum class
cat
:
flags_t
{
22
};
23
24
const
Def
*
normalize_cat
(
const
Def
*,
const
Def
*,
const
Def
*);
25
///@}
26
27
/// @name %%tuple.append
28
///@{
29
enum class
append
:
flags_t
{
30
};
31
32
///@}
33
34
/// @name %%tuple.prepend
35
///@{
36
enum class
prepend
:
flags_t
{
37
};
38
39
///@}
40
41
/// @name %%tuple.head
42
///@{
43
enum class
head
:
flags_t
{
44
};
45
46
///@}
47
48
/// @name %%tuple.tail
49
///@{
50
enum class
tail
:
flags_t
{
51
};
52
53
///@}
54
55
/// @name %%tuple.contains
56
///@{
57
enum class
contains
:
flags_t
{
58
};
59
60
const
Def
*
normalize_contains
(
const
Def
*,
const
Def
*,
const
Def
*);
61
///@}
62
63
/// @name %%tuple.zip
64
///@{
65
enum class
zip
:
flags_t
{
66
};
67
68
const
Def
*
normalize_zip
(
const
Def
*,
const
Def
*,
const
Def
*);
69
///@}
70
71
void
register_normalizers
(
Normalizers
& normalizers);
72
73
#define MIM_tuple_NORMALIZER_IMPL \
74
void register_normalizers(Normalizers& normalizers) {\
75
normalizers[flags_t(Annex::Base<cat>)] = &normalize_cat; \
76
normalizers[flags_t(Annex::Base<contains>)] = &normalize_contains; \
77
normalizers[flags_t(Annex::Base<zip>)] = &normalize_zip; \
78
}
79
}
// namespace plug::tuple
80
81
#ifndef DOXYGEN
// don't include in Doxygen documentation
82
83
template
<>
constexpr
flags_t
Annex::Base<plug::tuple::typecat>
= 0x55644d1800000000;
84
template
<>
constexpr
size_t
Annex::Num<plug::tuple::typecat>
= 0;
85
template
<>
constexpr
flags_t
Annex::Base<plug::tuple::cat>
= 0x55644d1800000100;
86
template
<>
constexpr
size_t
Annex::Num<plug::tuple::cat>
= 0;
87
template
<>
constexpr
flags_t
Annex::Base<plug::tuple::append>
= 0x55644d1800000200;
88
template
<>
constexpr
size_t
Annex::Num<plug::tuple::append>
= 0;
89
template
<>
constexpr
flags_t
Annex::Base<plug::tuple::prepend>
= 0x55644d1800000300;
90
template
<>
constexpr
size_t
Annex::Num<plug::tuple::prepend>
= 0;
91
template
<>
constexpr
flags_t
Annex::Base<plug::tuple::head>
= 0x55644d1800000400;
92
template
<>
constexpr
size_t
Annex::Num<plug::tuple::head>
= 0;
93
template
<>
constexpr
flags_t
Annex::Base<plug::tuple::tail>
= 0x55644d1800000500;
94
template
<>
constexpr
size_t
Annex::Num<plug::tuple::tail>
= 0;
95
template
<>
constexpr
flags_t
Annex::Base<plug::tuple::contains>
= 0x55644d1800000600;
96
template
<>
constexpr
size_t
Annex::Num<plug::tuple::contains>
= 0;
97
template
<>
constexpr
flags_t
Annex::Base<plug::tuple::zip>
= 0x55644d1800000700;
98
template
<>
constexpr
size_t
Annex::Num<plug::tuple::zip>
= 0;
99
100
template
<>
struct
Axm::IsANode
<
plug
::tuple::typecat> {
using
type
=
Axm
; };
101
template
<>
struct
Axm::IsANode
<
plug
::tuple::append> {
using
type
=
Axm
; };
102
template
<>
struct
Axm::IsANode
<
plug
::tuple::prepend> {
using
type
=
Axm
; };
103
template
<>
struct
Axm::IsANode
<
plug
::tuple::head> {
using
type
=
Axm
; };
104
template
<>
struct
Axm::IsANode
<
plug
::tuple::tail> {
using
type
=
Axm
; };
105
106
#endif
107
}
// namespace mim
108
109
#ifndef DOXYGEN
// don't include in Doxygen documentation
110
111
112
#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::tuple
The tuple Plugin
Definition
normalizers.cpp:6
mim::plug::tuple::Plugin_Id
static constexpr plugin_t Plugin_Id
Definition
autogen.h:10
mim::plug::tuple::zip
zip
Definition
autogen.h:65
mim::plug::tuple::contains
contains
Definition
autogen.h:57
mim::plug::tuple::head
head
Definition
autogen.h:43
mim::plug::tuple::cat
cat
Definition
autogen.h:21
mim::plug::tuple::normalize_cat
const Def * normalize_cat(const Def *, const Def *callee, const Def *arg)
Definition
normalizers.cpp:8
mim::plug::tuple::register_normalizers
void register_normalizers(Normalizers &normalizers)
mim::plug::tuple::normalize_zip
const Def * normalize_zip(const Def *type, const Def *c, const Def *arg)
Definition
normalizers.cpp:43
mim::plug::tuple::typecat
typecat
Definition
autogen.h:14
mim::plug::tuple::normalize_contains
const Def * normalize_contains(const Def *type, const Def *, const Def *arg)
Definition
normalizers.cpp:17
mim::plug::tuple::tail
tail
Definition
autogen.h:50
mim::plug::tuple::prepend
prepend
Definition
autogen.h:36
mim::plug::tuple::append
append
Definition
autogen.h:29
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
tuple
autogen.h
Generated by
1.18.0