summaryrefslogtreecommitdiff
path: root/tiger-compiler/src/desugar/tasks.hh
diff options
context:
space:
mode:
authorMartial Simon <msimon_fr@hotmail.com>2025-09-15 01:07:58 +0200
committerMartial Simon <msimon_fr@hotmail.com>2025-09-15 01:07:58 +0200
commit967be9e750221ab2ab783f95df79bb26d290a45e (patch)
tree6802900a5e975f9f68b169f0f503f040056d6952 /tiger-compiler/src/desugar/tasks.hh
add: added projectsHEADmain
Diffstat (limited to 'tiger-compiler/src/desugar/tasks.hh')
-rw-r--r--tiger-compiler/src/desugar/tasks.hh75
1 files changed, 75 insertions, 0 deletions
diff --git a/tiger-compiler/src/desugar/tasks.hh b/tiger-compiler/src/desugar/tasks.hh
new file mode 100644
index 0000000..44a68e6
--- /dev/null
+++ b/tiger-compiler/src/desugar/tasks.hh
@@ -0,0 +1,75 @@
+/**
+ ** \file desugar/tasks.hh
+ ** \brief Desugar module tasks.
+ */
+
+#pragma once
+
+#include <config.h>
+#include <misc/fwd.hh>
+#include <task/libtask.hh>
+
+/// Tasks of the desugar module.
+namespace desugar::tasks
+{
+ TASK_GROUP("Desugaring and bounds-checking");
+
+ /*-------------.
+ | Desugaring. |
+ `-------------*/
+
+ /// Enable translation of `for' loops into `while' loops.
+ BOOLEAN_TASK_DECLARE("desugar-for", "desugar `for' loops", desugar_for_p, "");
+
+ /// Enable string comparison desugaring.
+ BOOLEAN_TASK_DECLARE("desugar-string-cmp",
+ "desugar string comparisons",
+ desugar_string_cmp_p,
+ "");
+
+ /// Default the removal of syntactic sugar from the AST to Tiger
+ /// (without overloading).
+ DISJUNCTIVE_TASK_DECLARE("desugared",
+ "Default the removal of syntactic sugar "
+ "from the AST to Tiger (without overloading)",
+ " assert-desugar"
+ " desugar");
+
+ /// Remove syntactic sugar from the Ast.
+ TASK_DECLARE("desugar", "desugar the AST", desugar, "types-compute rename");
+
+ /* FIXME: Careful with this options (and with
+ --raw-bounds-checks-add), as they leave the AST in a bad state
+ (without bindings nor types). For instance,
+
+ tc --raw-desugar -H will probably result in a SEGV.
+
+ since hir-compute wants a type-checked AST. */
+
+ /// Remove syntactic sugar from the AST without recomputing
+ /// bindings nor types.
+ TASK_DECLARE("raw-desugar",
+ "desugar the AST without recomputing "
+ "bindings nor types",
+ raw_desugar,
+ "typed rename");
+
+ /*-----------------------.
+ | Array bounds checking. |
+ `-----------------------*/
+
+ /// Enable emission of dynamic array bounds checking code.
+ TASK_DECLARE("bounds-checks-add",
+ "add dynamic bounds checks",
+ bounds_checks_add,
+ "types-compute rename");
+
+ /// Enable emission of dynamic array bounds checking code without
+ /// recomputing bindings nor types.
+ TASK_DECLARE("raw-bounds-checks-add",
+ "add bounds-checking to the AST without recomputing "
+ "bindings nor types",
+ raw_bounds_checks_add,
+ "typed rename");
+
+} // namespace desugar::tasks