library/*.m:
Delete Erlang foreign code and foreign types.
Delete documentation specific to Erlang targets.
library/deconstruct.m:
Add pragma no_determinism_warning to allow functor_number_cc/3
to compile for now.
library/Mercury.options:
Delete workaround only needed when targetting Erlang.
browser/listing.m:
mdbcomp/rtti_access.m:
Delete Erlang foreign code and foreign types.
library/LIB_FLAGS.in:
Specify --warn-dead-predicates.
library/bitmap.m:
library/deconstruct.m:
library/lexer.m:
library/table_builtin.m:
library/type_desc.m:
Add consider_used pragmas for predicates that are needed
only in grades that lack a foreign_proc for some predicate.
library/io.m:
Add consider_used pragmas for predicates that are needed
only in grades that lack a foreign_proc for some predicate.
Delete a predicate that is never needed.
library/robdd.m:
library/rtti_implementation.m:
Delete predicates that are never needed.
Currently, we return a placeholder string ("foreignxx") if we attempt to look
up the functor of a foreign type in the C# or Java grades. For C, we return a
string of the form:
<<foreign(Name, Rep)>>
where Name is the type's Mercury name and Rep is its "value" as results from
casting it to (void *) and then using sprintf's %p conversion specifier. Do
something similar for both the C# and Java grades, except that for Rep we
return the output of the calling the toString() (ToString()) method. If the
object in question is a null reference then we return "null" for Rep.
Document how the predicates in the deconstruct module handle foreign types.
library/rtti_implementation.m:
Return more information about foreign type functors.
library/deconstruct.m:
Make the above changes to the documentation.
tests/hard_coded/csharp_print_foreign.{m,exp}:
tests/hard_coded/java_print_foreign.{m,exp}:
Tests of the new functionality in the C# and Java grades.
tests/hard_coded/Mmakefile:
Add the new tests.
Add a new category of test programs that are only run in the C# grades.
browser/collect_lib.m:
browser/declarative_execution.m:
browser/dl.m:
browser/io_action.m:
compiler/make.util.m:
compiler/pickle.m:
compiler/process_util.m:
compiler/prog_event.m:
library/array.m:
library/benchmarking.m:
library/bit_buffer.m:
library/builtin.m:
library/char.m:
library/deconstruct.m:
library/dir.m:
library/erlang_rtti_implementation.m:
library/int.m:
library/int16.m:
library/int32.m:
library/int64.m:
library/int8.m:
library/io.m:
library/math.m:
library/mutvar.m:
library/private_builtin.m:
library/profiling_builtin.m:
library/rtti_implementation.m:
library/store.m:
library/string.format.m:
library/string.m:
library/table_builtin.m:
library/term_size_prof_builtin.m:
library/thread.m:
library/time.m:
library/type_desc.m:
library/uint16.m:
library/uint32.m:
library/uint64.m:
library/uint8.m:
ssdb/ssdb.m:
As above. This mostly involved two things.
The first was grouping foreign_procs by predicate instead of by language.
In a few cases, this revealed that some predicates *had* no foreign_proc
for a language, while related predicates did have one that just aborted
if called. This diff adds similar aborting foreign_procs to predicate/
language combinations that were missing them, when this seemed obviously
the right thing to do.
The second was moving pragmas about a predicate from the middle of the
block of clauses of that predicate to the start of that block.
The above predicates currently escape all of the C0 control characters (+
Delete). This change modifies them to escape all of the characters in the
Unicode category `Other,control' using backslash escapes when they exist and
octal escapes otherwise.
library/term_io.m:
Do not treat C1 control characters as Mercury source characters.
Re-order the list of Mercury punctuation characters by codepoint
order; it is difficult to check for completion otherwise.
Put a list of special characters escapes in order.
runtime/mercury_ml_expand_body.h:
library/rtti_implementation.m:
Update the implementations of functor/4 to escape all control
characters when returning the functor of a character.
library/deconstruct.m:
Specify that functor/4 should escape all control characters in
the value returned for characters and strings. (XXX TODO: it
currently doesn't implement the new behaviour for strings; I'll
add that separately.)
library/io.m:
library/stream.string_writer.m:
Similar to the above but for io.write etc.
tests/hard_coded/write.{m,exp}:
tests/hard_coded/deconstruct_arg.{m,exp,exp2}:
Extend these tests to cover the block of C1 control characters
and the boundaries around it.
Discussion of these changes can be found on the Mercury developers
mailing list archives from June 2018.
COPYING.LIB:
Add a special linking exception to the LGPL.
*:
Update references to COPYING.LIB.
Clean up some minor errors that have accumulated in copyright
messages.
library/deconstruct.m:
Document what deconstruct_functor/4 returns with infinite floating point
values. Also, the functor returned will only be a floating point base 10
number for finite float values.
tests/hard_coded/deconstruct_arg.{m,exp}:
Extend this test to cover infinity and -infinity.
browser/*.m:
compiler/*.m:
deep_profiler/*.m:
library/*.m:
mdbcomp/*.m:
ssdb/*.m:
Specify the type constructor for every inst definition that lists
the functors that values of that type may be bound to.
In library/maybe.m, delete the inst maybe_errors/1, because
(a) its name is misleading, since it is for the maybe_error/1 type (no s),
and (b) there is already an inst with the non-misleading name maybe_error
which had an identical definition.
In compiler/dep_par_conj.m, delete two insts that were duplicates
of insts defined in hlds_goal.m, and replace references to them
accordingly.
library/assoc_list.m:
library/bag.m:
library/bimap.m:
library/calendar.m:
library/char.m:
library/digraph.m:
library/list.m:
library/map.m:
library/multi_map.m:
library/psqueue.m:
library/rbtree.m:
library/string.m:
library/term.m:
library/tree234.m:
library/type_desc.m:
library/univ.m:
library/varset.m:
Replace most occurrences of "abort" with "throw an exception".
Slightly improve the documentation for map.search, map.lookup,
map.inverse_search.
library/deconstruct.m:
Replace "abort" with "runtime abort" where that is meant.
library/bimap.m:
library/bitmap.m:
library/calendar.m:
library/char.m:
library/cord.m:
library/deconstruct.m:
library/diet.m:
library/dir.m:
library/eqvclass.m:
library/map.m:
library/pprint.m:
library/pqueue.m:
library/stream.string_writer.m:
library/term_conversion.m:
library/time.m:
library/type_desc.m:
library/version_array.m:
library/version_array2d.m:
library/version_bitmap.m:
library/version_hash_table.m:
Fix inconsistencies between (a) the order in which functions and predicates
are declared, and (b) the order in which they are defined.
In most of these modules, either the order of the declarations
or the order of the definitions made sense, and I changed the other
to match. In a few modules, neither made sense, so I changed *both*
to an order that *does* make sense (i.e. it has related predicates
together).
In some places, put dividers between groups of related
functions/predicates, to make the groups themselves more visible.
In some places, fix comments or programming style, give some auxiliary
(non-exported) predicates better names, or delete some unneeded module
qualifications.
In some places, have the function form of a procedure forward
the work to the predicate form, instead of vice versa, where this is
more natural (usually because it allows the use of state variables).
However, this is the only kind of "algorithmic" change in this diff;
the rest is just moving code around.
library/construct.m:
library/deconstruct.m:
library/rtti_implementation.
Replace references to the IL backend with the C# backend.
compiler/prog_item.m:
Add an XXX comment about mlds_to_gcc.m: since that no longer
exists the code here can possibly be simplified (at the least
the comments need to be updated).
runtime/mercury_deconstruct.h:
Bring this module up to our current standards of programming style,
by making type names only camelcase, not camelcase AND underscores.
runtime/mercury_deconstruct.c:
runtime/mercury_ml_expand_body.h:
runtime/mercury_ml_functor_body.h:
library/deconstruct.m:
Conform to the above.
In mercury_ml_expand_body.h, fix an old mistake in documentation.
library/rtti_implementation.m:
Bring this module up to our current standards of programming style.
Note some inconsistencies. Factor out some common code.
tests/hardcoded/foreign_type.m:
Bring this module up to our current standards of programming style.
tests/debugger/foreign_type.{m,inp,exp}:
A new test case, to test the printing of values of foreign types.
tests/debugger/Mmakefile:
Enable the new test case.
Branches: main
Implement a new form of memory profiling, which tells the user what memory
is being retained during a program run. This is done by allocating an extra
word before each cell, which is used to "attribute" the cell to an
allocation site. The attribution, or "allocation id", is an address to an
MR_AllocSiteInfo structure generated by the Mercury compiler, giving the
procedure, filename and line number of the allocation, and the type
constructor and arity of the cell that it allocates.
The user must manually instrument the program with calls to
`benchmarking.report_memory_attribution', which forces a GC and summarises
the live objects on the heap using the attributions. The mprof tool is
extended with a new mode to parse and present that data.
Objects which are unattributed (e.g. by hand-written C code which hasn't
been updated) are still accounted for, but show up in profiles as "unknown".
Currently this profiling mode only works in conjunction with the Boehm
garbage collector, though in principle it can work with any memory allocator
for which we can access a list of the live objects. Since term size
profiling relies on the same technique of using an extra word per memory
cell, the two profiling modes are incompatible.
The output from `mprof -s' looks like this:
------ [1] some label ------
cells words cumul procedure / type (location)
14150 38872 total
* 1949/ 13.8% 4872/ 12.5% 12.5% <predicate `parser.parse_rest/7' mode 0>
975/ 6.9% 1950/ 5.0% list.list/1 (parser.m:502)
487/ 3.4% 1948/ 5.0% term.term/1 (parser.m:501)
487/ 3.4% 974/ 2.5% term.const/0 (parser.m:501)
* 1424/ 10.1% 4272/ 11.0% 23.5% <predicate `parser.parse_simple_term_2/6' mode 0>
708/ 5.0% 2832/ 7.3% term.term/1 (parser.m:643)
708/ 5.0% 1416/ 3.6% term.const/0 (parser.m:643)
...
boehm_gc/alloc.c:
boehm_gc/include/gc.h:
boehm_gc/misc.c:
boehm_gc/reclaim.c:
Add a callback function to be called for every live object after a GC.
Add a function to write out the GC_size_map array.
compiler/layout.m:
Define the alloc_site_info type which is equivalent to the
MR_AllocSiteInfo C structure.
Add alloc_site_array as a kind of "layout" array.
compiler/llds.m:
Add allocation sites to `cfile' structure.
Replace TypeMsg argument (which was also for profiling) on `incr_hp'
instructions by an allocation site identifier.
Add a new foreign_proc_component for allocation site ids.
compiler/code_info.m:
compiler/global_data.m:
compiler/proc_gen.m:
Keep the set of allocation sites in the code_info and global_data
structures.
compiler/unify_gen.m:
Add allocation sites to LLDS allocation instructions.
compiler/layout_out.m:
compiler/llds_out_file.m:
compiler/llds_out_instr.m:
Output MR_AllocSiteInfo arrays in generated C files.
Output code to register the MR_AllocSiteInfo array with the Mercury
runtime.
Output allocation site ids for memory allocation instructions.
compiler/llds_out_util.m:
Add allocation sites to llds_out_info.
compiler/pragma_c_gen.m:
compiler/ml_foreign_proc_gen.m:
Generate a macro MR_ALLOC_ID which resolves to an allocation site
structure, for every foreign_proc whose C code contains the string
"MR_ALLOC_ID". This is to be used by hand-written C code which
allocates memory.
MR_PROC_LABELs are retained for backwards compatibility. Though
they were introduced for profiling, they seem to have been co-opted
for printf-debugging since then.
compiler/ml_global_data.m:
Add allocation site structures to the MLDS global data.
compiler/mlds.m:
compiler/ml_unify_gen.m:
Add allocation site id to `new_object' instruction.
compiler/mlds_to_c.m:
Output allocation site arrays and allocation ids in high-level C code.
Output a call to register the allocation site array with the Mercury
runtime.
Delete an unused predicate.
compiler/exprn_aux.m:
compiler/jumpopt.m:
compiler/livemap.m:
compiler/mercury_compile_llds_back_end.m:
compiler/middle_rec.m:
compiler/ml_accurate_gc.m:
compiler/ml_elim_nested.m:
compiler/ml_optimize.m:
compiler/ml_util.m:
compiler/mlds_to_cs.m:
compiler/mlds_to_gcc.m:
compiler/mlds_to_il.m:
compiler/mlds_to_java.m:
compiler/mlds_to_managed.m:
compiler/opt_debug.m:
compiler/opt_util.m:
compiler/use_local_vars.m:
compiler/var_locn.m:
Conform to changes.
compiler/pickle.m:
compiler/prog_event.m:
compiler/timestamp.m:
Conform to changes in memory allocation macros.
library/benchmarking.m:
Add the `report_memory_attribution' instrumentation predicates.
Conform to changes to MR_memprof_record.
library/array.m:
library/bit_buffer.m:
library/bitmap.m:
library/construct.m:
library/deconstruct.m:
library/dir.m:
library/io.m:
library/mutvar.m:
library/store.m:
library/string.m:
library/thread.semaphore.m:
library/version_array.m:
Use attributed memory allocation throughout the standard library so
that objects don't show up in the memory profile as "unknown".
Replace MR_PROC_LABEL by MR_ALLOC_ID.
mdbcomp/program_representation.m:
mdbcomp/rtti_access.m:
Replace MR_PROC_LABEL by MR_ALLOC_ID.
profiler/Mercury.options:
profiler/globals.m:
profiler/mercury_profile.m:
profiler/options.m:
profiler/output.m:
profiler/snapshots.m:
Add a new mode to `mprof' to parse and present the data from
`Prof.Snapshots' files.
Add options for the new profiling mode.
profiler/process_file.m:
Fix a typo.
runtime/mercury_conf_param.h:
#define MR_MPROF_PROFILE_MEMORY_ATTRIBUTION if memory profiling
is enabled and we are using Boehm GC.
runtime/mercury.h:
Make MR_new_object take an allocation id argument.
Conform to changes in memory allocation macros.
runtime/mercury_memory.c:
runtime/mercury_memory.h:
runtime/mercury_types.h:
Define MR_AllocSiteInfo.
Add memory allocation functions and macros which take into the
account the additional word necessary for the new profiling mode.
These should be used in preferences to the raw memory allocation
functions wherever possible so that objects do not show up in the
profile as "unknown".
Add analogues of realloc/free which take into account the offset
introduced by the attribution word.
Add function versions of the MR_new_object macros, which can't be
written in standard C. They are only used when necessary.
Add built-in allocation site ids, to be used in the runtime and
other hand-written code when context-specific ids are unavailable.
runtime/mercury_heap.h:
Make MR_tag_offset_incr_hp_msg and MR_tag_offset_incr_hp_atomic_msg
allocate an extra word when memory attribution is desired, and store
the allocation id there.
Similarly for MR_create{1,2,3}_msg.
Replace proclabel arguments in allocation macros by alloc_id
arguments.
Replace MR_hp_alloc_atomic by MR_hp_alloc_atomic_msg. It was only
used for boxing floats.
Conform to change to MR_new_object macro.
runtime/mercury_bootstrap.h:
Delete obsolete macro hp_alloc_atomic.
runtime/mercury_heap_profile.c:
runtime/mercury_heap_profile.h:
Add the code to summarise the live objects on the Boehm GC heap and
writes out the data to `Prof.Snapshots', for display by mprof.
Don't store the procedure name in MR_memprof_record: the procedure
address is enough and faster to compare.
runtime/mercury_prof.c:
Finish and close the `Prof.Snapshots' file when the program
terminates.
Conform to changes in MR_memprof_record.
runtime/mercury_misc.h:
Add a macro to expand to the name of the allocation sites array
in LLDS grades.
runtime/mercury_bitmap.c:
runtime/mercury_bitmap.h:
Pass allocation id through bitmap allocation functions.
Delete unused function MR_string_to_bitmap.
runtime/mercury_string.h:
Add MR_make_aligned_string_copy_msg.
Make string allocation macros take allocation id arguments.
runtime/mercury.c:
runtime/mercury_array_macros.h:
runtime/mercury_context.c:
runtime/mercury_deconstruct.c:
runtime/mercury_deconstruct_macros.h:
runtime/mercury_dlist.c:
runtime/mercury_engine.c:
runtime/mercury_float.h:
runtime/mercury_hash_table.c:
runtime/mercury_ho_call.c:
runtime/mercury_label.c:
runtime/mercury_prof_mem.c:
runtime/mercury_stacks.c:
runtime/mercury_stm.c:
runtime/mercury_string.c:
runtime/mercury_thread.c:
runtime/mercury_trace_base.c:
runtime/mercury_trail.c:
runtime/mercury_type_desc.c:
runtime/mercury_type_info.c:
runtime/mercury_wsdeque.c:
Use attributed memory allocation throughout the runtime so that
objects don't show up in the profile as "unknown".
runtime/mercury_memory_zones.c:
Attribute memory zones to the Mercury runtime.
runtime/mercury_tabling.c:
runtime/mercury_tabling.h:
Use attributed memory allocation macros for tabling structures.
Delete unused MR_table_realloc_* and MR_table_copy_bytes macros.
runtime/mercury_deep_copy_body.h:
Try to retain the original attribution word when copying values.
runtime/mercury_ml_expand_body.h:
Conform to changes in memory allocation macros.
runtime/mercury_tags.h:
Replace proclabel arguments by alloc_id arguments in allocation macros.
runtime/mercury_wrapper.c:
If memory attribution is enabled, tell Boehm GC that pointers may be
displaced by an extra word.
trace/mercury_trace.c:
trace/mercury_trace_tables.c:
Conform to changes in memory allocation macros.
extras/net/tcp.m:
extras/solver_types/library/any_array.m:
extras/trailed_update/tr_array.m:
Conform to changes in memory allocation macros.
doc/user_guide.texi:
Document the new profiling mode.
doc/reference_manual.texi:
Update a commented out example.
Branches: main, 10.04
library/deconstruct.m:
library/rtti_implementation.m:
Implement deconstruct.named_arg* and deconstruct.functor_number*
predicates for Java backend.
Reformat some of the code.
tests/hard_coded/deconstruct_arg.m:
tests/hard_coded/deconstruct_arg.exp:
tests/hard_coded/deconstruct_arg.exp2:
Extend this test case to test named_arg_cc.
Branches: main
library/deconstruct.m:
library/erlang_rtti_implementation.m:
Make the Erlang implementations of deconstruct_du, functor_number,
functor_number_cc, fail as required on non-d.u. types.
Replace int by functor_number_lex and functor_number_ordinal types
where appropriate.
Estimated hours taken: 0
Branches: main
library/deconstruct.m:
Temporary cast functor_number, functor_number_cc to be semidet.
Add a comment that these functions should fail in some circumstances.
Estimated hours taken: 10
Branches: main
Improvements to the Erlang backend RTTI implementation.
- Remember the lexical order of discriminated union functors, and use that
for functor numbers, as in the C backends.
- Change the representation of type_ctor_descs, which are now different from
the representation of type_ctor_infos in the case of variable arity types
(higher order types and tuples). This is necessary so we can get the arity
from a variable arity type_ctor_desc.
- Implement some related procedures:
construct.get_functor_ordinal
construct.get_functor_lex
deconstruct.functor_number
deconstruct.functor_number_cc
compiler/erl_rtti.m:
compiler/erlang_rtti.m:
For d.u. functors, output the functor number (based on lexicographic
order) as well in the RTTI data.
library/erlang_rtti_implementation.m:
Implement the functor numbering and type_ctor_desc changes.
Rename some procedures to distinguish between type_ctor_infos and
type_ctor_descs.
Fix some minor bugs.
library/construct.m:
Make get_functor_ordinal, get_functor_lex call the corresponding
procedures in erlang_rtti_implementation.
library/deconstruct.m:
Make deconstruct_du, functor_number, functor_number_cc
call the corresponding procedures in erlang_rtti_implementation.
library/type_desc.m:
Make type_ctor, type_ctor_and_args, make_type,
type_ctor_name_and_arity call the corresponding procedures in
erlang_rtti_implementation.
Fix the comparisons of type_ctor_descs which were not updated when the
calling convention of single output procedures was changed.
tests/hard_coded/construct_test.exp:
tests/hard_coded/construct_test.m:
Do additional tests on list and dummy types, which were not covered
previously.
Estimated hours taken: 8
Branches: main
Add erlang implementations of construct rtti routines.
library/construct.m:
Call the erlang_rtti_implementation version of predicates.
library/deconstruct.m:
Move is_erlang_backend to erlang_rtti_implementation.
library/erlang_rtti_implementation.m:
Implement num_functors, get_functor and get_functor_with_names.
library/rtti_implementation.m:
Add an erlang version of unsafe_cast as it is used by construct.
Estimated hours taken: 2
Branches: main
Switch to using the erlang_rtti_implementation for all the
RTTI operations on the erlang backend.
library/deconstruct.m:
Call the erlang version of deconstruct, if we are on the
erlang backend.
library/erlang_rtti_implementation.m:
Make the interface of erlang_rtti_implementation contain
exactly the same predicates as rtti_implementation.
Implement get_type_info, type_ctor_and_args, and
type_ctor_name_and_arity.
Abort for compare_type_infos.
library/type_desc.m:
Call the erlang versions of type_ctor_and_args
and type_ctor_name_and_arity.
Estimated hours taken: 0.5
Branches: main
Remove a bug workaround in the the thread module.
Misc. minor changes to library modules.
library/thread.m:
Delete the workaround for the bug with foreign_import_module pragmas
and sub-modules on the lowlevel backends.
library/deconstruct.m:
library/sparse_bitset.m:
library/varset.m:
Delete duplicate imports.
library/io.m:
library/thread.semaphore.m:
s/which/that/ in a spot.
library/prolog.m:
Convert this module to 4-space indentation.
library/dir.m:
library/getopt.m:
library/getopt_io.m:
library/lexer.m:
Fix some formatting so that it conforms to our current coding
standard.
Estimated hours taken: 80
Branches: main
Improvements for bitmap.m, to make it useable as a general container
for binary data.
library/bitmap.m:
runtime/mercury_bitmap.c:
runtime/mercury_bitmap.h:
Specialize the representation of bitmaps to an array of unsigned
bytes defined as a foreign type.
This is better than building on top of array(int) because it:
- is better for interfacing with foreign code
- has a more sensible machine-independent comparison order
(same as array(bool))
- avoids storing the size twice
- has more efficient copying, unification, comparison and tabling
(although we should probably specialize the handling of array(int)
and isomorphic types as well)
- uses GC_MALLOC_ATOMIC to avoid problems with bit patterns that look
like pointers (although we should do that for array(int) as well)
XXX The code for the Java and IL backends is untested.
Building the library in grade Java with Sun JDK 1.6 failed (but
at least passed error checking), and I don't have access to a
copy of MSVS.NET. The foreign code that needs to be tested is
trivial.
Add fields `bit', `bits' and `byte' to get/set a single bit,
multiple bits (from an int) or an 8 bit byte.
Add functions for converting bitmaps to hex strings and back,
for use by stream.string_writer.write and deconstruct.functor/4.
bitmap.intersect was buggy in the case where the input bitmaps
had a different size. Given that bitmaps are implemented with
a fixed domain (lookups out of range throw an exception), it
makes more sense to throw an exception in that case anyway,
so all of the set operations do that now.
The difference operation actually performed xor. Fix it and
add an xor function.
library/version_bitmap.m:
This hasn't been fully updated to be the same as bitmap.m.
The payoff would be much less because foreign code can't
really do anything with version_bitmaps.
Add a `bit' field.
Deprecate the `get/2' function in favour of the `bit' field.
Fix the union, difference, intersection and xor functions
as for bitmap.m.
Fix comparison of version_arrays so that it uses the same
method as array.m: compare size then elements in order.
The old code found version_arrays to be equal if one was
a suffix of the other.
library/char.m:
Add predicates for converting between hex digits and integers.
library/io.m:
library/stream.string_writer.m:
library/term.m:
Read and write bitmaps.
runtime/mercury_type_info.h:
runtime/mercury_deep_copy_body.h:
runtime/mercury_mcpp.h:
runtime/mercury_table_type_body.h:
runtime/mercury_tabling_macros.h:
runtime/mercury_unify_compare_body.h:
runtime/mercury_construct.c:
runtime/mercury_deconstruct.c:
runtime/mercury_term_size.c:
runtime/mercury_string.h:
library/construct.m:
library/deconstruct.m
compiler/prog_type.m:
compiler/mlds_to_gcc.m:
compiler/rtti.m:
Add a MR_TypeCtorRep for bitmaps, and handle it in the library
and runtinme.
library/Mercury.options:
Compile bitmap.m with `--no-warn-insts-without-matching-type'.
runtime/mercury_type_info.h:
Bump MR_RTTI_VERSION.
NEWS:
Document the changes.
tests/hard_coded/Mmakefile:
tests/hard_coded/bitmap_test.m:
tests/hard_coded/bitmap_simple.m:
tests/hard_coded/bitmap_tester.m:
tests/hard_coded/bitmap_test.exp:
tests/tabling/Mmakefile:
tests/tabling/expand_bitmap.m:
tests/tabling/expand_bitmap.exp:
tests/hard_coded/version_array_test.m:
tests/hard_coded/version_array_test.exp:
Test cases.
Estimated hours taken: 20
Branches: main
Add support for deconstructing by functor number rather than name,
for use by write_binary.
library/deconstruct.m:
runtime/mercury_deconstruct.h:
runtime/mercury_deconstruct.c:
runtime/mercury_ml_expand_body.h:
runtime/mercury_ml_deconstruct_body.h:
Add predicates deconstruct.functor_number and
deconstruct.deconstruct.du, which returns a functor number
suitable for use by construct.construct rather than a functor
name.
library/construct.m:
library/term.m:
browser/term_rep.m:
extras/quickcheck/qcheck.m:
tests/valid/agc_unbound_typevars.m:
tests/valid/agc_unbound_typevars2.m:
Add a function get_functor_lex, which returns the lexicographic
functor number given an ordinal functor number.
Add equivalence types to make it clearer which ordering is
being used by which functor numbers.
Remove a C-ism: num_functors now fails rather than returning -1
for types without functors.
NEWS:
Document the new predicates and functions.
runtime/mercury_type_info.h:
runtime/mercury_builtin_types.c:
runtime/mercury_mcpp.h:
compiler/rtti.m:
compiler/rtti_out.m:
compiler/type_ctor_info.m:
compiler/rtti_to_mlds.m:
compiler/opt_debug.m:
Add a field to MR_TypeCtorInfo which contains a mapping from
an ordinal functor number to a lexicographic functor number
which can be passed to construct.construct.
Bump MR_RTTI_VERSION.
tests/hard_coded/expand.m:
tests/hard_coded/expand.exp:
tests/hard_coded/expand.exp2:
tests/hard_coded/construct_test.m:
tests/hard_coded/construct_test.exp:
tests/hard_coded/construct_test_exist.m:
tests/hard_coded/construct_test_exist.exp:
Test cases.
Estimated hours taken: 0.1
Branches: main
Fix library compilation in grades java and il.
library/builtin.m:
library/construct.m:
library/deconstruct.m:
Undo Pete's change that deleted some of the module imports required
by the Java and IL backends.
library/private_builtin.m:
Fix a purity mistmatch in one of the foreign clauses for Java.
Estimated hours taken: 2
Branches: main
runtime/mercury_ml_expand_body.h:
Construct strings representing c_pointer addresses. Used in the
implementation of functor and deconstruct.
library/deconstruct.m:
Document the behaviour of functor and deconstruct for c_pointers.
library/string.m:
Export c_pointer_to_string for getting a string representation
of the pointer address.
library/io.m:
library/rtti_implementation.m:
Use c_pointer_to_string/1 to print c_pointers.
Update comments.
library/pprint.m:
Undo Ralph's earlier change, since it is no longer required.
tests/debugger/Mmakefile:
tests/debugger/declarative/Mmakefile:
Canonicalize the output of test cases in which c_pointers appear.
tests:
Update the expected output of test cases.
Estimated hours taken: 0.1
Branches: main, release
library/deconstruct.m:
Remove some dangling links to documentation that used to be
in std_util.
library/type_desc.m:
Replace . with __ in some Java and C# foreign code. It was
accidently replaced when the module qualifier was changed.
Estimated hours taken: 18
Branches: main
Move the univ, maybe, pair and unit types from std_util into their own
modules. std_util still contains the general purpose higher-order programming
constructs.
library/std_util.m:
Move univ, maybe, pair and unit (plus any other related types
and procedures) into their own modules.
library/maybe.m:
New module. This contains the maybe and maybe_error types and
the associated procedures.
library/pair.m:
New module. This contains the pair type and associated procedures.
library/unit.m:
New module. This contains the types unit/0 and unit/1.
library/univ.m:
New module. This contains the univ type and associated procedures.
library/library.m:
Add the new modules.
library/private_builtin.m:
Update the declaration of the type_ctor_info struct for univ.
runtime/mercury.h:
Update the declaration for the type_ctor_info struct for univ.
runtime/mercury_mcpp.h:
runtime/mercury_hlc_types.h:
Update the definition of MR_Univ.
runtime/mercury_init.h:
Fix a comment: ML_type_name is now exported from type_desc.m.
compiler/mlds_to_il.m:
Update the the name of the module that defines univs (which are
handled specially by the il code generator.)
library/*.m:
compiler/*.m:
browser/*.m:
mdbcomp/*.m:
profiler/*.m:
deep_profiler/*.m:
Conform to the above changes. Import the new modules where they
are needed; don't import std_util where it isn't needed.
Fix formatting in lots of modules. Delete duplicate module
imports.
tests/*:
Update the test suite to confrom to the above changes.
Estimated hours taken: 0.5
Branches: main
Make some more updates required by the deletion of the RTTI access predicates
from std_util.m.
library/deconstruct.m:
Include the runtime header files for deconstructing terms here rather
than in std_util.m since the relevant RTTI access preds are now
defined here.
library/std_util.m:
Don't #include them here.
library/term.m:
Replace std_util.type_info with type_desc.type_desc.
runtime/mercury_type_info.h:
Update some comments to reflect the fact the recent move of the RTTI
access preds.
trace/mercury_trace_vars.c:
Remove the extern declarations for the MR_TypeCtorInfo_Structs for
std_util.type_desc and std_util.type_ctor_desc since those types no
longer exist.
Estimated hours taken: 12
Branches: main
Remove from std_util.m the predicates that merely call predicates in
the type_desc, construct and deconstruct modules, to reduce clutter
in std_util.m.
library/std_util.m:
Remove those predicates from std_util.m.
library/deconstruct.m:
Add a type we need that was previously defined in std_util.m.
library/construct.m:
Delete some module qualifications that have now become unnecessary,
browser/browse.m:
browser/browser_info.m:
browser/declarative_tree.m:
browser/dl.m:
browser/help.m:
browser/sized_pretty.m:
browser/term_rep.m:
compiler/bytecode_gen.m:
compiler/llds_out.m:
compiler/mlds_to_il.m:
compiler/mlds_to_managed.m:
library/assoc_list.m:
library/hash_table.m:
library/io.m:
library/pprint.m:
library/private_builtin.m:
library/prolog.m:
library/require.m:
library/rtti_implementation.m:
library/store.m:
library/term.m:
library/term_to_xml.m:
library/version_hash_table.m:
mdbcomp/program_representation.m:
Import type_desc.m, construct.m and/or deconstruct.m to provide
definitions of functions or predicates that up till now were in
std_util.m. Modify the calls if the called function or predicate
had a slightly different interface in std_util.m.
Also, convert term_to_xml.m to four-space indentation, and delete
unnecessary module qualifications in term.m.
tests/debugger/polymorphic_output.{m,inp,exp,exp2}:
tests/hard_coded/copy_pred_2.m:
tests/hard_coded/deconstruct_arg.exp:
tests/hard_coded/deconstruct_arg.exp2:
tests/hard_coded/deconstruct_arg.m:
tests/hard_coded/elim_special_pred.m:
tests/hard_coded/existential_bound_tvar.m:
tests/hard_coded/expand.m:
tests/hard_coded/foreign_type2.m:
tests/hard_coded/higher_order_type_manip.m:
tests/hard_coded/nullary_ho_func.m:
tests/hard_coded/tuple_test.m:
tests/hard_coded/type_ctor_desc.m:
tests/hard_coded/type_qual.m:
tests/hard_coded/write_xml.m:
tests/hard_coded/sub-modules/class.m:
tests/hard_coded/sub-modules/nested.m:
tests/hard_coded/sub-modules/nested2.m:
tests/hard_coded/sub-modules/nested3.m:
tests/hard_coded/sub-modules/parent.m:
tests/hard_coded/sub-modules/parent2.child.m:
tests/hard_coded/typeclasses/existential_rtti.m:
tests/recompilation/type_qual_re.m.1:
cvs update: Updating tests/submodules
cvs update: Updating tests/tabling
cvs update: Updating tests/term
cvs update: Updating tests/tools
cvs update: Updating tests/trailing
cvs update: Updating tests/typeclasses
cvs update: Updating tests/valid
tests/valid/agc_unbound_typevars.m:
tests/valid/agc_unbound_typevars2.m:
tests/valid/agc_unused_in.m:
Replace references to the deleted predicates in std_util with
references to the equivalent predicates in type_desc, construct
and/or deconstruct. In test cases that already tested both the
functionality in std_util and in the other modules, simply delete
the part exercising std_util.
Estimated hours taken: 1
Branches: main
library/*.m:
Replace __ with . as the module qualifier everywhere.
tests/hard_coded/test_injection.exp:
Replace __ with . as the module qualifier in expected exceptions.
Estimated hours taken: 2
Branches: main
Try to reduce the probability of any bug such as the one reported by
Peter Ross happening again.
library/construct.m:
Make sure that the relevant switches list all the values of the enum
type the switch is on, since this way gcc will generate a warning
message if the enum has a value added to it and the switch isn't
updated.
Include the defaults only if MR_INCLUDE_SWITCH_DEFAULTS is defined;
the intention is that this may be useful with non-gcc compilers.
Generate separate, more specific error messages for each type_ctor_rep.
library/deconstruct.m:
Delete some old code that we haven't used in a while, and which we
won't want to use in the future either. (The deleted predicate worked
on the data representation scheme of the running compiler, whereas
we wanted it to work on the data representation scheme of the generated
program, which may be different.)
I found this when inspecting all uses of switch defaults in the
library.
runtime/mercury_conf_params.h:
Document MR_INCLUDE_SWITCH_DEFAULTS.
Estimated hours taken: 3.5
Branches: main
Make the positioning of descriptive comments conform
to the coding standard for the following library modules.
Convert preds to predmode syntax where possible.
Make the ordering of related predicates and functions
conform to the coding standard, where the descriptive
comment makes it possible to do that.
Other minor changes are listed below.
library/bimap.m:
Fix capitalisation of a few comments.
library/dir.m:
s/throw an exception/throws an exception/.
library/exception.m:
Fix the comment about the exception_result/1 type.
There is only one type and an inst following the comment.
library/map.m:
Remove the unique modes for map.set/4, map.delete/3 and
map.delete_list/3.
library/rbtree.m:
Remove the unique modes for rbtree.set/4, rbtree.delete/3,
rbtree.remove/4, rbtree.remove_smallest/4 and rbtree.remove_largest/4.
library/tree234.m:
Remove left over unique modes for preds.
library/set.m:
XXX the ordering of procedures in this module is a bit strange.
library/set_bbbtree.m:
library/set_unordlist.m:
Remove various unique modes for set operations like
delete/3. (Some of these were commented out anyway).
library/term_to_xml.m:
Fix a spot where line width exceeded 79 characters.
library/array.m:
library/assoc_list.m:
library/random.m:
library/multi_map.m:
library/pqueue.m:
library/queue.m:
library/bool.m:
library/char.m:
library/construct.m:
library/counter.m:
library/deconstruct.m:
library/eqvclass.m:
library/gc.m:
library/io.m:
library/sparse_bitset.m:
library/stack.m:
library/std_util.m:
library/store.m:
library/string.m:
library/term.m:
library/term_io.m:
library/type_desc.m:
library/varset.m:
As above.