compiler/add_pragma.m:
The status checks in this module used to check for only one
of the four possible combinations of <is pragma exported, is the
pred the pragma is for expored>, even though we may want to generate
errors or warnings in three of those combinations. Fix this.
If an ambiguous pragma applies to more than one predicate, handle
the status checks of each separately.
When adding fact table pragmas to the HLDS, replace several lines
of code that reuse an existing largish predicate with the single line
of code from that predicate that we actually need.
Stop representing the statuses of pragmas using the pred_status type,
since the item_mercury_status that all items come with is adequate
for all our needs, and is impossible to confuse with the status
of the pred_info they refer to.
library/exception.m:
library/require.m:
Move termination pragmas for exported predicates and functions
from the implementation section to the interface section. This
avoids a warning that we now generate in such situations.
tests/term/exception_analysis_test.trans_opt_exp:
tests/term/exception_analysis_test2.trans_opt_exp:
Expected improved termination analysis results now that we export
termination pragmas that used to be kept private.
tests/warnings/foreign_term_invalid.{m,exp}:
Avoid warnings about keeping decl pragmas about exported predicates
private by moving them into the interface.
Fix the formatting of the top-of-module comment.
Expect updated line numbers.
tests/warnings/pragma_term_conflict.{m,exp}:
Don't avoid a warning about keeping decl pragmas about exported predicates
private. Instead, document it as an additional purpose of this test.
Expect both the extra warning and updated line numbers.
tests/invalid/pragma_export.{m,err_exp}:
A new test case for testing the error message for inappropriately
exported pragmas.
tests/invalid/Mmakefile:
Enable the new test case.
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.
One option, --warn-non-contiguous-decls, generates warnings if the
mode declarations of a predicate or function aren't in a contiguous block
immediately following the pred or func declaration. Since this is a rare
kind of "style error", this option is enabled by default.
Two options, --warn-inconsistent-pred-order-clauses and
--warn-inconsistent-pred-order-foreign-procs, warn about inconsistencies
between (a) the order in which predicates (and functions) are declared,
and (b) the order in which they are defined. The two options differ in
their scope. The latter applies to all predicates and functions defined
in the module, while the former applies only to those whose definitions
include Mercury clauses.
Since an exported predicate or function may need nonexported auxiliary
predicates and/or functions, imposing a single order the declarations and
definitions of *all* the predicates and functions in a module is not a good
idea. Instead, both options divide the predicates and functions defined
in a module two groups, the exported and the nonexported, and expect
a consistent order only within each group.
The result is output that looks like this:
time.m:021: Warning: the order of the declarations and definitions of the
time.m:021: exported predicates is inconsistent, as shown by this diff:
time.m:021:
time.m:021: --- declaration order
time.m:021: +++ definition order
time.m:021: @@ -1,7 +1,7 @@
time.m:021: predicate `clock'/3
time.m:021: -predicate `time'/3
time.m:021: predicate `times'/4
time.m:021: function `clk_tck'/0
time.m:021: +predicate `time'/3
time.m:021: function `difftime'/2
time.m:021: predicate `localtime'/4
time.m:021: function `localtime'/1
compiler/options.m:
doc/user_guide.texi:
Add the new options.
compiler/style_checks.m:
A new module that generates the new warnings if warranted.
compiler/check_hlds.m:
compiler/notes/compiler_design.html:
Include and document the new module.
compiler/mercury_compile_front_end.m:
Invoke the new module if any of the three new options is set.
compiler/hlds_pred.m:
Record the item number of every predicate, function, and mode declaration
in the module being compiled. We need this for information for the
new warnings.
compiler/hlds_module.m:
Record the context of the module declaration. We use this context
for warnings about inconsistent order, since there isn't a better one.
compiler/hlds_clauses.m:
Add a mechanism to retrieve the item numbers of a set of clauses
even if they are contiguous.
Document some old data types.
compiler/error_util.m:
Add a new phase for style checks.
compiler/accumulator.m:
compiler/add_class.m:
compiler/add_mutable_aux_preds.m:
compiler/add_pragma_tabling.m:
compiler/add_pred.m:
compiler/add_solver.m:
compiler/add_special_pred.m:
compiler/check_typeclass.m:
compiler/clause_to_proc.m:
compiler/from_ground_term_util.m:
compiler/lambda.m:
compiler/make_hlds.m:
compiler/make_hlds_passes.m:
compiler/mercury_compile.m:
compiler/par_loop_control.m:
compiler/polymorphism.m:
compiler/stm_expand.m:
compiler/table_gen.m:
compiler/unify_proc.m:
Conform the changes to the HLDS above.
compiler/typecheck_errors.m:
Fix style of error messages.
library/array2d.m:
library/assoc_list.m:
library/benchmarking.m:
library/bit_buffer.write.m:
library/bool.m:
library/builtin.m:
library/construct.m:
library/cord.m:
library/counter.m:
library/float.m:
library/injection.m:
library/lazy.m:
library/lexer.m:
library/ops.m:
library/private_builtin.m:
library/profiling_builtin.m:
library/prolog.m:
library/queue.m:
library/rational.m:
library/require.m:
library/stack.m:
library/std_util.m:
library/store.m:
library/thread.semaphore.m:
library/tree234.m:
library/univ.m:
library/version_store.m:
Move declarations or definitions around to avoid some of the warnings
that we can now generate. (There are many more left.)
Make some minor style improvements in the process.
tests/warnings/inconsistent_pred_order.{m,exp}:
tests/warnings/non_contiguous_decls.{m,exp}:
New test cases to test the new options. They are both copies of
tests/benchmarks/queens.m, with intentionally-screwed-up style.
tests/warnings/Mmakefile:
Enable the new test cases.
tests/warnings/Mercury.options:
Specify the options being tested for the new test cases.
tests/benchmarks/queens.m:
Bring the style of this module up to date (before copying it).
tests/invalid/mode_decl_in_wrong_section.err_exp:
Expect the warnings we now generate.
library/string.m:
Avoid unnecessary use of higher order code in the implementation of
string.format. Avoid the unnecessary insertion of empty manifest strings
between actual format conversions.
Represent the optional width and precision in string.format as integers,
not strings, since the strings take up more space and require more time
to create and to process.
Simplify the code implementing word_wrap.
Give some variables better names.
Clarify some documentation.
Call unexpected instead of error in cases where the source of a problem
can only be a software bug inside string.m, and not bad input supplied
from outside of it.
Don't mention the arity of a predicate that is the source of an exception,
since the predicate's identity is unambiguous even without the arity,
and since other exceptions also don't mention arities.
library/require.m:
Add two-argument versions of error/1 and func_error/1, to allow
the name of the predicate and the error message to be passed separately,
possible with the first being specified as $pred. string.m had several
places where these were being appended on the fly.
library/char.m:
Clarify some code.
NEWS:
Mention the additions to require.m.
Estimated hours taken: 0.5
Branches: main
Fix some things I found while chasing Mantis bug 103.
compiler/handle_options.m:
Add a dump alias to make debugging lco easier.
compiler/instmap.m:
Add a utility predicate for use by (a now-unneeded version of) lco.m.
compiler/unify_gen.m:
Minor cleanups.
library/require.m:
Add four-argument versions of expect and expect_not, to allow
all uses of this_file to be replaced by $module, $pred.
NEWS:
Document the new predicates in require.m, as well as expect_not/3,
which I added earlier.
Estimated hours taken: 60
Branches: main
A rewrite of the state variable transformation from the ground up.
The initial aim was to avoid situations (encountered in the g12 project)
in which the old state variable transformation generated code that
did not satisfy the mode checker, due to unnecessary unifications.
The new system tries hard to minimize the number of unifications added to the
program. It does this by relying extensively on the idea that in a branched
structure such as an disjunction, if two branches both update the same state
variable, and the variables representing the last state of the state variable
in the two branches are (say) X and Y, and we pick X to represent the current
state after the disjunction, then we don't have to put the assignment X := Y
into the second branch; instead, we can RENAME Y to X in that branch.
To avoid renaming a goal several times (for itself, for its parent, for its
grandparent etc), we delay all renamings until the end, when we do it all
in one traversal.
The old state var system was opaque and hard to understand, partly because
its basic operations did different things in different contexts. The new system
is a much more direct expression of the intuitive meaning of state variables;
it keeps track of their state much as the programmer writing the original code
would. It should therefore be significantly easier to understand and to modify
in the future.
The new system can also detect more kinds of errors in the use of state
variables. For example it can discover that some branches of a disjunction or
if-then-else set the initial value of a state variable and some do not.
This is ok if the non-setting-branch cannot succeed; if it can, then it is
a bug. We therefore generate messages about such branches, but print them
only if mode analysis finds a bug in the procedure, since in that case,
the lack of initialization may be the cause of the bug.
doc/reference_manual.texi:
Replaced an old example that didn't know what it was talking about,
and thoroughly confused the issue of what is legal use of state
variables and what is not.
compiler/state_var.m:
Rewrite this module along the lines mentioned above.
compiler/options.m:
Add two new options. One, warn-state-var-shadowing, controls whether
we generate warnings for one state var shadowing another (which
G12 has lots of). The other, --allow-defn-for-builtins, is for
developers only; it is needed to bootstrap changes that add new
builtins. I needed this for a form of the state variable transformation
that used calls to a new builtin predicate to copy the values of state
variables in branches that did not modify them, even though other
branches did. I ultimately used unifications to do this copying,
for reasons documented in state_var.m.
compiler/add_clause.m:
compiler/add_pragma.m:
Respect the new --allow-defn-for-builtins option.
(Previously, we changed the code that now looks up the value of the
option.)
doc/user_guide.texi:
Document the --warn-state-var-shadowing option.
Fix some old documentation about dump options.
compiler/simplify.m:
Fix an old oversight: list the predicates in table_builtin.m that may
have calls introduced to them by table_gen.m.
compiler/superhomogeneous.m:
compiler/field_access.m:
compiler/add_clause.m:
compiler/goal_expr_to_goal.m:
Together with state_var.m, these modules contain the transformation
from the parse tree to the HLDS. Since the change to state_var.m
involves significant changes in its interface (such as separating out
the persistent and location-dependent aspects of the information needed
by the state variable transformation), and needing callbacks at
different points than the old transformation, these modules had to
change extensively as well to conform.
goal_expr_to_goal.m is a new module carved out of add_clause.m.
It deserves a module of its own because its code has a significantly
different purpose than add_clause.m. The two separate modules each
have much better cohesion than the old conjoined module did.
In superhomogeneous.m, replace two predicates that did the same thing
with one predicate.
compiler/make_hlds.m:
compiler/notes/compiler_design.html.m:
Mention the new module.
compiler/hlds_goal.m:
Add a mechanism to do the kind of incremental renaming that the state
variable transformation needs.
Add some utility predicates needed by the new code in other modules.
compiler/hlds_clause.m:
compiler/hlds_pred.m:
Add an extra piece of information to clauses and proc_infos:
a list of informational messages generated by the state variable
transformation about some branches of branched goals not giving initial
values to some state variables, while other branches do.
The state variable transformation fills in this field in clauses
where relevant.
compiler/clause_to_proc.m:
Copy this list of messages from clauses to proc_infos.
compiler/modes.m:
When generating an error message for a procedure, include this list
of messages from the state var transformation in the output.
compiler/handle_options.m:
Add a dump alias for debugging the state var transformation.
compiler/hlds_out_goal.m:
Add a predicate that is useful in trace messages when debugging
the compiler.
compiler/hlds_out_pred.m:
Print goal path and goal id information in clauses as well as
proc_infos, since the state var transformation now uses goal ids.
compiler/prog_item.m:
In lists of quantified vars in scope headers, separate out the vars
introduced as !S from those introduced as !.S and !:S. This makes it
easier for the state var transformation to handle them.
Document that we expect lists of quantified variables and state
variables to contain no duplicates. The state var transformation
is slightly simpler if we impose this requirement, and quantifying
a variable twice in the same scope does not make sense, and is
therefore almost certainly an error.
compiler/prog_io_util.m:
Generate error messages when a variable or state variable IS
listed twice in the same quantification list.
Factor out some code used to generate error messages.
compiler/typecheck.m:
Conform to the changes above.
Break a very large predicate into two smaller pieces.
compiler/add_class.m:
compiler/add_pragma.m:
compiler/add_pred.m:
compiler/assertion.m:
compiler/dead_proc_elim.m:
compiler/dependency_graph.m:
compiler/goal_path.m:
compiler/goal_util.m:
compiler/headvar_names.m:
compiler/hhf.m:
compiler/hlds_out_module.m:
compiler/inlining.m:
compiler/intermod.m:
compiler/mercury_to_mercury.m:
compiler/module_imports.m:
compiler/module_qual.m:
compiler/post_typecheck.m:
compiler/prog_io_goal.m:
compiler/prog_util.m:
compiler/purity.m:
compiler/unify_proc.m:
compiler/unused_imports.m:
Conform to the changes above.
compiler/mode_constraints.m:
compiler/modules.m:
compiler/structure_reuse.analysis.m:
Avoid the warnings we now generate about one state variable shadowing
another.
browser/declarative_user.m:
compiler/hlds_out_util.m:
compiler/ordering_mode_constraints.m:
compiler/table_gen.m:
deep_profiler/read_profile.m:
Improve programming style.
library/require.m:
Add expect_not, a negated version of expect.
library/varset.m:
Return lists of new variables in order, not reverse order.
mdbcomp/mdbcomp.goal_path.m:
compiler/prog_mode.m:
Add a utility predicate.
tests/debugger/tailrec1.exp:
tests/invalid/any_passed_as_ground.err_exp:
tests/invalid/bad_sv_unify_msg.err_exp:
tests/invalid/state_vars_test1.err_exp:
tests/invalid/state_vars_test4.err_exp:
tests/invalid/try_bad_params.err_exp:
tests/invalid/try_detism.err_exp:
tests/invalid/purity/impure_pred_t1_fixed.err_exp:
tests/invalid/purity/impure_pred_t2.err_exp:
Update the expected outputs of these test cases to account for
incidental changes in variable numbers and goal paths after this
change.
tests/general/state_vars_tests.{m,exp}:
Remove the code that expected the state var transformation to do
something that was actually AGAINST the reference manual: treating
the step from the condition to the then part of an if-then-else
expression (not a goal) as a sequence point.
tests/general/state_vars_trace.m:
Add a test case that is not enabled yet, since we don't pass it.
tests/hard_coded/bit_buffer_test.m:
Fix a bug in the test itself: the introduction of a state var twice
in the same scope.
tests/hard_coded/try_syntax_6.m:
Avoid a warning about state var shadowing.
tests/hard_coded/if_then_else_expr_state_var.{m,exp}:
A new test to check the proper handling of state vars in if-then-else
expressions.
tests/hard_coded/Mmakefile:
Enable the new test.
Estimated hours taken: 2
Branches: main
Add the predicates sorry, unexpected and expect to library/error.m.
compiler/compiler_util.m:
library/error.m:
Move the predicates sorry, unexpected and expect from compiler_util
to error.
Put the predicates in error.m into the same order as their
declarations.
compiler/*.m:
Change imports as needed.
compiler/lp.m:
compiler/lp_rational.m:
Change imports as needed, and some minor cleanups.
deep_profiler/*.m:
Switch to using the new library predicates, instead of calling error
directly. Some other minor cleanups.
NEWS:
Mention the new predicates in the standard library.
Estimated hours taken: 0.2
Branches: main
Move the type software_error/0 from the require module into the exception
module. This breaks the (immediate) cyclic dependency between those two
modules (there may still be indirect ones).
library/require.m:
Delete the definition of the type software_error/0.
library/exception.m
Add the definition here.
Replace calls to error/1 with calls to throw/1.
NEWS:
Mention this change.
Estimated hours taken: 0.2
Branches: main, release
library/*.m:
Improve the library reference manual by formatting the beginning of
library modules consistently.
library/integer.m:
Fix some bad indentation.
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: 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: 4
Branches: main
library/*.m:
Convert to four-space indentation most of the library modules that
weren't already indented that way. Use predmode syntax where possible.
In some modules, shorten long lines by deleting module name prefixes.
Fix departures from our coding standards.
In some modules, simplify code, mostly using field names and/or state
variables.
There are no changes in algorithms, except for neg_list in integer.m.
Estimated hours taken: 0.25
Branches: main, version-0_12-branch
library/require.m:
Change report_lookup_error so that it reports which key
couldn't be found rather than just reporting the functor of
the key.
Estimated hours taken: 2
Branches: main
Add the operation transform_value to map, tree234 and rbtree. This applies a
higher order argument to a value in the map. Often a value needs to be updated
using its previous value. Currently this requires two lookups of the key.
With transform_value only one lookup is required.
NEWS
Mention the new predicate.
library/map.m
library/rbtree.m
library/tree234.m
Add transform_value.
library/require.m
Add a version of report_lookup_error that doesn't take a value
argument, since the value argument is not available in transform_value.
tests/hard_coded/Mmakefile
tests/hard_coded/transform_value.exp
tests/hard_coded/transform_value.m
Test transform_value.
Estimated hours taken: 1
Branches: main
Add pragma terminates declarations to exception.builtin_throw/1,
exception.throw/1 and require.error/1.
The point of this change is to try and reduce the number of cases of
possible non-termination being reported in the standard library due to
calls to require.error/1 or exception.throw/1.
Ideally we would only need provide a terminates declaration for
builtin_throw/1 but in practice the structure of the module dependency graph
means that error/1 is marked as non-terminating and certain calls to throw/1
are also considered to be non-terminating.
library/exception.m:
Add pragma terminates declaration for builtin_throw/1 and
throw/1.
library/require.m:
Add pragma terminates declaration for error/1.
Estimated hours taken: 0.1
Branches: main
library/require.m:
Changed mode of result of func_error/1 from `unused' to `out' to
avoid mode problems with functions that call func_error/1 in a
result.
Estimated hours taken: 2
Branches: main
Additions to list.m and require.m.
library/require.m:
Added func_error/1, a func version of the error/1 pred.
library/list.m:
Added cc_multi modes to list__fold[lr]/4 preds.
Added list__map_corresponding/3 and list__map_corresponding3/4.
tests/general/map_corresponding.m:
Added test cases for list__map_corresponding/3 and
list__map_corresponding3/4.
tests/general/map_corresponding.exp:
Expected output for above test cases.
tests/general/Mmakefile:
Include the new test case.
NEWS:
Recorded new additions.
Estimated hours taken: 8
Move exception handling into the standard library,
and change error/1 so that it throws an exception.
This has two advantages: one is that user code can now catch
exceptions caused by calls to error/1, the other is that the
debugger handles calls to error/1 more gracefully (by virtue
of its existing support for exception handling).
extras/exceptions/exception.m:
library/exception.m:
Move exception.m from `extras' into the standard library.
Change the code for handling uncaught exceptions so that
it prints out the same diagnostics that error/1 used to print out
(i.e. a stack trace and the last debugger event number).
extras/exceptions/Mmakefile:
extras/exceptions/test_exceptions.exp:
extras/exceptions/test_exceptions.m:
extras/exceptions/test_exceptions_func.exp:
extras/exceptions/test_exceptions_func.m:
extras/exceptions/test_uncaught_exception.exp:
extras/exceptions/test_uncaught_exception.m
tests/hard_coded/exceptions/Mmakefile:
tests/hard_coded/exceptions/test_exceptions.exp:
tests/hard_coded/exceptions/test_exceptions.m:
tests/hard_coded/exceptions/test_exceptions_func.exp:
tests/hard_coded/exceptions/test_exceptions_func.m:
tests/hard_coded/exceptions/test_uncaught_exception.exp:
tests/hard_coded/exceptions/test_uncaught_exception.exp2:
tests/hard_coded/exceptions/test_uncaught_exception.m
Move the exception test cases from extras/exceptions to
a new directory tests/hard_coded/exceptions.
Also, change the expected output for the `test_uncaught_exception'
test case, since it now prints out more information.
tests/hard_coded/Mmakefile:
Add `exceptions' to the list of subdirectories.
extras/exceptions/README:
Delete this file, since the files that it refers to have now
all been moved elsewhere.
library/require.m:
Change error/1 so that it throws an exception.
library/library.m:
Add exceptions.m to the list of modules in the standard library.
Estimated hours taken: 3
Add predicates to perform lower-bound and upper-bound searching, in which
if a search for a key fails, we return the next lower (or higher) key and
its associated value.
library/bintree.m:
library/rbtree.m:
library/tree234.m:
library/map.m:
Add lower-bound and upper-bound search and lookup predicates.
Add plain lookup predicates where missing, or move them next
to their corresponding search preds.
Make the handling of lookup errors more uniform.
library/require.m:
Move map__lookup_error here as report_lookup_error, for use
by bintree, rbtree and tree234, as well as map.
Estimated hours taken: 0.25
Fix a bug caused by zs's recent change to runtime/mercury_stack_trace.{h,c}:
library/require.m:
library/math.m:
Update calls to MR_dump_stack() to pass as the new
`include_trace_data' argument the value `FALSE'.
Estimated hours taken: 0.25
library/require.m:
Remove bogus layout structure for the hand-coded procedure
require__error_internal/1 -- it doesn't create a stack frame,
so it doesn't need a layout structure.
Estimated hours taken: 0.5
Fix a bug that broke error/1 in grades `jump.*' and `fast.*'.
library/require.m:
Rename the C module `require_module_internal' as
`require_internal_module', to be consistent with the names
used for other C modules defined in the Mercury library.
Add code to ensure that the initialization function
for this module gets run.
Estimated hours taken: 3
Fix stack traces dying in -O-1.
error/1 is usually generated with no stack frame, but in -O-1 it is
generated with one (but doesn't need it). error/1 passes
MR_dump_stack MR_succip and MR_sp, and MR_dump_stack assumes that
MR_succip is for the topmost stack frame, but if error/1 has a stack
frame, this is not true.
library/require.m:
Make sure the caller of MR_dump_stack has no stack frame
by using handwritten code. We call the handwritten code
from error/1, and so we have the nice side effect that
error now appears in the stack dump.
runtime/mercury_stack_trace.h:
Document that MR_dump_stack assumes the succip is for the
topmost stack frame.
runtime/mercury_label.h:
Fix a comment, layout info is for a label, not a procedure.
Estimated hours taken: 1
Implement nondet stack dumps.
library/require.m:
Call MR_dump_stack with MR_curfr.
runtime/mercury_stack_trace.c:
runtime/mercury_stack_trace.h:
Get MR_curfr as input.
If we hit a nondet stack frame, handle moving down a frame a
little differently.
Estimated hours taken: 12
Add support for stack dumps, do a stack dump from error/1.
compiler/Mmakefile:
library/Mmakefile:
profiler/Mmakefile:
runtime/Mmakefile:
Insert EXTRA_MGNUCFLAGS before CFLAGS or EXTRA_CFLAGS
becasue mgnuc stops processing its options when it
encounters a non-mgnuc option.
library/require.m:
Call MR_dump_stack if error is called.
runtime/Mmakefile:
runtime/mercury_imp.h:
Add #includes of new files.
runtime/mercury_type_info.h:
Remove conditional definition of MR_STATIC_CODE_ADDRESSES
(moved into mercury_conf.h.in).
runtime/mercury_accurate_gc.h:
Remove stack_layout stuff, leave this file for accurate
GC specific definitions.
runtime/mercury_conf.h.in:
Add conditional definitions of MR_INSERT_LABELS,
MR_USE_STACK_LAYOUTS, MR_NEED_INITIALIZATION_CODE and
MR_STATIC_CODE_ADDRESSES, depending on various other options.
runtime/mercury_goto.h:
Insert labels into label table if MR_INSERT_LABELS is defined,
rather than NATIVE_GC.
util/mkinit.c:
Initialize if MR_NEED_INITIALIZATION_CODE is defined, rather than
NATIVE_GC.
runtime/mercury_stack_layout.h:
All the old stack layout definitions from mercury_accurate_gc.h.
Add code for MR_DETISM_DET_CODE_MODEL.
runtime/mercury_stack_trace.c:
runtime/mercury_stack_trace.h:
Implement MR_dump_stack which just provides a dump of the stack
as far as possible.
Set MR_INSERT_LABELS and MR_USE_STACK_LAYOUTS if MR_STACK_TRACE
is set.
runtime/mercury_grade.h:
Add _strce if stack tracing is enabled in the grade. This
might not be a permanent change.
runtime/mercury_ho_call.c:
Remove unused label declarations.
scripts/mgnuc.in:
Add --stack-trace and --no-stack-trace options.
Consolidate some duplicate code.
Estimated hours taken: 0.5
library/*.m:
compiler/*.m:
Undo Zoltan's bogus update of all the copyright dates.
The dates in the copyright header should reflect the years
in which the file was modified (and no, changes to the
copyright header itself don't count as modifications).
Estimated hours taken: 0.25
library/require.m:
Add `:- pragma no_inline(error/1).', since inlining error/1
results in bigger code with no improvement in speed.
Estimated hours taken: 24
Move the C implementation of various builtins from the `runtime' directory
to inside pragma(c_code) declarations in the `library' directory sources.
library/{io,string,require,std_util,mercury_builtin}.m:
Add lots of pragma(c_code) and pragma(c_header_code) declarations.
Also a few other miscellaneous changes.
library/list.m:
Fix a bug in the as yet unused list__merge_sort.
library/io.m:
Combine io__do_open_{input,output,append} into a single
predicate io__do_open.
library/std_util.m:
Fix the implementation of report_statistics so that it gives
useful information when using conservative garbage collection.
library/*.m:
Improve the documentation.
Add a "Stability: low/medium/high" comment to all modules,
which describes the stability of the interface to that module.
ops.m:
Add `:' as an infix operator.
require.m:
Implement require/1, since higher-order predicates now work.
term.m:
Use the type `comparison_result' from mercury_builtin.m,
rather than defining an identical type `comparison'.