MimIR 0.1
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.concat
13///@{
14enum class concat : flags_t {
15};
16
17const Def* normalize_concat(const Def*, const Def*, const Def*);
18///@}
19
20/// @name %%tuple.append
21///@{
22enum class append : flags_t {
23};
24
25///@}
26
27/// @name %%tuple.prepend
28///@{
29enum class prepend : flags_t {
30};
31
32///@}
33
34/// @name %%tuple.zip
35///@{
36enum class zip : flags_t {
37};
38
39const Def* normalize_zip(const Def*, const Def*, const Def*);
40///@}
41
43
44#define MIM_tuple_NORMALIZER_IMPL \
45 void register_normalizers(Normalizers& normalizers) {\
46 normalizers[flags_t(Annex::Base<concat>)] = &normalize_concat; \
47 normalizers[flags_t(Annex::Base<zip>)] = &normalize_zip; \
48 }
49} // namespace plug::tuple
50
51#ifndef DOXYGEN // don't include in Doxygen documentation
52
53template<> constexpr flags_t Annex::Base<plug::tuple::concat> = 0x55644d1800000000;
54template<> constexpr size_t Annex::Num<plug::tuple::concat> = 0;
55template<> constexpr flags_t Annex::Base<plug::tuple::append> = 0x55644d1800000100;
56template<> constexpr size_t Annex::Num<plug::tuple::append> = 0;
57template<> constexpr flags_t Annex::Base<plug::tuple::prepend> = 0x55644d1800000200;
58template<> constexpr size_t Annex::Num<plug::tuple::prepend> = 0;
59template<> constexpr flags_t Annex::Base<plug::tuple::zip> = 0x55644d1800000300;
60template<> constexpr size_t Annex::Num<plug::tuple::zip> = 0;
61
62template<> struct Axm::IsANode<plug::tuple::append> { using type = Axm; };
63template<> struct Axm::IsANode<plug::tuple::prepend> { using type = Axm; };
64
65#endif
66} // namespace mim
67
68#ifndef DOXYGEN // don't include in Doxygen documentation
69
70
71#endif
Base class for all Defs.
Definition def.h:198
The tuple Plugin
static constexpr plugin_t Plugin_Id
Definition autogen.h:10
void register_normalizers(Normalizers &normalizers)
const Def * normalize_zip(const Def *type, const Def *c, const Def *arg)
const Def * normalize_concat(const Def *type, const Def *callee, const Def *arg)
Definition ast.h:14
u64 flags_t
Definition types.h:45
absl::flat_hash_map< flags_t, NormalizeFn > Normalizers
Definition plugin.h:19
u64 plugin_t
Definition types.h:46
@ Axm
Definition def.h:85
static constexpr size_t Num
Definition plugin.h:115
static constexpr flags_t Base
Definition plugin.h:118