MimIR 0.1
MimIR is my Intermediate Representation
|
Holds info about an entity defined within a Plugin (called Annex). More...
#include <mim/plugin.h>
Public Member Functions | |
Annex ()=delete | |
Static Public Member Functions | |
Annex Name | |
Anatomy of an Annex name: %plugin.tag.sub
| 48 | 8 | 8 | <-- Number of bits per field.
| |
static plugin_t | flags2plugin (flags_t f) |
static tag_t | flags2tag (flags_t f) |
Yields the tag part of the name as integer. | |
static sub_t | flags2sub (flags_t f) |
Yields the sub part of the name as integer. | |
static flags_t | flags2base (flags_t f) |
Includes Axiom::plugin() and Axiom::tag() but not Axiom::sub. | |
Static Public Attributes | |
Helpers for Matching | |
These are set via template specialization. | |
template<class Id > | |
static constexpr size_t | Num = size_t(-1) |
template<class Id > | |
static constexpr flags_t | Base = flags_t(-1) |
Mangling Plugin Name | |
static constexpr size_t | Max_Plugin_Size = 8 |
static constexpr plugin_t | Global_Plugin = 0xffff'ffff'ffff'0000_u64 |
static std::optional< plugin_t > | mangle (Sym plugin) |
Mangles s into a dense 48-bit representation. | |
static Sym | demangle (Driver &, plugin_t plugin) |
Reverts an Axiom::mangled string to a Sym. | |
static std::tuple< Sym, Sym, Sym > | split (Driver &, Sym) |
|
delete |
Reverts an Axiom::mangled string to a Sym.
Ignores lower 16-bit of u
.
Definition at line 37 of file plugin.cpp.
References Max_Plugin_Size.
Referenced by mim::World::annex(), and mim::World::register_annex().
Includes Axiom::plugin() and Axiom::tag() but not Axiom::sub.
Definition at line 108 of file plugin.h.
Referenced by mim::Axiom::base().
Yields the plugin
part of the name as integer. It consists of 48 relevant bits that are returned in the highest 6 bytes of a 64-bit integer.
Definition at line 99 of file plugin.h.
References Global_Plugin.
Referenced by mim::Axiom::plugin().
Yields the sub
part of the name as integer.
Definition at line 105 of file plugin.h.
Referenced by mim::Axiom::sub().
Yields the tag
part of the name as integer.
Definition at line 102 of file plugin.h.
Referenced by mim::Axiom::tag().
|
static |
Mangles s
into a dense 48-bit representation.
The layout is as follows:
The reserved
part is used for the Axiom::tag and the Axiom::sub. Each Char6x
is 6-bit wide and hence a plugin name has at most Axiom::Max_Plugin_Size = 8 chars. It uses this encoding:
Char6 | ASCII |
---|---|
1: | _ |
2-27: | a -z |
28-53: | A -Z |
54-63: | 0 -9 |
The 0 is special and marks the end of the name if the name has less than 8 chars.
std::nullopt
if encoding is not possible. Definition at line 9 of file plugin.cpp.
References Max_Plugin_Size.
Referenced by mim::ast::AnnexInfo::AnnexInfo(), mim::ast::AST::bootstrap(), mim::ast::AST::name2annex(), and split().
|
static |
Definition at line 58 of file plugin.cpp.
References mangle(), and mim::subview().
Referenced by mim_get_plugin(), and mim::ast::AST::name2annex().
Definition at line 118 of file plugin.h.
Referenced by mim::World::annex(), mim::ll::Emitter::emit_bb(), mim::match(), mim_get_plugin(), mim::plug::compile::normalize_combine_pass_list(), mim::plug::compile::normalize_combined_phase(), mim::plug::compile::normalize_pass_phase(), mim::register_pass(), mim::register_pass_with_arg(), and mim::register_phase().
|
staticconstexpr |
Definition at line 58 of file plugin.h.
Referenced by mim::World::axiom(), and flags2plugin().
|
staticconstexpr |
Definition at line 57 of file plugin.h.
Referenced by demangle(), and mangle().
|
staticconstexpr |
Number of Axiom::subtags.