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
6/// @namespace mim::plug::tuple @ref tuple
7namespace mim {
8namespace plug::tuple {
9
10static constexpr plugin_t Plugin_Id = 0x55644d1800000000;
11
12/// @name %%tuple.typecat
13///@{
14enum class typecat : flags_t {
15};
16
17///@}
18
19/// @name %%tuple.cat
20///@{
21enum class cat : flags_t {
22};
23
24const Def* normalize_cat(const Def*, const Def*, const Def*);
25///@}
26
27/// @name %%tuple.append
28///@{
29enum class append : flags_t {
30};
31
32///@}
33
34/// @name %%tuple.prepend
35///@{
36enum class prepend : flags_t {
37};
38
39///@}
40
41/// @name %%tuple.head
42///@{
43enum class head : flags_t {
44};
45
46///@}
47
48/// @name %%tuple.tail
49///@{
50enum class tail : flags_t {
51};
52
53///@}
54
55/// @name %%tuple.contains
56///@{
57enum class contains : flags_t {
58};
59
60const Def* normalize_contains(const Def*, const Def*, const Def*);
61///@}
62
63/// @name %%tuple.zip
64///@{
65enum class zip : flags_t {
66};
67
68const Def* normalize_zip(const Def*, const Def*, const Def*);
69///@}
70
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
83template<> constexpr flags_t Annex::Base<plug::tuple::typecat> = 0x55644d1800000000;
84template<> constexpr size_t Annex::Num<plug::tuple::typecat> = 0;
85template<> constexpr flags_t Annex::Base<plug::tuple::cat> = 0x55644d1800000100;
86template<> constexpr size_t Annex::Num<plug::tuple::cat> = 0;
87template<> constexpr flags_t Annex::Base<plug::tuple::append> = 0x55644d1800000200;
88template<> constexpr size_t Annex::Num<plug::tuple::append> = 0;
89template<> constexpr flags_t Annex::Base<plug::tuple::prepend> = 0x55644d1800000300;
90template<> constexpr size_t Annex::Num<plug::tuple::prepend> = 0;
91template<> constexpr flags_t Annex::Base<plug::tuple::head> = 0x55644d1800000400;
92template<> constexpr size_t Annex::Num<plug::tuple::head> = 0;
93template<> constexpr flags_t Annex::Base<plug::tuple::tail> = 0x55644d1800000500;
94template<> constexpr size_t Annex::Num<plug::tuple::tail> = 0;
95template<> constexpr flags_t Annex::Base<plug::tuple::contains> = 0x55644d1800000600;
96template<> constexpr size_t Annex::Num<plug::tuple::contains> = 0;
97template<> constexpr flags_t Annex::Base<plug::tuple::zip> = 0x55644d1800000700;
98template<> constexpr size_t Annex::Num<plug::tuple::zip> = 0;
99
100template<> struct Axm::IsANode<plug::tuple::typecat> { using type = Axm; };
101template<> struct Axm::IsANode<plug::tuple::append> { using type = Axm; };
102template<> struct Axm::IsANode<plug::tuple::prepend> { using type = Axm; };
103template<> struct Axm::IsANode<plug::tuple::head> { using type = Axm; };
104template<> 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
Base class for all Defs.
Definition def.h:246
The tuple Plugin
static constexpr plugin_t Plugin_Id
Definition autogen.h:10
const Def * normalize_cat(const Def *, const Def *callee, const Def *arg)
void register_normalizers(Normalizers &normalizers)
const Def * normalize_zip(const Def *type, const Def *c, const Def *arg)
const Def * normalize_contains(const Def *type, const Def *, const Def *arg)
Definition ast.h:14
u64 flags_t
Definition types.h:39
absl::flat_hash_map< flags_t, NormalizeFn > Normalizers
Definition plugin.h:22
u64 plugin_t
Definition types.h:40
@ Axm
Definition def.h:109
static constexpr size_t Num
Number of Axm::subtags.
Definition plugin.h:147
static constexpr flags_t Base
Definition plugin.h:148