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: 12
[ Committing this on the version-0_10_x branch ]
Fix a bug reported by petdr on October 30th last year.
compiler/polymorphism.m:
When looking up the variable which contains a typeclass info for
a particular constraint to be passed to a call, handle the case where
there is *no* variable for such a constraint. This occurs in the case
where the producer of the variable occurs later on in the goal (but
will get re-ordered by the mode checker). The solution is to just
create a variable for the typeclass info, and whenever creating
a `head' variable to hold a constraint being produced by a call,
check first whether there is already a variable allocated for that
constraint.
doc/reference_manual.texi:
Delete mention of this bug from the "Known Bugs" in the existential
types section.
tests/hard_coded/typeclasses/Mmakefile:
tests/hard_coded/typeclasses/reordered_existential_constraint.exp:
tests/hard_coded/typeclasses/reordered_existential_constraint.m:
A test case for this. (Not the same as petdr's original test case,
but much simpler and exhibits the same bug).
Estimated hours taken: 0.5
Fix a bug that broke profiling in MLDS grades on the release branch
(-rversion-0_10_x).
library/exception.m:
Define function versions of mercury__exception__builtin_catch_3_p_*.
This was already done on the main branch, in revision 1.42 of
exception, for the GCC back-end interface. But it's also needed
for profiling, so I merged those changes onto the release branch.
Estimated hours taken: 12
Fix a bug reported by petdr on October 30th last year.
compiler/polymorphism.m:
When looking up the variable which contains a typeclass info for
a particular constraint to be passed to a call, handle the case where
there is *no* variable for such a constraint. This occurs in the case
where the producer of the variable occurs later on in the goal (but
will get re-ordered by the mode checker). The solution is to just
create a variable for the typeclass info, and whenever creating
a `head' variable to hold a constraint being produced by a call,
check first whether there is already a variable allocated for that
constraint.
doc/reference_manual.texi:
Delete mention of this bug from the "Known Bugs" in the existential
types section.
tests/hard_coded/typeclasses/Mmakefile:
tests/hard_coded/typeclasses/reordered_existential_constraint.exp:
tests/hard_coded/typeclasses/reordered_existential_constraint.m:
A test case for this. (Not the same as petdr's original test case,
but much simpler and exhibits the same bug).
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: 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.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.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: 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: 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.
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.
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.