16 for (
const auto& [_, mut] : externals) mut->transfer_external(
rewrite(mut)->
as_mut());
20 for (
bool todo =
true; todo;) {
32 for (
const auto& [f, def] :
world().
annexes()) new_world.register_annex(f, rewriter.
rewrite(def));
35 new_mut->make_external();
38 swap(
world(), new_world);
42 for (
auto& phase :
phases()) phase->run();
49 while (!muts.
empty()) {
50 auto mut = muts.
pop();
51 if (elide_empty_ && !mut->is_set())
continue;
void start() override
Actual entry.
T * as_mut() const
Asserts that this is a mutable, casts constness away and performs a static_cast to T.
void start() override
Actual entry.
virtual void start()=0
Actual entry.
virtual void run()
Entry point and generates some debug output; invokes Phase::start.
std::string_view name() const
const auto & phases() const
void start() override
Actual entry.
void start() override
Actual entry.
Recurseivly rewrites part of a program into the provided World.
void start() override
Actual entry.
virtual void visit(const Scope &)=0
const Scope & scope() const
A Scope represents a region of Defs that are live from the view of an entry's Var.
const MutSet & free_muts() const
All muts that occurr free in this Scope.
const auto & externals() const
World & verify()
Verifies that all externals() and annexes() are Def::is_closed(), if THORIN_ENABLE_CHECKS.
const auto & annexes() const