From 967be9e750221ab2ab783f95df79bb26d290a45e Mon Sep 17 00:00:00 2001 From: Martial Simon Date: Mon, 15 Sep 2025 01:07:58 +0200 Subject: add: added projects --- tiger-compiler/src/combine/tasks.cc | 74 +++++++++++++++++++++++++++++++++++++ 1 file changed, 74 insertions(+) create mode 100644 tiger-compiler/src/combine/tasks.cc (limited to 'tiger-compiler/src/combine/tasks.cc') diff --git a/tiger-compiler/src/combine/tasks.cc b/tiger-compiler/src/combine/tasks.cc new file mode 100644 index 0000000..48470ac --- /dev/null +++ b/tiger-compiler/src/combine/tasks.cc @@ -0,0 +1,74 @@ +/** + ** \file combine/tasks.cc + ** \brief Combine module related tasks' implementation. + */ + +#include +#include +#include +#include +#include + +#include +#include +#include + +#include + +#include +#define DEFINE_TASKS 1 +#include +#undef DEFINE_TASKS + +namespace combine::tasks +{ + std::unique_ptr the_overfun_bindings = + nullptr; + + void combine_bindings_compute() + { + auto result = + ::combine::combine_bind(*ast::tasks::the_program, c_overload_p); + ::combine::tasks::the_overfun_bindings = + std::make_unique( + std::move(result.first)); + + task_error() << result.second << &misc::error::exit_on_error; + } + + void combine_types_compute() + { + task_error() << ::combine::combine_types_check( + *ast::tasks::the_program, *::combine::tasks::the_overfun_bindings, + c_overload_p); + the_overfun_bindings.reset(); + task_error().exit_on_error(); + } + + void combine_rename() + { + // FIXME: Some code was deleted here (Call appropriate renaming tasks). + } + + void combine_desugar() + { + if (c_object_p) + ::object::tasks::object_desugar(); + + if (c_desugar_p) + ::desugar::tasks::desugar(); + + if (c_bounds_p) + astclone::apply(::desugar::bounds_checks_add, ast::tasks::the_program); + + if (c_inline_p) + astclone::apply(::inlining::inline_expand, ast::tasks::the_program); + + if (c_prune_p) + astclone::apply(::inlining::prune, ast::tasks::the_program); + + if (c_escapes_p) + ::escapes::tasks::escapes_compute(); + } + +} // namespace combine::tasks -- cgit v1.2.3