library/array.m:
library/char.m:
library/float.m:
library/int.m:
library/int16.m:
library/int32.m:
library/int64.m:
library/int8.m:
library/list.m:
library/one_or_more.m:
library/string.m:
library/tree234.m:
library/uint.m:
library/uint16.m:
library/uint32.m:
library/uint64.m:
library/uint8.m:
library/version_array.m:
Mark the X_to_doc function in each of these modules as obsolete,
and make it a forwarding function to the actual implementation
in pretty_printer.m. The intention is that when these forwarding
functions are eventually removed, this will also remove the dependency
of these modules on pretty_printer.m. This should help at least some
of these modules escape the giant SCC in the library's dependency graph.
(It does not make sense that a library module that adds code to increment
an int thereby becomes dependent on pretty_printer.m through int.m.)
library/pretty_printer.m:
Move all the X_to_doc functions from the above modules here.
Fix the one_or_more_to_doc function, which was
- missing the comma between the two arguments of the one_or_more
function symbol, and
- would print "..., ...]" instead of just "...]" at the end of the
tail list when that list exceeded the limits of the specified pp_params.
Rename one of the moved types along with its function symbols,
to reduce ambiguity.
Put arrays before their indexes in the argument lists of some of
the moved functions.
Some of the moved X_to_doc functions for compound types returned
a doc that had an indent wrapper. These indents differed between the
various X_to_doc functions without any visible reason, but they are
also redundant. The callers can trivially add such wrappers if they
want to, but taking them off, if they want them off, is harder.
Eliminate the problem by deleting all such indent wrappers.
Add formatters for the intN, uintN and one_or_more types to the
default formatter map. Their previous absence was an oversight.
Add a function, get_formatter_map_entry_types, that returns the ids
of the types in the formatter_map given to the function. It is intended
for tests/hard_coded/test_pretty_printer_defaults.m, but is exported
for anyone to use.
tests/hard_coded/test_pretty_printer_defaults.{m,exp}:
Use get_formatter_map_entry_types to print the default formatter map
in a format that is much more easily readable.
NEWS:
Announce all the user-visible changes above.
... along with their unchecked equivalents. These differ from <<, >> and
their unchecked equivalents in that they take the shift amount as a uint,
instead of an int.
library/int.m:
library/int16.m:
library/int32.m:
library/int64.m:
library/int8.m:
library/uint.m:
library/uint16.m:
library/uint32.m:
library/uint64.m:
library/uint8.m:
As above. The unchecked versions have only declarations, since
these operations have been recognized as builtins for a while now.
NEWS:
Document the new operations, and the recent change to recognize
<<u and >>u as single tokens, and fix a typo in a recent addition.
configure.ac:
Require the compiler to be sufficiently recent to be able to parse
<<u and >>u as operators.
compiler/options.m:
Provide a way for a later change to configure.ac to detect the presence
of this change.
tests/hard_coded/bitwise_int.exp:
tests/hard_coded/bitwise_int.exp2:
tests/hard_coded/bitwise_int.m:
tests/hard_coded/bitwise_int16.exp:
tests/hard_coded/bitwise_int16.m:
tests/hard_coded/bitwise_int32.exp:
tests/hard_coded/bitwise_int32.m:
tests/hard_coded/bitwise_int64.exp:
tests/hard_coded/bitwise_int64.m:
tests/hard_coded/bitwise_int8.exp:
tests/hard_coded/bitwise_int8.m:
tests/hard_coded/bitwise_uint.exp:
tests/hard_coded/bitwise_uint.exp2:
tests/hard_coded/bitwise_uint.m:
tests/hard_coded/bitwise_uint16.exp:
tests/hard_coded/bitwise_uint16.m:
tests/hard_coded/bitwise_uint32.exp:
tests/hard_coded/bitwise_uint32.m:
tests/hard_coded/bitwise_uint64.exp:
tests/hard_coded/bitwise_uint64.m:
tests/hard_coded/bitwise_uint8.exp:
tests/hard_coded/bitwise_uint8.m:
Check that <<u and >>u compute the same results as << and >> respectively.
NEWS:
Mention all the user-visible changes below.
library/enum.m:
Add the typeclass uenum, which is a version of the existing enum typeclass
that maps items to uints, not ints. It also uses a semidet predicate,
not a semidet function, to get back to the item from the uint.
library/sparse_bitset.m:
library/fat_sparse_bitset.m:
Make these modules operate on uints, which means requiring the items
in the sets to be instances of uenum, not enum.
If a few places, improve loops by doing previously-repeated conversions
of [u]ints into <offset, bit-to-set> pairs just once.
library/counter.m:
Define ucounters, which allocate uints. Improve documentation.
library/digraph.m:
Change digraph_keys from ints to uints, since we put them into
sparse_bitsets.
library/int.m:
Make int an instance of the uenum typeclass. This can help users
who currently put ints into sparse_bitsets.
library/pprint.m:
Prettyprint sparse_bitsets as lists of uints.
library/term.m:
Make vars instances of uenum as well as enum.
library/uint.m:
Make uint an instance of the uenum typeclass.
Add the ubits_per_uint function, which allows some casts to be avoided.
compiler/make.deps_set.m:
Change the indexes we put into sparse_bitsets from ints to uints.
compiler/make.make_info.m:
Change the source of those indexes from ints to uints.
compiler/make.top_level.m:
compiler/make.util.m:
Conform to the changes above.
compiler/pre_quantification.m:
Change zones from ints to uints, since we put them into sparse_bitsets.
tests/hard_coded/int_uenum.{m,exp}:
tests/hard_coded/Mmakefile:
Enable the new test case.
tests/valid/use_import_only_for_instance.m:
Update this extract from library/digraph.m the same way as
library/digraph.m itself.
compiler/add_clause.m:
Generate a warning for mode-specific clauses when the clause is for
a predicate that has only one mode, provided that the warning is enabled.
compiler/options.m:
Add an option to enable this warning.
doc/user_guide.texi:
Document this option.
library/exception.m:
library/int.m:
library/rtti_implementation.m:
library/string.m:
Delete modes from clause heads that would get this warning.
tests/valid/spurious_purity_warning.m:
Delete modes from clause heads that would get this warning.
Do not interleave predicate definitions.
tests/warnings/unneeded_mode_specific_clause.{m,exp}:
A test case for this warning.
tests/warnings/Mmakefile:
Enable the new test case.
tests/invalid/multimode_syntax.err_exp:
Expect the new warning.
In the Mercury standard library, every exported predicate or function
has (or at least *should* have) a comment that documents it, including
the meanings of its arguments. About 35-40% of these modules put `'s
(left and right quotes) around the names of the variable representing
those arguments. Some tried to do it consistently (though there were spots
with unquoted or half quoted names), while some did it only a few places.
This is inconsistent: we should either do it everywhere, or nowhere.
This diff makes it nowhere, because
- this is what the majority of the standard library modules do;
- this is what virtually all of the modules in the compiler, profiler,
deep_profiler etc directories do;
- typing all those quotes when adding new predicates in modules that
follow this convention is a pain in the ass; and because
- on many modern terminals, `' looks non-symmetrical and weird.
Likewise, the comment explaining a predicate often started with
% `predname(arguments)' returns ...
This diff deletes these quotes as well, since they add nothing useful.
This diff does leave in place quotes around code fragments, both terms
and goals, where this helps delineate the boundaries of that fragment.
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/*.m:
Specifically, delete any predicates and functions whose `pragma obsolete'
dates from 2018 or before. Keep the ones that were obsoleted
only this year or last year.
NEWS:
Announce the changes.
tests/debugger/io_tab_goto.m:
tests/debugger/tabled_read.m:
tests/declarative_debugger/io_stream_test.m:
tests/declarative_debugger/tabled_read_decl.m:
tests/declarative_debugger/tabled_read_decl_goto.m:
tests/general/array_test.m:
tests/hard_coded/mutable_init_impure.m:
tests/hard_coded/remove_file.m:
tests/tabling/mercury_java_parser_dead_proc_elim_bug.m:
tests/tabling/mercury_java_parser_dead_proc_elim_bug2.m:
tests/valid/mercury_java_parser_follow_code_bug.m:
Replace references to predicates and functions that this diff deletes
with their suggested replacements.
In several test cases, bring the programming style up to date.
tests/hard_coded/shift_test.{m,exp}:
Most of this test case tested the now-deleted legacy shift operations.
Replace these with tests of their non-legacy versions, including
testing for the expected exceptions.
tests/hard_coded/shift_test.{m,exp}:
Don't pass --no-warn-obsolete when compiling shift_test.m anymore.
library/private_builtin.m:
As above. The code recognizing them as builtins was added a few weeks ago.
configure.ac:
Require the installed compiled to contain that code.
compiler/options.m:
Provide a way to test whether the compiler has *this* diff.
library/int.m:
Delete int.unsigned_lt, and use private_builtin.unsigned_lt instead.
tests/hard_coded/unsigned_lt_le.{m,exp}:
A test case for the two operations.
tests/hard_coded/Mmakefile:
Enable the new test case.
Step 1 is making it a builtin; step 2 will be declaring it.
(We won't define it, since builtins may not have definitions.)
compiler/builtin_ops.m:
Make unsigned_lt a builtin operation, and recognize
private_builtin.unsigned_lt which does not exist yet,
as that operation.
We already had a builtin operation unsigned_le, which the compiler
generated references to internally. Recognize private_builtin.unsigned_le
as this builtin operation. The difference is that just having a builtin op
is enough for compiler passes inside the LLDS/MLDS/ELDS backends
that generate LLDS/MLDS/ELDS code that refer to the builtin op,
(though the ELDS backend does not have any code that does such things),
while code that wants to create references to builtin ops in the HLDS
needs to have access to the predicate declaration of each builtin.
So far, we intend to use only unsigned_lt, not unsigned_le, in this manner,
but treating two such closely related ops differently would violate
the law of least astonishment.
Fix an old XXX that is related to this diff only in affecting the same
type: standardize on add/sub/mil/div terminology over
plus/minus/times/divide terminology.
compiler/erl_call_gen.m:
Abort on references to unsigned_lt as well as unsigned_le.
compiler/llds_out_data.m:
compiler/ml_global_data.m:
compiler/mlds_to_c_data.m:
The C backends already implemented unsigned_le. Handle unsigned_lt
the same way as unsigned_le, only with s/<=/</.
compiler/mlds_to_cs_data.m:
Implement both unsigned_lt and unsigned_le, using the C# foreign_proc
implementation of unsigned_lt in library/int.m as a basis.
compiler/mlds_to_java_data.m:
Implement both unsigned_lt and unsigned_le, using the Java foreign_proc
implementation of unsigned_lt in library/int.m as a basis.
compiler/options.m:
Provide a way to detect whether the installed compiler has this diff.
We will need such a test in configure.ac for stage 2.
compiler/bytecode.m:
compiler/llds.m:
compiler/mlds_dump.m:
compiler/opt_debug.m:
Conform to the changes above.
library/int.m:
Module qualify references to unsigned_lt. This is to allow the
affected code to compile even after the declaration of unsigned_lt
as a predicate in private_builtin.m. (The last step of this sequence
would be the deletion of both int.unsigned_lt and the references to it.)
library/math.m:
library/exception.m:
Move the domain_error type from math.m to exception.m.
NEWS:
Announce the change as a potentially breaking change.
deep_profiler/query.m:
library/float.m:
library/int.m:
library/int16.m:
library/int32.m:
library/int64.m:
library/int8.m:
library/integer.m:
library/uint.m:
library/uint16.m:
library/uint32.m:
library/uint64.m:
library/uint8.m:
Replace all references to math.domain_error with just domain_error.
Delete imports of math.m where this was the only reason for the import.
Currently, the hash functions for (some of) the primitive types are defined in
three places:
1. The hash_table module.
2. The version_hash_table module (duplicates of the above).
3. Some (but not all) of the library modules for the primitive types.
This change makes the library module for a primitive type provide the hash
function for that type and deprecates the versions in the hash table modules.
Additionally, deprecate the "generic" has functions in the hash table modules.
library/hash_table.m:
library/version_hash_table.m:
As above.
library/char.m:
library/int.m:
library/uint.m:
Add hash/1 and hash/2.
library/float.m:
Add hash/2.
library/robdd.m:
Replace a call to the deprecated function.
NEWS:
Announce the above additions and deprecations.
tests/hard_coded/hash_table_delete.m:
tests/hard_coded/hash_table_test.m:
tests/hard_coded/version_hash_table_delete.m:
tests/hard_coded/version_hash_table_test.m:
Conform to the above change.
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.
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.m:
Make int.abs throw an exception for int.min_int.
Add the new function unchecked_abs/1, whose behaviour is
undefined for int.min_int.
Add the new function nabs/1 which computes the negative
absolute value of an int. Unlike abs, this is defined for
all ints.
NEWS:
Announce the above.
Unrelated change: list int64 and uint64 as reserved type names.
Change int.(<<) and int.(>>) to throw an exception if their second operand is
not in [0, bits_per_int). This brings them into line with the other integer
types.
As a transitional measure, add new functions that provide the old semantics.
library/int.m:
As above.
NEWS:
Announce the above change.
Include the fixed size integer types in the list of reserved type names.
tests/hard_coded/shift_test.m:
Call the legacy versions of the int shift operations.
tests/hard_coded/bitwise_int.{m,exp}:
A new test of bitwise operations for the int type.
(XXX I will add a 32-bit expected output separately.)
tests/hard_coded/Mmakefile:
tests/hard_coded/Mercury.options:
Include the new test case.
Do not warn about the use of the obsolete legacy shift operations.
Begin implementing library support for uints.
Update the compiler to use the uint type.
library/uint.m:
Begin filling this module in.
library/private_builtin.m:
Use the proper argument type for builtin_{unify,compare}_uint
and provide actual implementations for them.
library/table_builtin.m:
Add tabling builtins for uints.
library/string.m:
Add a function to convert a uint to a decimal string.
(XXX NYI for Erlang).
library/io.m:
Add write_uint/[45].
Add the stream instance for uints and text output streams.
library/stream.string_writer.m:
Add put_uint/4.
Support uints in string_writer.write etc.
library/pprint.m:
Make uint an instance of the doc/1 type class.
library/pretty_printer.m:
Add a default formatter for uints.
library/int.m:
Unrelated change: fix formatting.
compiler/builtin_ops.m:
compiler/elds.m:
compiler/elds_to_erlang.m:
compiler/hlds_data.m:
compiler/llds.m:
compiler/llds_out_data.m:
compiler/mercury_to_mercury.m:
compiler/ml_lookup_switch.m:
compiler/mlds.m:
compiler/mlds_to_c.m:
compiler/mlds_to_cs.m:
compiler/opt_debug.m
compiler/parse_tree_out.m:
compiler/parse_tree_out_info.m:
compiler/prog_data.m:
compiler/prog_out.m:
compiler/prog_rep.m:
compiler/hlds_out_util.m:
Use the uint type in places where we should.
compiler/mlds_to_java.m:
Fix a bug that causes us to generate badly typed Java.
For div and mod we need to cast the entire expression to
an int, not just the first operand.
compiler/c_util.m:
compiler/mlds_to_cs.m:
Add predicates for outputting unsigned integers in C and C#.
tests/hard_coded/test_pretty_printer_defaults.exp:
Conform to the above change to the pretty_printer module.
Add the predicate all_true_in_range/3 where
all_true_in_range(P, Low, High) <=>
list.all_true(P, Low .. High)
except that it avoids construction of the list 'Low..High'.
library/int.m:
Add the above predicate.
s/Lo to Hi/Low to High/ in the description of the predicate
nondet_int_in_range/3. We use the latter form when describing
the fold predicates above.
NEWS:
Announce the new predicate.
Adjust an existing entry.
tests/hard_coded/Mmakefile:
tests/hard_coded/int_range_ops.{m,exp}:
Test the new predicate and also test the predicate nondet_in_range/3
since none of the existing tests covered that.
NOTE: this change does not affect the io module -- I've left that for a
separate change.
library/*.m:
As per the recent change to the coding standard, avoid module
qualification in library interfaces where possible.
Reformat declarations and descriptive comments to better utilise
any space freed up by the above.
Add the predicates is_finite/1 and is_zero/1 to the float module.
In C grades the implementation of the former maps down to the isfinite macro
(with C99).
configure.ac:
runtime/mercury_confg.h.in:
Check if the C99 macro isfinite is available.
runtime/mercury_float.h:
Add the macro MR_is_finite for testing if a floating point
number is finite. If the C stdlib provides this operation
directly we use that, otherwise we define it in terms of
MR_is_infinite and MR_is_nan.
library/float.m:
Add the predicates is_finite/2 and is_zero/2.
Expand tabs in this file.
Fix capitalization in documentation.
library/int.m:
Fix inconsistent capitalization in a spot.
library/string.m:
Use is_finite/1 in place of negating is_nan_or_infinite/1.
library/int.m:
Avoid warnings about overflows in implicit constant conversions in the
implementations of {min,max}_int/0 on Cygwin. The C compiler is
complaining about where we assign LONG_MIN or LLONG_MIN to a 32-bit
MR_Integer. This only occurs in code branches that are dead when
MR_Integer is 32-bit, so the fix here is just to put in some explicit
casts.
library/bimap.m:
Add a predicate for testing semantic equality of bimaps.
library/assoc_list.m:
Add fold_values with two or three accumulator arguments.
library/int.m:
Add fold_{up,down} with three accumulator arguments.
library/map.m:
library/tree234.m;
Add foldl_values with two or three accumulator arguments.
NEWS:
Announce the above additions.
Reformat the existing changes to the pqueue module slightly
library/int.m:
LLONG_{MIN,MAX} are the standard (C99) names for the limits
of the long long int type; use them in preference to LONG_LONG_{MIN,MAX},
which are a GNU C thing.
Make the use of the above macros conditional on them actually being
defined since we cannot guarantee that they will be defined if the
C compiler is not in C99 mode (or something similar to it).
library/int.m:
On 64-bit Windows MR_Integer has the same size as C's long long type; the
implementations of int.{min,max}_int/0 did not handle this case.
Branches: 11.07, main
library/array.m:
Add an unsafe version of field update for arrays,
'unsafe_elem :='/3.
Support foldl and foldr over arrays with 3-5 accumulators.
Privately export the predicate dynamic_cast_to_array/2 from
this module. Previously, there were several definitions of
this scattered throughout the library.
Use unsafe operations (which are more efficient) in several places
where it is safe to do so.
Use state variable notation in more places.
library/int.m:
Add an additional mode to each of int.fold_up2/7 and int.fold_down2/7
with the modes (array_di, array_uo).
library/hash_table.m:
library/pprint.m:
library/version_hash_table.m:
Delete duplicate definitions of dynamic_cast_to_array/2 and use
the definition exported from the array module instead.
NEWS:
Announce the above.
Branches: main
library/cord.m:
Add cord.init/0 for consistency with other modules.
library/int.m:
library/char.m:
Group function definitions with the corresponding
predicate definition.
library/version_store.m:
Fix indentation.
NEWS:
Announce the addition of cord.init/0.
Fix some earlier entries.
Estimated hours taken: 1
Branches: main
library/Mmakefile:
Make a module list easier to modify.
library/array.m:
library/int.m:
Add predicates needed by g12.
NEWS:
Mention the new predicates.
Remove announcements of new modes for predicates which are themselves
new.
Branches: main, 10.04
Allow inlining of Java foreign_procs.
This revealed a problem with directly using the `succeeded' flag directly as
the success indicator in Java foreign_procs. When the code of the foreign_proc
becomes a nested function, and after nested functions are eliminated, there may
not be a variable called `succeeded' in that context; it is moved into
environment struct, and the transformation is not able to update handwritten
code to reflect that. The solution is to declare a local variable for the
foreign_proc, let the handwritten code assign that, then assign its final
value to the `succeeded' flag with an MLDS statement.
We take the opportunity to name the local variable `SUCCESS_INDICATOR', in
line with other backends.
compiler/inlining.m:
Allow inlining of Java foreign_procs.
compiler/ml_foreign_proc_gen.m:
In the code generated for semidet Java foreign_procs, declare a local
`SUCCESS_INDICATOR' variable and assign its value to the `succeeded'
flag afterwards.
Add braces to give the foreign_proc variables a limited scope.
compiler/make_hlds_warn.m:
Conform to renaming.
doc/reference_manual.texi:
Update documentation for the renaming of the `succeeded' variable.
library/array.m:
library/bitmap.m:
library/builtin.m:
library/char.m:
library/construct.m:
library/dir.m:
library/exception.m:
library/float.m:
library/int.m:
library/io.m:
library/math.m:
library/private_builtin.m:
library/rtti_implementation.m:
library/string.m:
library/thread.m:
library/time.m:
library/type_desc.m:
library/version_array.m:
Conform to renaming.
Fix problems with Java foreign_procs that may now be copied into other
modules when intermodule optimisation is enabled, some by disallowing
the procedures from being duplicated, some by making referenced
classes/fields `public'.
[Some of the `may_not_duplicate' attributes may not indicate actual
problems, just that it seems not worthwhile inlining calls to the
procedure.]
extras/solver_types/library/any_array.m:
tests/hard_coded/equality_pred_which_requires_boxing.m:
tests/hard_coded/external_unification_pred.m:
tests/hard_coded/java_test.m:
tests/hard_coded/redoip_clobber.m:
tests/hard_coded/user_compare.m:
tests/valid/exported_foreign_type2.m:
tests/warnings/warn_succ_ind.m:
tests/warnings/warn_succ_ind.exp3:
Conform to renaming.
Estimated hours taken: 4
Branches: main
Add a new standard library module for working with the Gregorian
calendar.
NEWS:
Mention the new module.
library/calendar.m:
The new module.
library/int.m:
Fix a typo in a comment.
library/library.m:
Add the new module to the list of standard library modules.
tests/hard_coded/Mmakefile:
tests/hard_coded/calendar_test.exp:
tests/hard_coded/calendar_test.m:
Test the new module.
library/int.m:
Add more modes to the int.fold* family of predicates.
Re-order the mode declarations as-per the ordering of
the higher-order predicates in the list module.
library/list.m:
Add another mode of list.foldl2/6.
Re-order the mode declarations for list.foldl/4 to conform
to the style used for the other fold-style predicates in
this module.
Estimated hours taken: 16
Branches: main
Implement the proc command of the deep profiler using the report mechanism.
Some of the detailed changes also address Paul's post-commit review of my
previous diff.
deep_profiler/report.m:
Define the representation of the proc report.
Change some names to be more consistent.
deep_profiler/profile.m:
Add a type for use in report.m.
Document the fields of an existing type.
deep_profiler/create_report.m:
Add code to create proc reports.
Change some names to be more consistent.
Fix a bug: avoid divide by zero exceptions in some rare cases.
deep_profiler/measurement units.m:
Fix a bug: avoid divide by zero exceptions in some rare cases.
deep_profiler/display_report.m:
Add the code for converting proc reports to displays. This required
rewriting almost everthing in this module to remove the assumption,
which was previously embedded in many places, that the code is part
of the implementation of the top_procs command. The new code is
separated into two parts; the command-specific parts, and the parts
that should be usable for all commands. (The reusable part is much
bigger.)
deep_profiler/display.m:
Expand the display representation to allow the specification of
- plain text as distinguished from headings
- paragraph breaks
- pseudo-links, i.e. text fragments that are formatted like links
- table separator rows
- table cells that span more than one column
which are used in the new version of display_report.m.
Simplify the mechanism for setting up table header groups.
deep_profiler/html_format.m:
Handle the changes in display.m.
Fix some anomalies in the formatting of lists and tables.
Group related code together.
deep_profiler/query.m:
Provide a switch for selecting which of the two mechanisms,
the old direct generation of HTML or the new indirect generation
through the report and display structures, should generate the HTML
page for a command that both mechanisms can implement. The default
is the new mechanism, but it can be overridden by implementors
by creating a file called "/tmp/old_deep_profiler".
Switch the default handling of the proc command over to the new
mechanism.
Rename some types and function symbols to make them more consistent
and expressive.
Generate more informative error messages for domain error exceptions.
deep_profiler/mdprof_cgi.m:
Add a mechanism for decoding the links in the generated pages.
The mechanism takes the form of three new options: --decode,
--decode-cmd, and --decode-prefs. When one or more of these are given,
mdprof_cgi will not do its usual stuff, instead of just loops waiting
for lines whose contents it will then try to decode as queries,
as commands and/or as preferences.
deep_profiler/Mercury.options:
Try to postpone thrashing in the deep compiler when compiled in
debug grades, by compiling their contents with shallow tracing.
deep_profiler/array_util.m:
Make shallow tracing effective by moving the deep recursions
into non-exported predicates.
deep_profiler/callgraph.m:
deep_profiler/canonical.m:
deep_profiler/startup.m:
Convert the debugging code to use trace goals.
deep_profiler/cliques.m:
deep_profiler/read_profile.m:
Convert the debugging code to use trace goals.
Use more expressive names for lots of variables.
In read_profile.m, avoid an unnecessary repackaging of data.
deep_profiler/util.m:
Fix some grammar errors in a comment, and comment some code to use
state variables.
deep_profiler/interface.m:
Fix some grammar errors in a comment.
deep_profiler/mdprof_feedback.m:
Change some variable names to be consistent with the other modules.
library/float.m:
library/int.m:
Make the messages in the domain errors we throw more expressive.
library/io.m:
Minor style changes.
Estimated hours taken: 4
Branches: main
Define pretty_printer formatters for some common standard library types.
Include these formatters in the default pretty_printer formatter_map.
Add a useful function to the pretty_printer interface.
library/array.m:
library/char.m:
library/float.m:
library/int.m:
library/list.m:
library/string.m:
library/tree234.m:
Add <type>_to_doc functions.
library/pretty_printer.m:
Added function format_arg/1.
Initialise the default formatter_map to use the <type>_to_doc
functions.
tests/hard_coded/Mmakefile:
tests/hard_coded/test_pretty_printer_defaults.exp:
tests/hard_coded/test_pretty_printer_defaults.m:
Test case.
Estimated hours taken: 16
Branches: main
Implement the TypeCtorInfo RTTI so that generic compare
and unify work via rtti_implementation.
However after discussion with zs, this current design of
RTTI has to be adapted to become more erlang specific, due
to the different data representation on the erlang backend.
The current code will serve as a template for this new design
though, which is why it is being checked in.
Add various erlang library implementations which are
needed to run useful programs when testing the erlang backend.
compiler/elds.m:
Add a type_info_id.
compiler/elds_to_erlang.m:
We now generate type_ctor_info's so call them.
compiler/erl_rtti.m:
After discussions with zs, type_info and pseudo_type_infos
should never occur on the erlang backend as they are needed
for gc and the debugger so throw an exception for them.
Add an implementation of creating a static type_info, but which
isn't used in case we need it again later.
Create type_ctor_info with all the fields except the
TypeFunctors, the TypeLayout and the FunctorNumberMap
compiler/special_pred.m:
Make sure we generate RTTI for the builtin types.
library/builtin.m:
library/char.m:
library/exception.m:
library/float.m:
library/int.m:
library/io.m:
library/lexer.m:
library/math.m:
library/mutvar.m:
library/ops.m:
library/par_builtin.m:
library/private_builtin.m:
library/rtti_implementation.m:
library/solutions.m:
library/store.m:
library/string.m:
library/table_builtin.m:
library/thread.semaphore.m:
library/time.m:
library/type_desc.m:
Erlang implementations of std library functions.
Estimated hours taken: 12
Branches: main
compiler/use_local_vars.m:
Extend this optimization to handle temporaries being both defined in
and used by foreign_proc_code instructions. This should eliminate
unnecessary accesses to the MR_fake_reg array, and thus speed up
programs that use foreign code a lot, including typeclass- and
tabling-intensive programs, since those features are implemented using
inline foreign code. I/O intensive should also benefit, but not much,
since the cost of the I/O itself overwhelms the cost of the
MR_fake_reg accesses.
Group together the LLDS instructions that are handled similarly.
Factor out some common code.
compiler/opt_util.m:
Allow for the fact that foreign_proc_codes can now refer to
temporaries.
compiler/opt_debug.m:
Print more useful information about foreign_proc_code components.
compiler/prog_data.m:
Rename the types and function symbols of the recently added
foreign_proc attributes to avoid clashing with the keywords
representing them in source code.
Add a new foreign_proc attribute, proc_may_duplicate that governs
whether the body of foreign code is allowed to be duplicated.
compiler/table_gen.m:
Include does_not_affect_liveness among the annotations for the
foreign_proc calls generated by this module. Some of these procedures
affect memory beyond their arguments, but that memory is in tables,
not in unlisted registers.
Allow some of the smaller code fragments generated by this module
to be duplicated.
compiler/inlining.m:
Respect the may_not_duplicate foreign_proc attribute.
compiler/pragma_c_gen.m:
Transmit any annotations about liveness from the HLDS to the LLDS,
since without does_not_affect_liveness annotations use_local_vars.m
cannot optimize foreign_proc_codes.
Transmit any annotations about may_duplicate from the HLDS to the LLDS,
since with them jumpopt can do a better job.
compiler/llds.m:
Use the new foreign_proc attribute instead of a boolean to represent
whether a foreign code fragment may be duplicated.
compiler/simplify.m:
Generate an error message if a may_duplicate or may_not_duplicate
attribute on a foreign_proc conflicts with a no_inline or inline pragma
(respectively) on the predicate it belongs to.
compiler/hlds_pred.m:
Fix some comment rot.
compiler/jumpopt.m:
compiler/livemap.m:
compiler/proc_gen.m:
compiler/trace_gen.m:
Conform to the changes above.
doc/reference_manual.texi:
Document the new foreign_proc attribute.
library/array.m:
library/builtin.m:
library/char.m:
library/dir.m:
library/float.m:
library/int.m:
library/io.m:
library/lexer.m:
library/math.m:
library/private_builtin.m:
library/string.m:
library/version_array.m:
Add does_not_affect_liveness annotations to the C foreign_procs that
deserve them.
configure.in:
Require the installed compiler to support does_not_affect_liveness.
tests/invalid/test_may_duplicate.{m,err_exp}:
Add a new test case to test the error checking code in simplify.m.
tests/invalid/Mmakefile:
Enable the new test case.
Estimated hours taken: 1
Branches: main
compiler/table_gen.m:
compiler/unused_args.m:
Instead of printing each error message immediately, pass them back to
mercury_compile.m to print them all at once.
compiler/mercury_compile.m:
Do the printing.
compiler/hlds_goal.m:
compiler/inst_graph.m:
library/float.m:
library/int.m:
library/math.m:
Rename some predicates to avoid ambiguity.
compiler/*.m:
Conform to the changes above.
Estimated hours taken: 32
Branches: main
Add to the library a new module called tree_bitset.m, which is a version
of sparse_bitset.m modified to allow algorithms (for union, intersection etc)
that do not require scanning the entire list of bitmaps.
Use this module as the set representation in quantification.
This reduces the time to compile training_cars_full.m from 250 seconds
to 110 seconds (a reduction of about 56%). As for compiling ordinary files,
the time taken for our usual speedtest (compiling the six largest files
of the compiler itself) is reduced from 20.2 seconds to 19.5 (a reduction
of about 3.5%).
library/tree_bitset.m:
Add the new module.
library/library.m:
Include the new module in the library.
library/int.m:
Improve the formatting of some comments.
library/sparse_bitset.m:
Fix a bug in a comment.
compiler/quantification.m:
Use the new module in the library.
Avoid using predicates that exist in sparse_bitset.m and in set.m
but are available only as functions in tree_bitset.m.
Rename a predicate to avoid ambiguity.
compiler/hlds_out.m:
Output the number of variables in a predicate or procedure when
printing the set of variables and their types.
tests/hard_coded/test_tree_bitset.{m,exp}:
tests/hard_coded/tree_bitset_tester.m:
Two modules of a new test case, modelled on the test case that tests
sparse_bitsets, for testing tree_bitsets.
tests/hard_coded/Mmakefile:
Don't enable the new test case yet, since the .exp file is only a dummy
so far.
Estimated hours taken: 0.1
Branches: main
Delete library predicates that were marked as obsolete prior to the 0.12
release.
library/int.m:
library/integer.m:
library/rational.m:
library/rbtree.m:
Delete some obsolete predicates.