summaryrefslogtreecommitdiff
path: root/tiger-compiler/src/assert/tasks.cc
blob: 3e43ecd77d9429952fd28b5b3a8b6ac1fa85933a (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
53
/**
 ** \file assert/tasks.cc
 ** \brief Assert module related tasks' implementation.
 */

#include <ast/tasks.hh>
#include <astclone/libastclone.hh>
#include <assert/libassert.hh>
#include <common.hh>
#include <desugar/tasks.hh>
#include <escapes/tasks.hh>
#include <llvmtranslate/tasks.hh>
#define DEFINE_TASKS 1
#include <assert/tasks.hh>
#undef DEFINE_TASKS

namespace assert::tasks
{
  void parse() {}

  void bind()
  {
    task_error() << ::assert::bind(*ast::tasks::the_program.get())
                 << &misc::error::exit_on_error;
  }

  void types_compute()
  {
    task_error() << ::assert::types_check(*ast::tasks::the_program.get())
                 << &misc::error::exit_on_error;
  }

  void rename()
  {
    task_error() << ::assert::rename(*ast::tasks::the_program.get())
                 << &misc::error::exit_on_error;
  }

  void desugar()
  {
    astclone::apply(::assert::desugar, ast::tasks::the_program,
                    desugar::tasks::desugar_for_p,
                    desugar::tasks::desugar_string_cmp_p);
  }

  void raw_desugar()
  {
    astclone::apply(::assert::raw_desugar, ast::tasks::the_program,
                    desugar::tasks::desugar_for_p,
                    desugar::tasks::desugar_string_cmp_p);
  }

} // namespace assert::tasks