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/// The ctors of `option.Opt`, by index.
18struct Opt_ctor { enum : nat_t { None = 0, Some = 1, }; };
19
20///@}
21
22/// @name `option.some_if`
23///@{
24enum class some_if : flags_t {
25};
26
27///@}
28
29/// @name `option.is_some`
30///@{
31enum class is_some : flags_t {
32};
33
34///@}
35
36/// @name `option.unwrap_unsafe`
37///@{
38enum class unwrap_unsafe : flags_t {
39};
40
41const Def* normalize_unwrap_unsafe(const Def*, const Def*, const Def*);
42///@}
43
44/// @name `option.unwrap_or`
45///@{
46enum class unwrap_or : flags_t {
47};
48
49///@}
50
52
53#define MIM_option_NORMALIZER_IMPL \
54 void register_normalizers(Normalizers& normalizers) {\
55 normalizers[flags_t(Annex::Base<unwrap_unsafe>)] = &normalize_unwrap_unsafe; \
56 }
57} // namespace plug::option
58
59#ifndef DOXYGEN // don't include in Doxygen documentation
60
61template<> constexpr flags_t Annex::Base<plug::option::Opt> = 0x41154a40f0000000;
62template<> constexpr size_t Annex::Num<plug::option::Opt> = 0;
63template<> constexpr flags_t Annex::Base<plug::option::some_if> = 0x41154a40f0000100;
64template<> constexpr size_t Annex::Num<plug::option::some_if> = 0;
65template<> constexpr flags_t Annex::Base<plug::option::is_some> = 0x41154a40f0000200;
66template<> constexpr size_t Annex::Num<plug::option::is_some> = 0;
67template<> constexpr flags_t Annex::Base<plug::option::unwrap_unsafe> = 0x41154a40f0000300;
68template<> constexpr size_t Annex::Num<plug::option::unwrap_unsafe> = 0;
69template<> constexpr flags_t Annex::Base<plug::option::unwrap_or> = 0x41154a40f0000400;
70template<> constexpr size_t Annex::Num<plug::option::unwrap_or> = 0;
71
72template<> struct Axm::IsANode<plug::option::Opt> { using type = Axm; };
73template<> struct Axm::IsANode<plug::option::some_if> { using type = Axm; };
74template<> struct Axm::IsANode<plug::option::is_some> { using type = Axm; };
75template<> struct Axm::IsANode<plug::option::unwrap_or> { using type = Axm; };
76
77#endif
78} // namespace mim
79
80#ifndef DOXYGEN // don't include in Doxygen documentation
81
82
83#endif
Base class for all Defs.
Definition def.h:289
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 nat_t
Definition types.h:37
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
The ctors of option.Opt, by index.
Definition autogen.h:18