Thorin 1.9.0
The Higher ORder INtermediate representation
|
Holds info about an entity defined within a Plugin (called Annex). More...
#include <thorin/plugin.h>
Public Member Functions | |
Annex (Sym plugin, Sym tag, flags_t tag_id) | |
Static Public Member Functions | |
Annex Name | |
Anatomy of an Annex name: %plugin.tag.sub
| |
static plugin_t | flags2plugin (flags_t f) |
Yields the plugin part of the name as integer. | |
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. | |
Public Attributes | |
Sym | plugin |
Sym | tag |
flags_t | tag_id |
std::deque< std::deque< Sym > > | subs |
List of subs which is a list of aliases. | |
Sym | normalizer |
bool | pi = false |
Static Public Attributes | |
Helpers for Matching | |
These are set via template specialization. | |
template<class Id > | |
static constexpr size_t | Num = size_t(-1) |
Number of Axiom::subtags. | |
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 s) |
Mangles s into a dense 48-bit representation. | |
static Sym | demangle (World &, plugin_t u) |
Reverts an Axiom::mangled string to a Sym. | |
static std::array< Sym, 3 > | split (World &, Sym) |
|
inline |
Reverts an Axiom::mangled string to a Sym.
Ignores lower 16-bit of u
.
Definition at line 37 of file plugin.cpp.
References Base, Max_Plugin_Size, and thorin::World::sym().
Referenced by thorin::World::annex(), and thorin::World::register_annex().
Includes Axiom::plugin() and Axiom::tag() but not Axiom::sub.
Definition at line 120 of file plugin.h.
References Base.
Referenced by thorin::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 111 of file plugin.h.
References Global_Plugin.
Referenced by thorin::Axiom::plugin().
Yields the sub
part of the name as integer.
Definition at line 117 of file plugin.h.
References Base.
Referenced by thorin::Axiom::sub().
Yields the tag
part of the name as integer.
Definition at line 114 of file plugin.h.
References Base.
Referenced by thorin::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 Base, and Max_Plugin_Size.
Referenced by thorin::bootstrap(), and split().
|
static |
Definition at line 58 of file plugin.cpp.
References Base, mangle(), plugin, thorin::subview(), thorin::World::sym(), and tag.
Referenced by thorin_get_plugin().
Definition at line 131 of file plugin.h.
Referenced by thorin::World::annex(), demangle(), thorin::ll::Emitter::emit_bb(), flags2base(), flags2sub(), flags2tag(), mangle(), thorin::match(), thorin::plug::compile::normalize_combine_pass_list(), thorin::plug::compile::normalize_combined_phase(), thorin::plug::compile::normalize_pass_phase(), thorin::register_pass(), thorin::register_pass_with_arg(), thorin::register_phase(), split(), and thorin_get_plugin().
Definition at line 69 of file plugin.h.
Referenced by thorin::World::axiom(), and flags2plugin().
|
staticconstexpr |
Definition at line 68 of file plugin.h.
Referenced by demangle(), and mangle().
Number of Axiom::subtags.
std::deque<std::deque<Sym> > thorin::Annex::subs |