summaryrefslogtreecommitdiff
path: root/tiger-compiler/src/object/tasks.cc
blob: c4d09295c32f80f97a5bae8d273d1840b8cc334e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
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