Estimated hours taken: 0.25
Address juliensf's review comments on my recent change to add an MLDS
optimization to convert assignments into initializers.
compiler/ml_optimize.m:
doc/user_guide.texi:
Fix some typos.
compiler/options.m:
Wrap some long lines.
Estimated hours taken: 1
library/string.m:
Avoid the use of `long double', because this causes problems
with lcc on Linux, since lcc does not use the same
representation for `long double' as gcc and glibc.
(lcc treats `long double' as 8 bytes, the same as `double',
whereas `gcc' has a 12-byte `long double'.)
The code here was using `long double' just in case `MR_Float'
was `long double', but currently `MR_Float' is only ever
`double' or `float', not `long double', so that isn't needed.
This is a bug in lcc on Linux (lcc is not a conforming hosted
C implementation), but we may as well work around it.
Estimated hours taken: 2
Fix a long-standing problem which caused occaisional failures
when running the nightly tests on hydra, due to problems with
dyn_load.o / gc.a caused by the use of parallel make (-j2)
on hydra.
boehm_gc/Makefile:
Document that this Makefile is not safe for parallel makes
(and why).
boehm_gc/Mmakefile:
Pass `-j1' to make, so that we don't use parallel make.
Estimated hours taken: 0.5
scripts/init_grade_options.sh-subr:
scripts/parse_grade_options.sh-subr:
Fix some more bugs in the handling of `DEFAULT_GRADE' and the
`-s<grade>' option. Obviously this code had never been exercised.
Estimated hours taken: 0.25
compiler/mercury_compile.m:
Reorder some code to encourage better GC behaviour: move a
reference to `Module' (the parse tree) so that it doesn't
remain live after we have built the HLDS.
Estimated hours taken: 0.25
scripts/init_grade_options.sh-subr:
Fix a cut-and-paste error: change the second "case 0)" to "case *)".
This broke the default grade setting.
Estimated hours taken: 0.5
Mmake.common.in:
Turn off ERROR_UNDEFINED for .gc.par grades, since
(a) currently we get link errors when building the Mercury
shared libraries in those grades, because the thread-safe
version of the Boehm GC needs to be linked with some
fairly system-specific libraries
(b) it's easier and safer to just turn it off here than to
try to explicitly link with all the necessary libraries
in that case.
Estimated hours taken: 0.5
tools/test_mercury:
Fix a problem with the install on roy, where it was not
installing asm_fast.gc and not setting DEFAULT_GRADE.
Fixing a couple of bugs in the `rm' commands. Also add back
all the `rm' commands that I had previously commented out for
safety.
Estimated hours taken: 1
Change the units for the size field in MLDS new_object
statements from bytes to words.
compiler/mlds.m:
Update the documentation for the size field.
compiler/ml_unify_gen.m:
Generate the sizes in words rather than bytes.
Delete the ml_sizeof_word_lval function, since it's
no longer used.
compiler/mlds_to_c.m:
Multiply the size passed to MR_new_object() by
`sizeof(MR_Word)' to convert from words to bytes.
compiler/mlds_to_gcc.m:
compiler/mlds_to_il.m:
Simplify the code by deleting hacks needed to
convert the size from bytes to words.
runtime/mercury.h:
Document that the definition of SIZEOF_WORD should
not be needed any longer, except for bootstraping.
Estimated hours taken: 0.25
compiler/mercury_compile.m:
Back out stayl's recent change, since it broke the compiler.
(In particular `mmake install' was dying.)
Estimated hours taken: 10
Added a new module, hash_table.m, implementing an efficient open
hash table ADT.
library/hash_table.m:
Added.
library/library.m:
Added reference to the new library module.
compiler/modules.m:
Added reference to the new library module.
NEWS:
Mentioned the new addition in the NEWS file.
Estimated hours taken: 0.5
samples/tests/*/runtests:
Specify the full pathname when source'ing Mmake.thisdir, since
the current directory is not always searched.
Estimated hours taken: 3
Fix bugs in `:- pragma import' and `:- pragma export' with
inter-module optimizaton reported by Peter Ross (bug #131069).
compiler/mercury_to_mercury.m:
The code to output `:- pragma import' declarations was
writing `:- pragma import(p(Arg1::in, Arg2::out), "imported")'.
The correct output is `:- pragma import(p(in, out), "imported")'.
compiler/mercury_compile.m:
For modules containing `:- pragma export' declarations, add
":- pragma c_header_code("#include ModuleName.h")." to
the `.opt' file so the C compiler can find the function
prototypes for Mercury predicates exported to C when
compiling the C code in the `.opt' file.
Write the `.h' file for a module when writing the `.opt' file
when using the LLDS backend to avoid trying to use the `.h' file
before it has been created.
tests/valid/Mmakefile:
tests/valid/intermod_pragma_import.m:
tests/valid/intermod_pragma_import2.m:
Test case.
===================================================================
RCS file: /home/mercury1/repository/mercury/library/bitmap.m,v
retrieving revision 1.1
diff -u -r1.1 bitmap.m
--- bitmap.m 2001/02/07 17:31:03 1.1
+++ bitmap.m 2001/02/08 17:15:29
@@ -98,7 +98,15 @@
%
:- func get(bitmap, int) = bool.
:- mode get(bitmap_ui, in) = out is det.
+:- mode get(in, in) = out is det.
+ % Unsafe versions of the above: if the index is out of range
+ % then behaviour is undefined and bad things are likely to happen.
+ %
+:- func unsafe_get(bitmap, int) = bool.
+:- mode unsafe_get(bitmap_ui, in) = out is det.
+:- mode unsafe_get(in, in) = out is det.
+
% Create a new copy of a bitmap.
%
:- func copy(bitmap) = bitmap.
@@ -269,6 +277,10 @@
% ---------------------------------------------------------------------------- %
get(BM, I) = ( if is_clear(BM, I) then no else yes ).
+
+%------------------------------------------------------------------------------%
+
+unsafe_get(BM, I) = ( if unsafe_is_clear(BM, I) then no else yes ).
% ---------------------------------------------------------------------------- %
Estimated hours taken: 4
Added sorting, fold and permutation functions/predicates to array.m.
library/array.m:
Added funcs sort/1, foldl/3, foldr/3.
Added pred permutation/4.
NEWS:
Recorded above in changes to library section.
Estimated hours taken: 0.5
configure.in:
For Linux, when using `--no-undefined', test to see whether
the linker supports it. This is needed because it turns out
that this option is a quite recent addition to GNU ld.
Estimated hours taken: 0.5
configure.in:
For sparc-sun-solaris2.*, use `gcc -shared -mimpure-text'
rather than `gcc -G', since the latter doesn't work with
ERROR_UNDEFINED (`-Wl,-z,defs').
Estimated hours taken: 0.25
tests/invalid/cyclic_typeclass.m:
Add a new test case. This one tests the use of cyclic
inheritence relationships between type classes.
tests/invalid/Mmakefile:
Document that we do not yet pass the new test.
Estimated hours taken: 1.5
Add an MLDS optimization to convert assignments into
initializers.
compiler/options.m:
doc/user_guide.texi:
Add new option `--optimize-initializations'.
compiler/ml_optimize.m:
Implement the new optimization.
compiler/ml_elim_nested.m:
compiler/ml_util.m:
Move initializer_contains_var, rval_contains_var and related
predicates from ml_elim_nested.m to ml_util.m, for use by
ml_optimize.m.
Estimated hours taken: 2
compiler/globals.m:
compiler/mode_errors.m:
compiler/mode_info.m:
compiler/transform_llds.m:
compiler/vn_order.m:
compiler/vn_verify.m:
samples/diff/globals.m:
Add missing `import_module' statements in the interface section.
(The current version of the compiler doesn't detect these errors.
I have a fix for that bug, but I plan to commit it separately.)
Estimated hours taken: 4
An efficient, resizable bitmap implementation.
library/bitmap.m:
Added.
library/library.m:
Added bitmap to import list.
compiler/modules.m:
Added mercury_std_library_module/1 entry for bitmap.
NEWS:
Recorded bitmap.m as a new library module.
Estimated hours taken: 4
An efficient, resizable bitmap implementation.
library/bitmap.m:
Added.
library/library.m:
Added bitmap to import list.
compiler/modules.m:
Added mercury_std_library_module/1 entry for bitmap.
NEWS:
Recorded bitmap.m as a new library module.
Estimated hours taken: 4
An efficient, resizable bitmap implementation.
library/bitmap.m:
Added.
library/library.m:
Added bitmap to import list.
compiler/modules.m:
Added mercury_std_library_module/1 entry for bitmap.
NEWS:
Recorded bitmap.m as a new library module.
Estimated hours taken: 1
library/std_util.m:
Back out the change to add dynamic_cast (rev 1.222), as this change
deleted all the changes to make univ a user defined type and
possibly some other changes.
Estimated hours taken: 2
On platforms which support it, check that there are no undefined
symbols when linking the Mercury shared libraries.
Some platforms (AIX, Windows, and BeOS) require this when building
shared libraries. This change means that we check it on our usual
platforms, including Linux.
configure.in:
Set ERROR_UNDEFINED to `-Wl,--no-undefined' on x86 Linux.
Using --no-undefined on Linux requires linking in ld-linux.so,
so add some code to figure out the right version of that to
link with.
Mmake.common.in:
Set ALLOW_UNDEFINED and ERROR_UNDEFINED to the values
determined by configure.in. Also pass down the values of
SOCKET_LIBRARY, NSL_LIBRARY, and DL_LIBRARY, since we need
to link with those libraries to resolve all the undefined
symbols.
runtime/Mmakefile:
library/Mmakefile:
browser/Mmakefile:
trace/Mmakefile:
Pass $(ERROR_UNDEFINED) to $(LINK_SHARED_OBJ).
browser/Mmakefile:
trace/Mmakefile:
Link in SOCKET_LIBRARY, NSL_LIBRARY, and DL_LIBRARY.
Estimated hours taken: 0.1
NEWS:
Move Ralph's documentation for his change on the main branch
into the proper section for changes that are only on the main
branch.
Estimated hours taken: 0.25
tests/hard_coded/sub-modules/Mmakefile:
tests/hard_coded/sub-modules/class.m:
tests/hard_coded/sub-modules/class.exp:
Add a test case that uses `class', `int', and `char' as module names.
This test case is testing that module names which have the
same syntax as keywords in the target language get properly
mangled/escaped.
Estimated hours taken: 0.5
Support testing with lcc.
tools/run_all_test_from_cron:
Add an optional second argument, namely the C compiler to test with.
This defaults to `gcc'. Pass this on to tools/test_mercury.
Also preserve the last three copies of the log files,
rather than just the last two. This is useful when
running different tests at different times.
tools/test_mercury:
Add a fourth argument, namely the C compiler to test with.
Set CC to this argument before running configure.
Include this argument in various components, e.g. the
name of the install directory, and the successful_tests
log file, etc.
Set things up for testing with lcc on venus.
Estimated hours taken: 0.25
Adapt the tests in the general directory so that the version of the
Mercury compiler built with MSVC passes them in the hlc.gc grade.
float_test.exp2:
string_format_test.exp3:
The MSVC runtime prints out floating points using three digits for
the exponent.
Estimated hours taken: 1
Fix a problem where the none.gc.tr.debug grade doesn't compile using
MSVC.
compiler/layout_out.m:
Avoid generating definitions in the following form
type name[] = { };
as not all C compilers (read MSVC) like an empty initializer list.
Estimated hours taken: 3
Fix SourceForge bug report #129892, "profiler map__lookup failed
in grade hlc.gc.memprof".
The remaining problem that was still causing failures for this
test case was that demangling isn't implemented for the MLDS
back-end. When symbols that the MLDS back end generates are
fed through the demangler, it demangles some distinct symbols
to the same name. This causes the profiler to abort, because
it assumes that each distinct symbol demangles to a different
name.
The fix is to turn off demangling when profiling programs
built in MLDS grades.
NEWS:
Mention that we haven't implemented symbol demangling
in the profiler for the MLDS back-end yet.
doc/user_guide.texi:
Document that for profiling of programs built with
`--high-level-code' you need to use the `--no-demangle'
option.
tools/test_mercury:
When testing the profiler in hl* grades,
pass `--no-demangle' to mprof, and compare with
*.mprof-exp2 rather than *.mprof-exp.
tests/benchmarks/poly.mprof-exp2:
New file. Contains alternative expected output for this test
case, to match what is output for grade hlc.gc.memprof (at -O2).
profiler/options.m:
The `--(no-)demangle' option is not a filename option,
so document it under the "Profiler options" section,
rather than the "Filename options" section.
Also fix a typo (s/Ouput/Output/) and a thinko
(s/unmangled/mangled/) in the description of that option.
Estimated hours taken: 0.25
boehm_gc/if_mach.c:
boehm_gc/if_not_there.c:
Fix a bug: it was not flushing stdout before calling execve().
This resulted in the output being lost when stdout was buffered
(e.g. when redirected to a file).
Estimated hours taken: 1
compiler/mlds_to_c.m:
Fix a couple of XXXs: don't output some unnecessary casts.
Only output the intermediate casts to `MR_Word' when
casting to/from `character' or mlds__native_{char,bool,int}_type.
This also fixes a bug that broke the hlc* grades when using
lcc: casts from pointers to integers aren't allowed in
constant expressions.
Estimated hours taken: 0.2
library/int.m:
Added func versions of all preds implementing functions.
Changed some comments to use the funcs instead.
NEWS:
Made a note of the above in the section on changes to the
library.
Estimated hours taken: 0.2
library/int.m:
Added func versions of all preds implementing functions.
Changed some comments to use the funcs instead.
NEWS:
Made a note of the above in the section on changes to the
library.