diff --git a/src/thorin/transform/hoist_enters.cpp b/src/thorin/transform/hoist_enters.cpp index 5cd7fcfb4..7e8ab216e 100644 --- a/src/thorin/transform/hoist_enters.cpp +++ b/src/thorin/transform/hoist_enters.cpp @@ -8,7 +8,7 @@ namespace thorin { -std::stack todo; +static std::stack hoist_enters_todo; static void find_enters(std::deque& enters, const Def* def) { if (auto enter = def->isa()) @@ -19,15 +19,15 @@ static void find_enters(std::deque& enters, const Def* def) { for (auto use : def->uses()) { if (auto memop = use->isa()) - todo.push(memop); + hoist_enters_todo.push(memop); } } static void find_enters(std::deque& enters, Continuation* continuation) { if (auto mem_param = continuation->mem_param()) { - todo.push(mem_param); - while (!todo.empty()) { - auto next_item = pop(todo); + hoist_enters_todo.push(mem_param); + while (!hoist_enters_todo.empty()) { + auto next_item = pop(hoist_enters_todo); find_enters(enters, next_item); } diff --git a/src/thorin/transform/importer.cpp b/src/thorin/transform/importer.cpp index d476fb718..976e1c77f 100644 --- a/src/thorin/transform/importer.cpp +++ b/src/thorin/transform/importer.cpp @@ -1,9 +1,5 @@ #include "thorin/transform/importer.h" -#include -#include -#include - namespace thorin { const Type* Importer::import_type(const Type* otype) { @@ -32,10 +28,7 @@ const Type* Importer::import_type(const Type* otype) { return ntype; } -std::stack> required_defs; -std::set analyzed_conts; - -void enqueue(const Def* elem) { +void Importer::enqueue(const Def* elem) { if (elem->isa_nom()) { if (analyzed_conts.find(elem) != analyzed_conts.end()) { required_defs.push(std::pair(elem, false)); diff --git a/src/thorin/transform/importer.h b/src/thorin/transform/importer.h index eb7d5bc42..8d132a75b 100644 --- a/src/thorin/transform/importer.h +++ b/src/thorin/transform/importer.h @@ -4,6 +4,10 @@ #include "thorin/world.h" #include "thorin/config.h" +#include +#include +#include + namespace thorin { class Importer { @@ -26,6 +30,10 @@ class Importer { private: const Def* import_nonrecursive(); + void enqueue(const Def* elem); + + std::stack> required_defs; + std::set analyzed_conts; public: Type2Type type_old2new_;