Estimated hours taken: 20
Fergus's recent change to the handling of some builtins broke the tracing
of those builtins. The following changes are a fix for this.
compiler/polymorphism.m:
Export the predicate that checks whether a predicate is a builtin
that lacks the usually necessary typeinfos.
Comment out a misleading and in any case not very useful progress
message.
compiler/liveness.m:
Turn off type_info liveness for builtins without typeinfos.
Since these builtins establish no gc points and shouldn't be
execution traced, this is OK.
Make type_info liveness part of live_info, since it can now be
incorrect to look up the value of the option. (This may yield
a speedup.)
compiler/live_vars.m:
compiler/store_alloc.m:
Pass the pred_id to initial_liveness to liveness.m can do the test.
compiler/passes_aux.m:
Add a new traversal type that passes along the pred_id.
compiler/mercury_compile.m:
Turn off execution tracing for the modules builtin.m and
private_builtin.m. The latter contains the interface predicates
for the builtins without typeinfos. Since the interface predicates
also lack the typeinfos, the compiler would get an internal abort
if we left execution tracing on.
In any case, these two modules contain stuff that users should
consider language builtins, which means they should not be execution
traced (they can still be stack traced in the right grade).
Use the new traversal type for the modules that now need the pred_id.
compiler/globals.m:
Allow the trace level to be set from outside, in this case
mercury_compile.m.
The next batch of changes have to do with adding a stack dump command
to the debugger. Since debugging is possible even in non-debug grades,
this in turn requires allowing stack tracing to work in non-debug grades,
on programs in which only some modules are compiled with execution
(and hence stack) tracing.
compiler/llds_out.m:
compiler/mercury_compile.m:
runtime/mercury_conf_param.h:
Llds_out used to output "#include <mercury_imp.h>" as the first
substantive thing in the generated C file. The set of #define
parameters in effect when mercury_imp.h is processed determines
whether the macros that optionally register stack layouts for label
actually do so or not. The values of these parameters are derived
from the grade, which means that with this setup it is not possible
for a non-debug grade program to register its stack layouts in the
label table.
The new version of llds_out looks up the option that says whether
this module is compiled with execution tracing or not, and if it is,
it generates a #define MR_STACK_TRACE_THIS_MODULE *before* the #include
of mercury_imp.h. This causes mercury_conf_param.h, included from
mercury_imp.h, to define the macros MR_USE_STACK_LAYOUTS and
and MR_INSERT_LABELS, which in turn cause stack layouts for labels
in this module to be generated and to be inserted into the label
table, *without* changing the grade string (this last part is why
we do not simply define MR_STACK_TRACE).
Use the same mechanism to #include mercury_trace.h when doing
execution tracing, since it is simpler than the mechanism we
used to use (mercury_compile.m including the #include in a list
of C header file fragments).
compiler/mercury_compile.m:
runtime/mercury_conf_param.h:
Split the MR_NEED_INITIALIZATION_CODE macro into two parts.
The first, MR_MAY_NEED_INITIALIZATION, now controls whether
initialization code makes it into the object file of a module.
The second, MR_NEED_INITIALIZATION_AT_START, determines whether
the initialization code is called before main/2.
When a module is compiled with execution tracing, the macro
MR_INSERT_LABELS turns on MR_MAY_NEED_INITIALIZATION but not
MR_NEED_INITIALIZATION_AT_START. The debugger will make sure
that the initialization code has been called before it tries
to do a stack dump (which needs the initialization code to have
been executed, because it needs labels to have been put into the label
table so that from a return address it can find the layout of the
proc to which it belongs).
Define MR_NEED_INITIALIZATION_AT_START if PROFILE_TIME is defined,
since if PROFILE_TIME is defined mercury_wrapper.c calls init_modules.
The fact that MR_NEED_INITIALIZATION_CODE didn't used to be defined
when PROFILE_TIME was defined was, I believe, a bug, which was
not detected because we do not turn on PROFILE_TIME without also
turning on PROFILE_CALLS.
runtime/mercury_stack_trace.[ch]:
Change the way stack dumps are done, to make it possible to
print stack dumps from the debugger and to use trivial run-length
encoding on the output (so that 100 consecutive calls to p
yield the line "p * 100", rather than 100 lines of "p").
The stack routine now returns an indication of whether the stack dump
was fully successful, and if not, a description of the reason why not.
This requires knowing when we have found the end of the stack dump,
so we provide a global variable, MR_stack_trace_bottom, which
mercury_wrapper.c will set to global_success, the address main/2
goes to on success.
s/multidet/multi/
runtime/mercury_wrapper.c:
Set MR_stack_trace_bottom to the address of globals_success.
Use MR_NEED_INITIALIZATION_AT_START to decide whether to call
do_init_modules.
runtime/mercury_stacks.h:
Provide variants of detstackvar(n) and framevar(n) that look up sp and
curfr in an array of saved regs, for use by the debugger.
runtime/mercury_trace_util.c:
Use the new variants of detstackvar(n) and framevar(n). This fixes
an old bug on SPARCs.
runtime/mercury_trace_internal.c:
Completely reorganize the way debugger commands are handled.
Centralize reading in command lines, and the breaking up of command
lines into words. The command names are the same as they were,
but command syntax is now much easier to change.
Add a new command "d" to dump as much of the stack as the available
information will allow.
runtime/mercury_goto.h:
Cosmetic changes to avoid the use of two different conditional
compilation layout styles.
util/mkinit.c:
Since we cannot know when we generate the _init.c file whether any
modules will be compiled with execution tracing and will thus need
stack tracing, we must now include in the generated _init.c file the
code to call the initialization functions in all the modules, even if
MR_NEED_INITIALIZATION_AT_START is not set, since init_modules
can be called later, from the debugger. (We should be able to
use the same approach with the accurate collector.)
Estimated hours taken: 20
Fergus's recent change to the handling of some builtins broke the tracing
of those builtins. The following changes are a fix for this.
compiler/polymorphism.m:
Export the predicate that checks whether a predicate is a builtin
that lacks the usually necessary typeinfos.
Comment out a misleading and in any case not very useful progress
message.
compiler/liveness.m:
Turn off type_info liveness for builtins without typeinfos.
Since these builtins establish no gc points and shouldn't be
execution traced, this is OK.
Make type_info liveness part of live_info, since it can now be
incorrect to look up the value of the option. (This may yield
a speedup.)
compiler/live_vars.m:
compiler/store_alloc.m:
Pass the pred_id to initial_liveness to liveness.m can do the test.
compiler/passes_aux.m:
Add a new traversal type that passes along the pred_id.
compiler/mercury_compile.m:
Turn off execution tracing for the modules builtin.m and
private_builtin.m. The latter contains the interface predicates
for the builtins without typeinfos. Since the interface predicates
also lack the typeinfos, the compiler would get an internal abort
if we left execution tracing on.
In any case, these two modules contain stuff that users should
consider language builtins, which means they should not be execution
traced (they can still be stack traced in the right grade).
Use the new traversal type for the modules that now need the pred_id.
compiler/globals.m:
Allow the trace level to be set from outside, in this case
mercury_compile.m.
The next batch of changes have to do with adding a stack dump command
to the debugger. Since debugging is possible even in non-debug grades,
this in turn requires allowing stack tracing to work in non-debug grades,
on programs in which only some modules are compiled with execution
(and hence stack) tracing.
compiler/llds_out.m:
compiler/mercury_compile.m:
runtime/mercury_conf_param.h:
Llds_out used to output "#include <mercury_imp.h>" as the first
substantive thing in the generated C file. The set of #define
parameters in effect when mercury_imp.h is processed determines
whether the macros that optionally register stack layouts for label
actually do so or not. The values of these parameters are derived
from the grade, which means that with this setup it is not possible
for a non-debug grade program to register its stack layouts in the
label table.
The new version of llds_out looks up the option that says whether
this module is compiled with execution tracing or not, and if it is,
it generates a #define MR_STACK_TRACE_THIS_MODULE *before* the #include
of mercury_imp.h. This causes mercury_conf_param.h, included from
mercury_imp.h, to define the macros MR_USE_STACK_LAYOUTS and
and MR_INSERT_LABELS, which in turn cause stack layouts for labels
in this module to be generated and to be inserted into the label
table, *without* changing the grade string (this last part is why
we do not simply define MR_STACK_TRACE).
Use the same mechanism to #include mercury_trace.h when doing
execution tracing, since it is simpler than the mechanism we
used to use (mercury_compile.m including the #include in a list
of C header file fragments).
compiler/mercury_compile.m:
runtime/mercury_conf_param.h:
Split the MR_NEED_INITIALIZATION_CODE macro into two parts.
The first, MR_MAY_NEED_INITIALIZATION, now controls whether
initialization code makes it into the object file of a module.
The second, MR_NEED_INITIALIZATION_AT_START, determines whether
the initialization code is called before main/2.
When a module is compiled with execution tracing, the macro
MR_INSERT_LABELS turns on MR_MAY_NEED_INITIALIZATION but not
MR_NEED_INITIALIZATION_AT_START. The debugger will make sure
that the initialization code has been called before it tries
to do a stack dump (which needs the initialization code to have
been executed, because it needs labels to have been put into the label
table so that from a return address it can find the layout of the
proc to which it belongs).
Define MR_NEED_INITIALIZATION_AT_START if PROFILE_TIME is defined,
since if PROFILE_TIME is defined mercury_wrapper.c calls init_modules.
The fact that MR_NEED_INITIALIZATION_CODE didn't used to be defined
when PROFILE_TIME was defined was, I believe, a bug, which was
not detected because we do not turn on PROFILE_TIME without also
turning on PROFILE_CALLS.
runtime/mercury_stack_trace.[ch]:
Change the way stack dumps are done, to make it possible to
print stack dumps from the debugger and to use trivial run-length
encoding on the output (so that 100 consecutive calls to p
yield the line "p * 100", rather than 100 lines of "p").
The stack routine now returns an indication of whether the stack dump
was fully successful, and if not, a description of the reason why not.
This requires knowing when we have found the end of the stack dump,
so we provide a global variable, MR_stack_trace_bottom, which
mercury_wrapper.c will set to global_success, the address main/2
goes to on success.
s/multidet/multi/
runtime/mercury_wrapper.c:
Set MR_stack_trace_bottom to the address of globals_success.
Use MR_NEED_INITIALIZATION_AT_START to decide whether to call
do_init_modules.
runtime/mercury_stacks.h:
Provide variants of detstackvar(n) and framevar(n) that look up sp and
curfr in an array of saved regs, for use by the debugger.
runtime/mercury_trace_util.c:
Use the new variants of detstackvar(n) and framevar(n). This fixes
an old bug on SPARCs.
runtime/mercury_trace_internal.c:
Completely reorganize the way debugger commands are handled.
Centralize reading in command lines, and the breaking up of command
lines into words. The command names are the same as they were,
but command syntax is now much easier to change.
Add a new command "d" to dump as much of the stack as the available
information will allow.
runtime/mercury_goto.h:
Cosmetic changes to avoid the use of two different conditional
compilation layout styles.
util/mkinit.c:
Since we cannot know when we generate the _init.c file whether any
modules will be compiled with execution tracing and will thus need
stack tracing, we must now include in the generated _init.c file the
code to call the initialization functions in all the modules, even if
MR_NEED_INITIALIZATION_AT_START is not set, since init_modules
can be called later, from the debugger. (We should be able to
use the same approach with the accurate collector.)
Estimated hours taken: 3
Disable the often erroneous "optimisation" in check_typeclass.m whereby we
skipped the level of indirection for instance methods if there was an exact
match for the types, modes and determinisms of the instance method.
Consequently rip out lots of useless stuff from check_typeclass.m.
Also, for methods which are functions, introduce unifications for the body
rather than calls.
Also improve a couple of error messages slightly.
compiler/check_typeclass.m:
Disable the "optimisation".
Estimated hours taken: 0.25
extras/trailed_update/Mmakefile:
Add rules for `mmake clean' and `mmake realclean'
which invoke the respective targets in the subdirectories.
This should hopefully avoid some failures in the
trailed_update/tests subdirectory caught by the nightly test
script that were due to trying to rebuild in a different grade
without having done `mmake clean' in that subdirectory.
Estimated hours taken: 0.25
tests/invalid/Mmakefile:
Allow tests to pass if the output matches either the .err_exp
file or the .err_exp2 file (if any).
tests/invalid/missing_interface_import.err_exp2:
Add an alternative expected output for this test case,
since the output is different depending on whether
or not it gets compiled with --use-subdirs.
Estimated hours taken: 0.5
compiler/mercury_compile.m:
Fix an error in my previous change that I accidentally
introduced while merging in stayl's changes.
Estimated hours taken: 2
Improve the modularity of the code in purity.m by splitting it into two
modules and fix a purity-related bug by moving some code from typecheck.m
into the new module.
compiler/post_typecheck.m:
New module. Handles the typechecking stuff that happens
after typecheck.m.
compiler/purity.m:
Move the typechecking related code in purity.m into post_typecheck.m.
compiler/typecheck.m:
Move the code for copying clauses to the proc_infos, etc. into
new predicates in post_typecheck.m. This code is now called
from purity.m rather than from typecheck.m.
(I think the fact that it was being done in typecheck.m was a
bug -- it meant that the goal_info flags computed by purity.m
were not being copied across to the proc_infos.)
compiler/mercury_compile.m:
compiler/typecheck.m:
Don't pass the ModeError parameter down to typecheck_pred,
since with the above change it isn't needed anymore.
compiler/mercury_compile.m:
Run purity checking before writing the `.opt' files.
This is necessary because writing out the `.opt' files
requires that code in post_typecheck__finish_pred
(formerly in typecheck.m) has been run.
compiler/notes/compiler_design.html:
Document these changes.
Estimated hours taken: 0.25
doc/user/guide.texi
Document that -I options may need to be added to MGNUCFLAGS if
inter-module optimization is being used on a library which
uses the C interface.
Estimated hours taken: 0.1
tools/test_mercury
Back out the addition of --intermod-unused-args to the
optimization flags on murlibobo until the installed compiler
contains the bug fixes I committed yesterday.
Estimated hours taken: 3
Another --use-subdirs bug fix when using sicstus.
scripts/msl.in:
Detect the special case file 'sp_lib.ql' even when the file name has
leading directory info.
Also update the copyright notice.
Estimated hours taken: 12
Bug fixes.
tests/term/arit_exp.m still fails with --intermodule-optimization
due to a slightly different (but correct) trans_opt file being produced.
compiler/simplify.m
Don't produce singleton disjunctions, since the code generator
barfs on them. Use a `some' instead.
Test case: tests/general/partition.m compiled with --deforestation.
compiler/unused_args.m
Deconstructions where the arguments included `any' insts were
not being handled correctly, due to inst_matches_binding
failing for any->any.
Test case: extras/trailed_update/samples/vqueens.m at -O3.
Don't warn about predicates from `.opt' files having unused
arguments, because in most cases the warning will be generated
when compiling the imported module.
compiler/higher_order.m
Fix a bug that caused compiler/modules.m to be miscompiled at
-O3 --intermodule-optimization, due to curried arguments for
multiple known higher-order arguments being passed to a
specialised version in the wrong order.
Test case: tests/hard_coded/ho_order2.m
compiler/mercury_compile.m
Call intermod__update_pred_import_status when compiling to
C at the same stage of the compilation as the `.opt' file
was written to ensure that the same information is being used.
Test case: tests/hard_coded/rational_test.m compiled with
--intermodule-optimization failed because of a link error.
Make sure polymorphism has been run before doing unused argument
checking with --errorcheck-only. Otherwise the argument indices
read in from `.opt' files are incorrect.
compiler/intermod.m
Use code_util__compiler_generated to test if a called predicate
is compiler generated, rather than looking for a call_unify_context
(function calls have a call_unify_context).
Add a progress message for updating the import status of predicates
exported to `.opt' files.
Fix a bug where the unused_args pragmas read in from the current
module's `.opt' file were given an import_status of `imported' rather
than `opt_imported' resulting in an error message from make_hlds.m.
compiler/dead_proc_elim.m
Ensure that predicates used by instance declarations and
`:- pragma export's are not eliminated by the dead_pred_elim
pass before typechecking.
Test case: most of the typeclass tests compiled with
--intermodule-optimization.
compiler/hlds_goal.m
Remove obsolete comments about the modes of a higher-order
unification being incorrect after polymorphism, since that
was fixed months ago.
compiler/options.m
Reenable deforestation.
Enable --intermodule-optimization and --intermod-unused-args
at -O5 so they get tested occasionally.
compiler/handle_options.m
Disable deforestation if --typeinfo-liveness is set, since
there are bugs in the folding code if extra typeinfos are
added to a new predicate's arguments by hlds_pred__define_new_pred.
Disable higher_order.m if --typeinfo-liveness is set, since
higher_order.m currently does not pass all necessary typeinfos
to specialised versions or update the typeinfo_varmap of
specialised versions.
Test case: tests/valid/agc_ho_pred.m
tests/hard_coded/ho_order2.m
tests/hard_coded/ho_order2.exp
Test case for higher_order.m.
tools/test_mercury
Added --intermod-unused-args to the options for murlibobo.
extras/trailed_update/{samples,tests}/Mmakefile
Add "-I.." to MGNUCFLAGS so gcc can find unsafe.h which
is #included in c_header_code read from unsafe.opt.
Estimated hours taken: 4
Cleanup deep copy.
runtime/mercury_deep_copy.c:
Use MR_categorize_data, and switch on the result.
This makes the control flow much simpler -- each case only needs
to worry about copying the data.
We can also use fallthru to exploit duplicated code.
Remove get_base_type_layout_entry, it isn't very useful.
runtime/mercury_type_info.c:
runtime/mercury_type_info.h:
Define MR_categorize_data and the enum MR_DataRepresentation.
MR_categorize_data can be used by any function that needs to
manipulate data.
Estimated hours taken: 4
Cleanup deep copy.
runtime/mercury_deep_copy.c:
Use MR_categorize_data, and switch on the result.
This makes the control flow much simpler -- each case only needs
to worry about copying the data.
We can also use fallthru to exploit duplicated code.
Remove get_base_type_layout_entry, it isn't very useful.
runtime/mercury_type_info.c:
runtime/mercury_type_info.h:
Define MR_categorize_data and the enum MR_DataRepresentation.
MR_categorize_data can be used by any function that needs to
manipulate data.
Estimated hours taken: 4.5
Fix some bugs in code generation for nondet disjunctions and
if-then-elses. The compiler was incorrectly releasing the temp stack
slots used to save the heap pointer and trail pointer at the start
of the else or the last clauses, thus allowing them to be reused not
only in the else case or the last clause, but also by goals following the
disjunction or if-then-else, even though the values in these slots might
be needed again on backtracking into the condition or the earlier
disjunctions.
Thanks to Warwick Harvey for reporting this bug.
compiler/code_info.m:
Add new predicate `code_info__maybe_reset_and_pop_ticket',
which is like `code_info__maybe_reset_and_discard_ticket',
except that it does not release the temp stack slot.
compiler/disj_gen.m:
compiler/ite_gen.m:
When generating code for nondet goals that save
and restore the hp and trail, if the saved
values might be needed again on backtracking
into the current goal from one that follows
(i.e. in nondet disjunctions and in if-then-elses
with nondet conditions), make sure we use
`code_info__maybe_reset_and_pop_ticket' and
`code_info__reset_hp' instead of
`code_info__maybe_reset_and_discard_ticket' and
`code_info__reset_and_discard_hp'.
compiler/code_info.m:
Include the temp_avail_slots in the set of things
that slap_code_info does not update. Temp slots
that were acquired (and not released) in one branch
of a branched goal need to be still reserved at the
end of the branched goal.
extras/trailed_update/Mmakefile:
extras/trailed_update/samples/Mmakefile:
extras/trailed_update/samples/tests.m:
extras/trailed_update/samples/tests.exp:
extras/trailed_update/tests/Mmakefile:
extras/trailed_update/tests/var_test.m:
extras/trailed_update/tests/var_test.exp:
Add a new subdirectory `tests' in extras/trailed_update,
and move the test case `tests.{m,exp}' from the samples
subdirectory into the tests subdirectory, at the same
time renaming it as `var_test.{m,exp}'.
extras/trailed_update/tests/Mmakefile:
extras/trailed_update/tests/func_trail_test.m:
extras/trailed_update/tests/func_trail_test.exp:
extras/trailed_update/tests/func_trail_test_2.m:
extras/trailed_update/tests/func_trail_test_2.exp:
Add a couple of regression tests for the bug mentioned above.
These tests need to go here rather than somewhere in the
main `tests' directory (e.g. `tests/hard_coded'), because
they only work in trailing grades, and the normal tests are
compiled in lots of grades, many of which don't have
corresponding trailing grades installed.
(I suppose we could put them in the main `tests' directory,
and only enable them for trailing grades, but it just seemed
easier to put them here.)
Estimated hours taken: 0.1
Allow prolog version of the compiler to be built.
library/string.nu.nl:
Add missing definition of string__from_rev_char_list
Estimated hours taken: 0.1
Mmakefile:
Add a missing $(deps_subdir) before a reference to library.dep,
so that it works with --use-subdirs.
It already had the $(dep_subdir) in front of all the
references to compiler.dep and profiler.dep, I had just
accidentally missed on occurrence for library.dep.
Estimated hours taken: 0.25
tools/bootcheck:
Pass the value of the --use-subdirs option down to
subprocesses via the MMAKE_USE_SUBDIRS environment variable.
This ensures that `tools/bootcheck --use-subdirs' actually
uses `--use-subdirs' when building the stage2 and stage3
compilers and when running the test suite.
Estimated hours taken: 0.1
library/Mmakefile:
Delete a stray tab that caused problems with older versions
of GNU Make. (Thanks to Warwick Harvey for reporting this bug.)
Estimated hours taken: 0.1
library/math.m:
Fix a cut-and-paste bug reported by Dan Hazel
<d.hazel@mailbox.uq.edu.au>: Mercury's acos/1 was
calling C's asin() instead of acos().
Estimated hours taken: 1
Remove the libc6 detection routines. It appears the new upstream version
of Boehm GC handles this correctly now.
README.Linux:
Remove mention of the problem - it shouldn't happen anymore.
configure.in:
Remove the old mercury_boehm_gc
boehm_gc/os_dep.c:
Use the upstream method for checking for libc version using
__GLIBC__.
boehm_gc/mercury_boehm_gc_conf.h.in:
Remove this file, it is no longer necessary.
Estimated hours taken: 1
Remove the libc6 detection routines. It appears the new upstream version
of Boehm GC handles this correctly now.
README.Linux:
Remove mention of the problem - it shouldn't happen anymore.
configure.in:
Remove the old mercury_boehm_gc
boehm_gc/os_dep.c:
Use the upstream method for checking for libc version using
__GLIBC__.
boehm_gc/mercury_boehm_gc_conf.h.in:
Remove this file, it is no longer necessary.
Estimated hours taken: 0.25
tests/benchmarks/poly.mprof-exp:
Update the expected profile output to reflect the split of
mercury_builtin.m into builtin.m and private_builtin.m.
Estimated hours taken: 3
Allow a predicate to have matching `cc' and `non-cc' modes.
compiler/det_analysis.m:
If there is a call to a cc procedure in a non-cc context,
then search for a mode of that predicate which is
identical to the called mode except that it is not cc.
If such a mode is found, use it, rather than reporting
an error.
compiler/modecheck_call.m:
Add predicate modes_are_identical_bar_cc, for use by
det_analysis.m.
NEWS:
LIMITATIONS:
doc/reference_manual.texi:
Document the new feature and delete documentation about the
lack of this feature.
tests/hard_coded/Mmakefile:
tests/hard_coded/cc_and_non_cc_test.m:
tests/hard_coded/cc_and_non_cc_test.exp:
Add a test case for the new feature.
Estimated hours taken: 1
Fix a bug which caused link errors in some grades for some test cases
where the module name wasn't the same as the file name, and which
probably would have caused runtime errors in some grades for test
cases using nested modules.
compiler/modules.m:
Call $(C2INIT) with $(foo.cs) instead of $(foo.ms).
This is necessary now that a single .m file can get compiled
to multiple .c files, if it contains nested modules,
or to a .c file whose name reflects the module name rather
than the source file name.
util/mkinit.c:
scripts/c2init.in:
For efficiency, change c2init and mkinit so that when c2init's
arguments are `.c' files, it computes the init function based
on the filename (like it used to do with `.m' files), rather
than by reading the file contents and searching for "** INIT"
comments. Add a new option `-x' (`--extra-inits') which keeps
the old behaviour.
compiler/modules.m:
scripts/Mmake.rules:
Instead of deleting the `_init.c' file every time we recreate
the `.dep' file, just tell make that the `_init.c' file depends on
the `.dep' file, so that make will remake it if the `.dep' file
changes. (I don't know why I didn't do it that way in the
first place.)
Estimated hours taken: 0.1
compiler/prog_io.m:
Avoid spurious warning messages about source file
`bar.m' containing module `foo:bar' -- this case
is supported, and should not trigger a warning.
Estimated hours taken: 0.25
Use sub-modules to package up the modules in extras/complex_numbers
into a single module.
extras/complex_numbers/complex_numbers.m:
I forgot to `cvs add' this file before committing my last change.
extras/complex_numbers/samples/fft.m:
I forgot to change the `import_module' declaration here
to import `complex_numbers:complex' instead of `complex'.
Estimated hours taken: 1
compiler/modules.m:
Put library files and `.init' files in the current directory,
rather than in Mercury/libs and Mercury/inits subdirectories,
even if `--use-subdirs' is enabled.
Without this change, the instructions on "Using libraries"
in the Mercury user's guide did not work in conjunction with
`--use-subdirs', and they, as well as a lot of Mmakefiles that
were defined based on them, would need to be changed.
Estimated hours taken: 0.75
Use sub-modules to package up the modules in extras/complex_numbers
into a single module.
extras/complex_numbers/complex_lib.m:
extras/complex_numbers/complex_numbers.m:
Rename complex_lib.m as complex_numbers.m,
and modify it to use sub-modules.
extras/complex_numbers/*.m:
extras/complex_numbers/tests/complex_test.m:
extras/complex_numbers/samples/fft.m:
Add `complex_numbers:' to all of the `:- module'
and `:- import_module' declarations.
extras/complex_numbers/Mmakefile:
extras/complex_numbers/tests/Mmakefile:
extras/complex_numbers/samples/Mmakefile:
Modify to reflect the renaming from `complex_lib' to
`complex_numbers'.
Estimated hours taken: 10
Allow modules to be put in source files whose names do not directly match
their the module names. When looking for the source for a module such
as `foo:bar:baz', search for it first in `foo.bar.baz.m', then in `bar.baz.m',
and finally in `baz.m'.
compiler/prog_io.m:
Change prog_io__read_module so that it returns the name of
the module read, as determined by the `:- module' declaration.
Add predicate `check_module_has_expected_name', for checking
that this name matches what was expected.
compiler/modules.m:
Add read_mod_from_file, for reading a module given the file name,
and generated_file_dependencies, for generating the dependencies
of a module given the file name. (As opposed to the module name.)
Change read_mod and read_mod_ignore_errors so that they
search for `.m' files as described above, and return the name
of the source file read.
Also improve the efficiency of read_dependencies slightly:
when reading in `.int' files, there's no need to call
split_into_submodules, because we generate a seperate
`.int' file for each submodule anyway.
compiler/mercury_compile.m:
Change the handling of command-line arguments.
Arguments ending with `.m' are assumed to be file names,
and other arguments are assumed to be module names.
For file names, call read_mod_from_file instead of read_mod.
compiler/handle_options.m:
Change help message to reflect the above change to the semantics
of command-line arguments.
compiler/intermod.m:
compiler/trans_opt.m:
Fix a bug: call prog_io__read_opt_file instead of prog_io__read_module.
doc/user_guide.texi:
Document the above change to the semantics of command-line arguments.
Update the "libraries" chapter to reflect our support for nested
modules.
tests/*/*.m:
tests/*/*.exp:
Fix a few incorrect module names in `:- module' declarations.
Estimated hours taken: 12
Allow modules to be put in source files whose names do not directly match
their the module names. When looking for the source for a module such
as `foo:bar:baz', search for it first in `foo.bar.baz.m', then in `bar.baz.m',
and finally in `baz.m'.
compiler/prog_io.m:
Change prog_io__read_module so that it returns the name of
the module read, as determined by the `:- module' declaration.
Add predicate `check_module_has_expected_name', for checking
that this name matches what was expected.
compiler/modules.m:
Add read_mod_from_file, for reading a module given the file name,
and generated_file_dependencies, for generating the dependencies
of a module given the file name. (As opposed to the module name.)
Change read_mod and read_mod_ignore_errors so that they
search for `.m' files as described above, and return the name
of the source file read.
Also improve the efficiency of read_dependencies slightly:
when reading in `.int' files, there's no need to call
split_into_submodules, because we generate a seperate
`.int' file for each submodule anyway.
compiler/mercury_compile.m:
Change the handling of command-line arguments.
Arguments ending with `.m' are assumed to be file names,
and other arguments are assumed to be module names.
For file names, call read_mod_from_file instead of read_mod.
compiler/handle_options.m:
Change help message to reflect the above change to the semantics
of command-line arguments.
compiler/intermod.m:
compiler/trans_opt.m:
Fix a bug: call prog_io__read_opt_file instead of prog_io__read_module.
doc/user_guide.texi:
Document the above change to the semantics of command-line arguments.
Update the "libraries" chapter to reflect our support for nested
modules.
tests/*/*.m:
tests/*/*.exp:
Fix a few incorrect module names in `:- module' declarations.
Estimated hours taken: 0.25
scripts/Mmake.rules:
Update the GNU make bug work-around so that it creates the `date3s'
directory as well as the other `*date*' directories when doing
`mmake depend'. Previously, the *.int3 files never depended on
anything else (they were always the first thing created), so this
wasn't necessary. However, with nested modules, the `.int3'
files for sub-modules depends on the `.int3' file for the parent
module, so we now need to create the `date3s' directory too.