42 if (str.empty())
return;
44 auto dot = str.find(
'.');
45 if (dot == std::string::npos)
return;
46 auto begin = str[0] ==
'%' ? 1uz : 0uz;
47 if (!
driver().is_loaded(
driver().sym(str.substr(begin, dot - begin))))
return;
53 std::unique_ptr<Stage>
take_resolved()
override {
return std::move(resolved_); }
56 std::unique_ptr<Stage> resolved_;
void reg_stages(Flags2Stages &stages)
void apply(const App *app) final
Invoked if your Stage has additional args.
std::unique_ptr< Stage > take_resolved() override
The Stage to use instead; nullptr means elide.
bool redirects() const override
If true, Stage::create uses take_resolved().
Named(World &w, flags_t a)
static void hook(Flags2Stages &stages)
Stage(World &world, std::string name)
static std::unique_ptr< Stage > create(const Flags2Stages &stages, const Def *def)
The World represents the whole program and manages creation of MimIR nodes (Defs).
void reg_stages(Flags2Stages &stages)
void register_normalizers(Normalizers &normalizers)
auto assert_emplace(C &container, Args &&... args)
Invokes emplace on container, asserts that insertion actually happened, and returns the iterator.
std::string tuple2str(const Def *)
absl::flat_hash_map< flags_t, std::function< std::unique_ptr< Stage >(World &)> > Flags2Stages
Maps an an axiom of a Stage to a function that creates one.
mim::Plugin mim_get_plugin()
static consteval flags_t base()
Basic info and registration function pointer to be returned from a specific plugin.