Commit 9dbd7b6c authored by Mael Cravero's avatar Mael Cravero
Browse files

tc_6: update for 2023 and tree rework

* source/compiler_stages/tc_6/code_to_write.rst,
* source/compiler_stages/tc_6/given_code.rst,
* source/compiler_stages/tc_6/goals.rst,
* source/compiler_stages/tc_6/tc_6.rst: here.
parent d1348ff0
......@@ -3,4 +3,17 @@
TC-6 Code to Write
------------------
Everything you need.
lib/misc/variant.hh
Complete the :code:`VariantTypes` concept.
src/canon/libcanon.cc
Generate traces for each :code:`ProcFrag`.
src/canon/canon.cc
Complete canonicalization helpers :code:`is_nop` and :code:`commute_p`.
src/canon/exp-matcher.cc and src/canon/stm-matcher.cc
Complete pattern-matching for canonicalization.
src/canon/traces.cc
Linearize the canonicalized IR.
......@@ -6,5 +6,5 @@ TC-6 Given Code
Some code is provided through the :code:`tc-base` repository, using tag
:substitution-code:`|class|-tc-base-6.0`.
For a description of the new module, see :ref:`src/canon`.
It includes most of the canonicalization.
For a description of the new module, see :ref:`src/canon`. It includes most of
the canonicalization.
......@@ -12,9 +12,19 @@ Term Rewriting System
<http://www.google.com/search?q=term+rewriting+system>`_.
"Functional" Programming in C++
A lot of |COMPILER|-6 is devoted to looking for specific nodes in
lists of nodes, and splitting, and splicing lists at these places. This
could be done by hand, with many hand-written iterations, or using
functors and STL algorithms. You are expected to do the latter,
and to discover things such as :code:`std::splice`, :code:`std::find_if`,
lambda functions, etc.
A lot of |COMPILER|-6 is devoted to looking for specific nodes in
lists of nodes, and splitting, and splicing lists at these places. This
could be done by hand, with many hand-written iterations, or using
functors and STL algorithms. You are expected to do the latter,
and to discover things such as :code:`std::splice`, :code:`std::find_if`,
lambda functions, etc.
C++ pattern-matching
A rather new idiom in the C++ landscape, pattern-matching is possible since
C++17 thanks to :code:`std::visit` which allows for dispatching on
:code:`std::variant` similar to other languages' pattern-matching.
Concepts
Another new addition to C++, **concepts** are part of the standard since C++20
and allow for compile-time checks on template instantiation, which allows for
safer generic code, with better error messages.
......@@ -5,16 +5,16 @@ TC-6, Translating to the Low Level Intermediate Representation
|class|-TC-6 is a part of the TC Back End option.
|class|-TC-6 submission is Saturday, May 22th |year| at 23:42.
|class|-TC-6 submission is Saturday, May 22nd |year| at 23:42.
This section has been updated for EPITA- |class| on 2016-01-27.
This section has been updated for EPITA-2023 on 2021-05-06.
At the end of this stage, the compiler produces low level intermediate
representation: LIR. LIR is a subset of the
HIR: some patterns are forbidden. This is why it is also
named *canonicalization*.
representation: LIR. LIR is a subset of the HIR: some patterns are forbidden.
This is why it is also named *canonicalization*.
Relevant lecture notes include :lectures:`07-intermediate.pdf`.
Relevant lecture notes include :lectures:`42-linearization.pdf` and
:lectures:`43-basic-blocks.pdf`.
.. **TC-6 Goals**: What this stage teaches
..
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment