MimIR 0.1
MimIR is my Intermediate Representation
Loading...
Searching...
No Matches
prefix_cleanup.h
Go to the documentation of this file.
1#pragma once
2
3#include "mim/phase.h"
4
5namespace mim {
6
7class PrefixCleanup : public RWPhase {
8public:
11
12 void apply(std::string);
13 void apply(const App* app) final { apply(tuple2str(app->arg())); }
14 void apply(Stage& s) final { apply(std::move(static_cast<PrefixCleanup&>(s).prefix_)); }
15
16private:
17 void rewrite_external(Def*) final;
18
19 std::string prefix_;
20};
21
22} // namespace mim
Base class for all Defs.
Definition def.h:251
void rewrite_external(Def *) final
void apply(std::string)
void apply(Stage &s) final
Dito, but invoked by Stage::recreate.
PrefixCleanup(World &world, flags_t annex)
void apply(const App *app) final
Invoked if your Stage has additional args.
RWPhase(World &world, std::string name)
Definition phase.h:71
World & world()=delete
Hides both and forbids direct access.
Common base for Phase and Pass.
Definition pass.h:26
flags_t annex() const
Definition pass.h:68
The World represents the whole program and manages creation of MimIR nodes (Defs).
Definition world.h:32
Definition ast.h:14
u64 flags_t
Definition types.h:45
std::string tuple2str(const Def *)
Definition tuple.cpp:77