33 void start() final { fe::unreachable(); }
38 if (str.empty())
return;
40 auto dot = str.find(
'.');
41 if (dot == std::string::npos)
return;
42 auto begin = str[0] ==
'%' ? 1uz : 0uz;
43 if (!
driver().is_loaded(
driver().sym(str.substr(begin, dot - begin))))
return;
49 std::unique_ptr<Phase>
take_resolved()
override {
return std::move(resolved_); }
52 std::unique_ptr<Phase> resolved_;
void reg_phases(Flags2Phases &phases)
void apply(const App *app) final
Invoked if your Phase has additional args.
std::unique_ptr< Phase > take_resolved() override
The Phase to use instead; nullptr means elide.
void start() final
Actual entry.
bool redirects() const override
If true, Phase::create uses take_resolved().
Named(World &w, flags_t a)
static void hook(Flags2Phases &phases)
Phase(World &world, std::string name)
static std::unique_ptr< Phase > create(const Flags2Phases &phases, const Def *def)
The World represents the whole program and manages creation of MimIR nodes (Defs).
void reg_phases(Flags2Phases &phases)
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.
absl::flat_hash_map< flags_t, std::function< std::unique_ptr< Phase >(World &)> > Flags2Phases
Maps an axiom of a Phase to a function that creates one.
std::string tuple2str(const Def *)
mim::Plugin mim_get_plugin()
static consteval flags_t base()
Basic info and registration function pointer to be returned from a specific plugin.