Estimated hours taken: 2
Bootstrap the none.gc.debug grade using MSVC as the C compiler.
compiler/c_util.m:
Avoid a limitation in MSVC where string literals are not allowed
to be longer then 2048 chars.
Error C2026 is now avoided by instead of outputing a string as
"a very long string" chunk it up into "a very " "long string"
where each chunk is 512 characters long.
Redefine c_util__output_quoted_string to call
c_util__output_quoted_multi_string, so as to avoid some code
duplication.
compiler/llds_out.m:
The definitions of any types used in the module need to be
output before they are used, so output them first.
Estimated hours taken: 2
Add support for generation of builtins to the MLDS backend.
compiler/ml_code_gen.m:
Add support for generating builtins (mostly copied
from call_gen.m and code_util.m, but with a few
changes).
compiler/code_util.m:
Add a comment warning about the code duplication.
compiler/c_util.m:
compiler/llds_out.m:
compiler/mlds_to_c.m:
Move (most of) the code from llds_out__binary_op_to_string
into a new routine c_util__binary_infix_op/2, and change
llds_out.m and mlds_to_c.m to use it.
compiler/mlds_to_c.m:
(An unrelated change:)
Don't output any comments for "public" access,
since such comments end up being just noise.
Estimated hours taken: 30
A batch of changes related to the development of the new MLDS back-end.
compiler/notes/compiler_design.html:
Reorganize the documentation to reflect the multi-target /
multiple back-end nature of the compiler.
Document mlds.m and the new modules c_util.m and mlds_to_c.m.
compiler/mlds_to_c.m:
New module. This converts MLDS to C/C++ code.
This version compiles, but it is still quite incomplete;
there's lots of parts which are still not yet implemented.
compiler/llds_out.m:
compiler/c_util.m:
Move some procedures from llds_out.m into a new module c_util.m,
so that they can also be used by mlds_to_c.m.
compiler/mlds.m:
- Add new functions for use by mlds_to_c.m:
* get_prog_context/1, for getting the prog_context from an
mlds__context
* get_module_name/1, for getting the module name from the mlds
* module_name_to_sym_name/1, for converting an mlds_module_name
to a sym_name
- Change the mlds__func_signature type to
* allow multiple return values, for consistency with the
MLDS `return' statement;
* include the names of the parameters.
- Undo the premature over-optimization of making the `constness'
and `finality' flags share the same flag bit.