7#include <absl/container/btree_map.h>
8#include <absl/container/flat_hash_map.h>
23using Backends = absl::btree_map<std::string, void (*)(
World&, std::ostream&)>;
30 using Handle = std::unique_ptr<void, void (*)(
void*)>;
62 std::deque<std::deque<Sym>>
subs;
89 static std::optional<plugin_t>
mangle(Sym s);
128 template<
class Id>
static constexpr size_t Num = size_t(-1);
The World represents the whole program and manages creation of Thorin nodes (Defs).
absl::flat_hash_map< flags_t, std::function< void(World &, PipelineBuilder &, const Def *)> > Passes
axiom ↦ (pipeline part) × (axiom application) → () The function should inspect Application to const...
THORIN_EXPORT thorin::Plugin thorin_get_plugin()
To be implemented and exported by a plugin.
absl::flat_hash_map< flags_t, NormalizeFn > Normalizers
absl::btree_map< std::string, void(*)(World &, std::ostream &)> Backends
Holds info about an entity defined within a Plugin (called Annex).
Annex(Sym plugin, Sym tag, flags_t tag_id)
static tag_t flags2tag(flags_t f)
Yields the tag part of the name as integer.
static constexpr plugin_t Global_Plugin
static sub_t flags2sub(flags_t f)
Yields the sub part of the name as integer.
static Sym demangle(World &, plugin_t u)
Reverts an Axiom::mangled string to a Sym.
static plugin_t flags2plugin(flags_t f)
Yields the plugin part of the name as integer.
static flags_t flags2base(flags_t f)
Includes Axiom::plugin() and Axiom::tag() but not Axiom::sub.
static constexpr size_t Num
Number of Axiom::subtags.
static std::optional< plugin_t > mangle(Sym s)
Mangles s into a dense 48-bit representation.
static constexpr flags_t Base
static std::array< Sym, 3 > split(World &, Sym)
static constexpr size_t Max_Plugin_Size
std::deque< std::deque< Sym > > subs
List of subs which is a list of aliases.
Basic info and registration function pointer to be returned from a specific plugin.
const char * plugin_name
Name of the Plugin.
void(* register_backends)(Backends &backends)
Callback for registering the mapping from backend names to emission functions in the given backends m...
void(* register_normalizers)(Normalizers &normalizers)
Callback for registering the mapping from axiom ids to normalizer functions in the given normalizers ...
void(* register_passes)(Passes &passes)
Callback for registering the Plugin's callbacks for the pipeline extension points.
std::unique_ptr< void, void(*)(void *)> Handle