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::option @ref option
7namespace mim {
8namespace plug::option {
9
10static constexpr plugin_t Plugin_Id = 0x41154a40f0000000;
11
12/// @name %%option.Opt
13///@{
14enum class Opt : flags_t {
15};
16
17///@}
18
19/// @name %%option.some
20///@{
21enum class some : flags_t {
22};
23
24///@}
25
26/// @name %%option.none
27///@{
28enum class none : flags_t {
29};
30
31///@}
32
33/// @name %%option.some_if
34///@{
35enum class some_if : flags_t {
36};
37
38///@}
39
40/// @name %%option.is_some
41///@{
42enum class is_some : flags_t {
43};
44
45///@}
46
47/// @name %%option.unwrap_unsafe
48///@{
49enum class unwrap_unsafe : flags_t {
50};
51
52const Def* normalize_unwrap_unsafe(const Def*, const Def*, const Def*);
53///@}
54
55/// @name %%option.unwrap_or
56///@{
57enum class unwrap_or : flags_t {
58};
59
60///@}
61
63
64#define MIM_option_NORMALIZER_IMPL \
65 void register_normalizers(Normalizers& normalizers) {\
66 normalizers[flags_t(Annex::Base<unwrap_unsafe>)] = &normalize_unwrap_unsafe; \
67 }
68} // namespace plug::option
69
70#ifndef DOXYGEN // don't include in Doxygen documentation
71
72template<> constexpr flags_t Annex::Base<plug::option::Opt> = 0x41154a40f0000000;
73template<> constexpr size_t Annex::Num<plug::option::Opt> = 0;
74template<> constexpr flags_t Annex::Base<plug::option::some> = 0x41154a40f0000100;
75template<> constexpr size_t Annex::Num<plug::option::some> = 0;
76template<> constexpr flags_t Annex::Base<plug::option::none> = 0x41154a40f0000200;
77template<> constexpr size_t Annex::Num<plug::option::none> = 0;
78template<> constexpr flags_t Annex::Base<plug::option::some_if> = 0x41154a40f0000300;
79template<> constexpr size_t Annex::Num<plug::option::some_if> = 0;
80template<> constexpr flags_t Annex::Base<plug::option::is_some> = 0x41154a40f0000400;
81template<> constexpr size_t Annex::Num<plug::option::is_some> = 0;
82template<> constexpr flags_t Annex::Base<plug::option::unwrap_unsafe> = 0x41154a40f0000500;
83template<> constexpr size_t Annex::Num<plug::option::unwrap_unsafe> = 0;
84template<> constexpr flags_t Annex::Base<plug::option::unwrap_or> = 0x41154a40f0000600;
85template<> constexpr size_t Annex::Num<plug::option::unwrap_or> = 0;
86
87template<> struct Axm::IsANode<plug::option::Opt> { using type = Axm; };
88template<> struct Axm::IsANode<plug::option::some> { using type = Axm; };
89template<> struct Axm::IsANode<plug::option::none> { using type = Axm; };
90template<> struct Axm::IsANode<plug::option::some_if> { using type = Axm; };
91template<> struct Axm::IsANode<plug::option::is_some> { using type = Axm; };
92template<> struct Axm::IsANode<plug::option::unwrap_or> { using type = Axm; };
93
94#endif
95} // namespace mim
96
97#ifndef DOXYGEN // don't include in Doxygen documentation
98
99
100#endif
Base class for all Defs.
Definition def.h:273
The option Plugin
static constexpr plugin_t Plugin_Id
Definition autogen.h:10
const Def * normalize_unwrap_unsafe(const Def *, const Def *, const Def *arg)
void register_normalizers(Normalizers &normalizers)
Definition ast.h:16
u64 flags_t
Definition types.h:39
absl::flat_hash_map< flags_t, NormalizeFn > Normalizers
Definition plugin.h:27
u64 plugin_t
Definition types.h:40
@ Axm
Definition def.h:122
static constexpr size_t Num
Number of Axm::subtags.
Definition plugin.h:247
static constexpr flags_t Base
Definition plugin.h:248