refactor(furc): improve the SSA optimization class
Improve and rename the SSA optimization class to post process. Refs: #12
This commit is contained in:
+8
-4
@@ -3,7 +3,7 @@
|
||||
#include "furc/ast/program.hpp"
|
||||
#include "furc/front/ir_generator.hpp"
|
||||
#include "furc/front/parser.hpp"
|
||||
#include "furc/front/ssa.hpp"
|
||||
#include "furc/front/post_process.hpp"
|
||||
#include "furlang/arena.hpp"
|
||||
|
||||
#include <iostream>
|
||||
@@ -32,11 +32,15 @@ int main(void) {
|
||||
const auto& program = *programResult;
|
||||
program->accept(generator);
|
||||
|
||||
auto module = std::move(generator.move_module());
|
||||
furc::front::ssa::optimize(module);
|
||||
auto mod = std::move(generator.move_module());
|
||||
|
||||
furc::front::post_process postProcess;
|
||||
postProcess.push_stage(furc::front::post_process::Ssa);
|
||||
postProcess.push_stage(furc::front::post_process::DeSsa);
|
||||
postProcess.process(mod);
|
||||
|
||||
std::cout << "Generated IR:\n";
|
||||
for (const auto& function : module.functions()) {
|
||||
for (const auto& function : mod.functions()) {
|
||||
std::cout << function->name() << ":\n";
|
||||
furlang::ir::block_index blockIndex = 0;
|
||||
for (const auto& block : function->blocks()) {
|
||||
|
||||
Reference in New Issue
Block a user