Estimated hours taken: 2
Branches: main
compiler/*.m:
Import only one compiler module per line. Sort the blocks of imports.
This makes it easier to merge in changes.
In a couple of places, remove unnecessary imports.
The main aim of this change is to make the overall, high-level structure
of the compiler clearer, and to encourage better encapsulation of the
major components.
compiler/libs.m:
compiler/backend_libs.m:
compiler/parse_tree.m:
compiler/hlds.m:
compiler/check_hlds.m:
compiler/transform_hlds.m:
compiler/bytecode_backend.m:
compiler/aditi_backend.m:
compiler/ml_backend.m:
compiler/ll_backend.m:
compiler/top_level.m:
New files. One module for each of the major components of the
Mercury compiler. These modules contain (as separate sub-modules)
all the other modules in the Mercury compiler, except gcc.m and
mlds_to_gcc.m.
Mmakefile:
compiler/Mmakefile:
Handle the fact that the top-level module is now `top_level',
not `mercury_compile' (since `mercury_compile' is a sub-module
of `top_level').
compiler/Mmakefile:
Update settings of *FLAGS-<modulename> to use the appropriate
nested module names.
compiler/recompilation_check.m:
compiler/recompilation_version.m:
compiler/recompilation_usage.m:
compiler/recompilation.check.m:
compiler/recompilation.version.m:
compiler/recompilation.version.m:
Convert the `recompilation_*' modules into sub-modules of the
`recompilation' module.
compiler/*.m:
compiler/*.pp:
Module-qualify the module names in `:- module', `:- import_module',
and `:- use_module' declarations.
compiler/base_type_info.m:
compiler/base_type_layout.m:
Deleted these unused empty modules.
compiler/prog_data.m:
compiler/globals.m:
Move the `foreign_language' type from prog_data to globals.
compiler/mlds.m:
compiler/ml_util.m:
compiler/mlds_to_il.m:
Import `globals', for `foreign_language'.
Mmake.common.in:
trace/Mmakefile:
runtime/Mmakefile:
Rename the %.check.c targets as %.check_hdr.c,
to avoid conflicts with compiler/recompilation.check.c.
Estimated hours taken: 2
Branches: main
mlds_to_il.m:
Wrap an exception handler around main. This avoids those annoying
pop up windows, and hence allows people to use windows machines via
ssh.
tree.m:
Add the higher order function map.
Estimated hours taken: 0.3
compiler/tree.m:
Add a functional version of tree__flatten.
Add tree__list, which creates trees from lists of trees.
(using list syntax is much more readable than creating lots of
branching trees).
Estimated hours taken: 0.5
Most of the uses of the type `tree:tree/1' are lists of instructions.
`tree__is_empty' is used to ask "was any code generated", but
`tree__is_empty' fails for `node([])'. This has not been a problem
in the past because the code generator builds up a trees of lists that
are known to be non-empty. Parts of the RL generation code can create
empty lists of instructions, and it can't hurt to test for this
case elsewhere.
compiler/tree.m:
Added `tree__tree_of_lists_is_empty', which is similar to
`tree__is_empty' except that `node([])' is also considered empty.
compiler/lookup_switch.m:
compiler/rl_gen.m:
Use `tree__tree_of_lists_is_empty' instead of `tree__is_empty'.
Estimated hours taken: 0.75
library/*.m:
compiler/*.m:
Undo Zoltan's bogus update of all the copyright dates.
The dates in the copyright header should reflect the years
in which the file was modified (and no, changes to the
copyright header itself don't count as modifications).
Estimated hours taken: 5
Remove support for term_to_type and type_to_term implemented as special
preds. Remove support for one-cell and one-or-two-cell type_infos (now
shared-one-or-two-cell type_infos). Move definitions that were in
mercury_builtin.m back to where they belong.
This code has been removed because it is no longer used, and was no
longer being maintained but was still quite complex.
compiler/globals.m:
compiler/handle_options.m:
compiler/mercury_compile.m:
compiler/options.m:
Remove one_cell and one_or_two_cell from type_info methods.
compiler/polymorphism.m:
Remove term_to_type and type_to_term support.
Remove one_cell and one_or_two_cell from type_info methods.
Fix documentation to reflect the new situation.
compiler/special_pred.m:
compiler/unify_proc.m:
Remove term_to_type and type_to_term support.
library/list.m:
Put the definition of `list' back into list.m
library/mercury_builtin.m:
Take the definitions of `list', `term', `var', `var__supply',
etc, out of this module.
Remove type_to_term, term_to_type, det_term_to_type,
term__init_var_supply, term__create_var, term__var_to_int
and term__context_init.
Remove references to USE_TYPE_TO_TERM and #ifdefs around
SHARED_ONE_OR_TWO_CELL_TYPE_INFO.
library/std_util.m:
Remove references ONE_OR_TWO_CELL_TYPE_INFO, and code that
handles one-cell typeinfo comparisons.
library/term.m:
Add type_to_term, term_to_type, det_term_to_type,
term__init_var_supply, term__create_var, term__var_to_int
and term__context_init back to term.m.
Add new implementation of type_to_term/2.
library/uniq_array.m:
Fix a typo in a comment - term_to_type/3 instead of term_to_type/2.
runtime/call.mod:
Remove special case code for unify, compare, index for
one-cell typeinfos.
Remove code for type_to_term/2.
runtime/type_info.h:
Remove references to ONE_CELL_TYPE_INFO or ONE_OR_TWO_CELL_TYPE_INFO.
Make sure only SHARED_ONE_OR_TWO_CELL_TYPE_INFO.
Remove references to USE_TYPE_TO_TERM.
compiler/base_type_layout.m:
compiler/bytecode_gen.m:
compiler/code_util.m:
compiler/delay_slot.m:
compiler/det_util.m:
compiler/fact_table.m:
compiler/hlds_data.m:
compiler/hlds_goal.m:
compiler/mode_debug.m:
compiler/tree.m:
library/bag.m:
library/queue.m:
Import module `list' or `term' (or both).
Estimated hours taken: 0.25
disj_gen:
Remove redundant code.
liveness:
Trap some unreachable code.
lookup_switch, tree:
Move the code for testing code trees for emptyness to tree.m.
compiler/*:
Add copyright messages.
Change all occurences of *.nl in comments to *.m.
compiler/mercury_compile.pp:
Change the output to the .dep files to use *.m rather than *.nl.
(NOTE: this means that `mmake' will not work any more if you
call your files *.nl!!!)
Lots of bug fixes for make_hlds.nl.
A couple of bug fixes for hlds.nl.
Did some optimization of memory usage: added io__gc_call to io.nl
and used it in prog_io.nl and module.nl. Rewrote the main loop
of prog_io to take maximum advantage of manual garbage collection.
Started working on typecheck.nl.