summaryrefslogtreecommitdiff
path: root/tiger-compiler/src/object/tasks.cc
diff options
context:
space:
mode:
Diffstat (limited to 'tiger-compiler/src/object/tasks.cc')
-rw-r--r--tiger-compiler/src/object/tasks.cc52
1 files changed, 52 insertions, 0 deletions
diff --git a/tiger-compiler/src/object/tasks.cc b/tiger-compiler/src/object/tasks.cc
new file mode 100644
index 0000000..c4d0929
--- /dev/null
+++ b/tiger-compiler/src/object/tasks.cc
@@ -0,0 +1,52 @@
+/**
+ ** \file object/tasks.cc
+ ** \brief Object module related tasks' implementation.
+ */
+
+#include <memory>
+
+#include <ast/tasks.hh>
+#include <astclone/libastclone.hh>
+#include <common.hh>
+#include <object/libobject.hh>
+#define DEFINE_TASKS 1
+#include <object/tasks.hh>
+#undef DEFINE_TASKS
+
+namespace object::tasks
+{
+ void object_parse() {}
+
+ // FIXME DONE: Some code was deleted here.
+ void object_bind()
+ {
+ task_error() << bind_obj(ast::tasks::the_program.get())
+ << &misc::error::exit_on_error;
+ }
+
+ void object_types_compute()
+ {
+ task_error() << ::object::types_check(*ast::tasks::the_program)
+ << &misc::error::exit_on_error;
+ }
+
+ static std::unique_ptr<class_names_type> class_names;
+
+ void object_rename()
+ {
+ class_names.reset(::object::rename(*ast::tasks::the_program));
+ }
+
+ void object_desugar()
+ {
+ astclone::apply(::object::desugar, ast::tasks::the_program,
+ *class_names.get());
+ }
+
+ void raw_object_desugar()
+ {
+ astclone::apply(::object::raw_desugar, ast::tasks::the_program,
+ *class_names.get());
+ }
+
+} // namespace object::tasks