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 constexpr plugin_t | flags2plugin (flags_t f) |
| static constexpr tag_t | flags2tag (flags_t f) |
| Yields the tag part of the name as integer. | |
| static constexpr sub_t | flags2sub (flags_t f) |
| Yields the sub part of the name as integer. | |
| static constexpr flags_t | flags2base (flags_t f) |
| Includes Axm::plugin() and Axm::tag() but not Axm::sub. | |
| static constexpr flags_t | flags (plugin_t p, tag_t t, sub_t s=0) |
| Assembles the full flags from its plugin, tag, and sub fields. | |
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 (std::string_view plugin) |
Mangles s into a dense 48-bit representation. | |
| static std::string | demangle (plugin_t plugin) |
Reverts an Axm::mangled plugin back to its name; never longer than Annex::Max_Plugin_Size. | |
Helpers for Matching | |
These are set via template specialization. | |
| template<class Id> | |
| static constexpr size_t | Num = size_t(-1) |
| Number of Axm::subtags. | |
| template<class Id> | |
| static constexpr flags_t | Base = flags_t(-1) |
| template<class Id> | |
| static consteval size_t | num () |
| template<class Id> | |
| static consteval flags_t | base () |
|
delete |
|
inlinestaticconsteval |
Definition at line 250 of file plugin.h.
References Base.
Referenced by mim::World::annex(), mim::Phase::hook(), mim::Axm::isa(), mim::plug::compile::normalize_cond(), reg_phases(), and mim::plug::gpu::phase::SplitApply::start().
|
static |
Reverts an Axm::mangled plugin back to its name; never longer than Annex::Max_Plugin_Size.
Ignores lower 16-bit of plugin.
Definition at line 33 of file plugin.cpp.
References Max_Plugin_Size.
Referenced by mim::World::annex(), mim::Phase::args(), mim::World::Annexes::attach(), and mim::World::Annexes::attach_alias().
Assembles the full flags from its plugin, tag, and sub fields.
Definition at line 240 of file plugin.h.
Referenced by mim::World::Annexes::attach(), mim::World::Annexes::attach_alias(), mim::ast::AnnexInfo::base(), and mim::Driver::normalizer().
Includes Axm::plugin() and Axm::tag() but not Axm::sub.
Definition at line 237 of file plugin.h.
Referenced by mim::Axm::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 228 of file plugin.h.
References Global_Plugin.
Referenced by mim::Phase::args(), mim::Axm::plugin(), and mim::Unload::start().
Yields the sub part of the name as integer.
Definition at line 234 of file plugin.h.
Referenced by mim::Axm::sub().
Yields the tag part of the name as integer.
Definition at line 231 of file plugin.h.
Referenced by mim::Axm::tag().
|
static |
Mangles s into a dense 48-bit representation.
The layout is as follows:
The reserved part is used for the Axm::tag and the Axm::sub. Each Char6x is 6-bit wide and hence a plugin name has at most Axm::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.
Definition at line 5 of file plugin.cpp.
References Max_Plugin_Size.
Referenced by mim::Unload::apply(), mim::ast::AST::bootstrap(), mim::ast::AST::bootstrap_py(), mim::ast::AST::name2annex(), and mim::ast::AnnexInfo::plugin_id().
|
inlinestaticconsteval |
|
staticconstexpr |
Definition at line 188 of file plugin.h.
Referenced by mim::World::axm(), and flags2plugin().
|
staticconstexpr |
Definition at line 187 of file plugin.h.
Referenced by demangle(), and mangle().
|
staticconstexpr |