6#include <absl/container/btree_map.h>
7#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*)>;
78 static std::optional<plugin_t>
mangle(Sym plugin);
84 static std::tuple<Sym, Sym, Sym>
split(
Driver&, Sym);
115 template<
class Id>
static constexpr size_t Num = size_t(-1);
Some "global" variables needed all over the place.
The World represents the whole program and manages creation of MimIR 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...
absl::btree_map< std::string, void(*)(World &, std::ostream &)> Backends
MIM_EXPORT mim::Plugin mim_get_plugin()
absl::flat_hash_map< flags_t, NormalizeFn > Normalizers
Holds info about an entity defined within a Plugin (called Annex).
static sub_t flags2sub(flags_t f)
Yields the sub part of the name as integer.
static std::tuple< Sym, Sym, Sym > split(Driver &, Sym)
static constexpr plugin_t Global_Plugin
static plugin_t flags2plugin(flags_t f)
static constexpr size_t Max_Plugin_Size
static flags_t flags2base(flags_t f)
Includes Axiom::plugin() and Axiom::tag() but not Axiom::sub.
static Sym demangle(Driver &, plugin_t plugin)
Reverts an Axiom::mangled string to a Sym.
static std::optional< plugin_t > mangle(Sym plugin)
Mangles s into a dense 48-bit representation.
static constexpr size_t Num
static constexpr flags_t Base
static tag_t flags2tag(flags_t f)
Yields the tag part of the name as integer.
Basic info and registration function pointer to be returned from a specific plugin.
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.
void(* register_backends)(Backends &backends)
Callback for registering the mapping from backend names to emission functions in the given backends m...
const char * plugin_name
Name of the Plugin.
std::unique_ptr< void, void(*)(void *)> Handle