Estimated hours taken: 10
Fix the remaining bugs with the handling of partial qualifiers
for nested modules.
compiler/module_qual.m:
Define a new abstract type partial_qualifier_info, and a predicate
mq_info_get_partial_qualifier_info to get this type from the mq_info.
Define a new predicate get_partial_qualifiers/3 in module_qual.m
which is like the old get_partial_qualifiers/2 predicate from
modules.m except that it takes a partial_qualifier_info and
uses the information in this to return only the partial qualifiers
for modules which are visible, rather than returning all partial
qualifier regardless of whether the modules that they refer to
are in scope or not.
compiler/prog_util.m:
Export the `insert_module_qualifier' predicate, for use in the
definition of get_partial_qualifiers/3.
compiler/hlds_module.m:
compiler/make_hlds.m:
Change the code for make_hlds__ctors_add and
hlds_module__pred_table_insert/5 so that they handles partial
qualifiers properly, computing the partial qualifiers by
calling get_partial_qualifiers/3 rather than by checking the
NeedQual variable and calling get_partial_qualifiers/2.
compiler/modules.m:
Delete the old get_partial_qualifiers/2 predicate.
compiler/hlds_module.m:
Add a new field to the HLDS containing the partial_qualifier_info.
Add a partial_qualifier_info parameter to pred_table_insert/5.
compiler/check_typeclass.m:
compiler/make_hlds.m:
When calling pred_table_insert/5, get the partial_qualifier_info
from the HLDS and pass it as an extra argument.
tests/hard_coded/sub-modules/nested.m:
tests/hard_coded/sub-modules/nested3.m:
tests/hard_coded/sub-modules/parent.m:
tests/hard_coded/sub-modules/nested.exp:
tests/hard_coded/sub-modules/nested3.exp:
tests/hard_coded/sub-modules/parent.exp:
Uncomment parts of these test cases which were previously
commented out because they were not yet supported.
doc/reference_manual.texi:
Delete the description of this bug.
Estimated hours taken: 220
Aditi update syntax, type and mode checking.
Change the hlds_goal for constructions in preparation for
structure reuse to avoid making multiple conflicting changes.
compiler/hlds_goal.m:
Merge `higher_order_call' and `class_method_call' into a single
`generic_call' goal type. This also has alternatives for the
various Aditi builtins for which type declarations can't
be written.
Remove the argument types field from higher-order/class method calls.
It wasn't used often, and wasn't updated by optimizations
such as inlining. The types can be obtained from the vartypes
field of the proc_info.
Add a `lambda_eval_method' field to lambda_goals.
Add a field to constructions to identify which RL code fragment should
be used for an top-down Aditi closure.
Add fields to constructions to hold structure reuse information.
This is currently ignored -- the changes to implement structure
reuse will be committed to the alias branch.
This is included here to avoid lots of CVS conflicts caused by
changing the definition of `hlds_goal' twice.
Add a field to `some' goals to specify whether the quantification
can be removed. This is used to make it easier to ensure that
indexes are used for updates.
Add a field to lambda_goals to describe whether the modes were
guessed by the compiler and may need fixing up after typechecking
works out the argument types.
Add predicate `hlds_goal__generic_call_id' to work out a call_id
for a generic call for use in error messages.
compiler/purity.m:
compiler/post_typecheck.m:
Fill in the modes of Aditi builtin calls and closure constructions.
This needs to know which are the `aditi__state' arguments, so
it must be done after typechecking.
compiler/prog_data.m:
Added `:- type sym_name_and_arity ---> sym_name/arity'.
Add a type `lambda_eval_method', which describes how a closure
is to be executed. The alternatives are normal Mercury execution,
bottom-up execution by Aditi and top-down execution by Aditi.
compiler/prog_out.m:
Add predicate `prog_out__write_sym_name_and_arity', which
replaces duplicated inline code in a few places.
compiler/hlds_data.m:
Add a `lambda_eval_method' field to `pred_const' cons_ids and
`pred_closure_tag' cons_tags.
compiler/hlds_pred.m:
Remove type `pred_call_id', replace it with type `simple_call_id',
which combines a `pred_or_func' and a `sym_name_and_arity'.
Add a type `call_id' which describes all the different types of call,
including normal calls, higher-order and class-method calls
and Aditi builtins.
Add `aditi_top_down' to the type `marker'.
Remove `aditi_interface' from type `marker'. Interfacing to
Aditi predicates is now handled by `generic_call' hlds_goals.
Add a type `rl_exprn_id' which identifies a predicate to
be executed top-down by Aditi.
Add a `maybe(rl_exprn_id)' field to type `proc_info'.
Add predicate `adjust_func_arity' to convert between the arity
of a function to its arity as a predicate.
Add predicates `get_state_args' and `get_state_args_det' to
extract the DCG state arguments from an argument list.
Add predicate `pred_info_get_call_id' to get a `simple_call_id'
for a predicate for use in error messages.
compiler/hlds_out.m:
Write the new representation for call_ids.
Add a predicate `hlds_out__write_call_arg_id' which
replaces similar code in mode_errors.m and typecheck.m.
compiler/prog_io_goal.m:
Add support for `aditi_bottom_up' and `aditi_top_down' annotations
on pred expressions.
compiler/prog_io_util.m:
compiler/prog_io_pragma.m:
Add predicates
- `prog_io_util:parse_name_and_arity' to parse `SymName/Arity'
(moved from prog_io_pragma.m).
- `prog_io_util:parse_pred_or_func_name_and_arity to parse
`pred SymName/Arity' or `func SymName/Arity'.
- `prog_io_util:parse_pred_or_func_and_args' to parse terms resembling
a clause head (moved from prog_io_pragma.m).
compiler/type_util.m:
Add support for `aditi_bottom_up' and `aditi_top_down' annotations
on higher-order types.
Add predicates `construct_higher_order_type',
`construct_higher_order_pred_type' and
`construct_higher_order_func_type' to avoid some code duplication.
compiler/mode_util.m:
Add predicate `unused_mode/1', which returns `builtin:unused'.
Add functions `aditi_di_mode/0', `aditi_ui_mode/0' and
`aditi_uo_mode/0' which return `in', `in', and `out', but will
be changed to return `di', `ui' and `uo' when alias tracking
is implemented.
compiler/goal_util.m:
Add predicate `goal_util__generic_call_vars' which returns
any arguments to a generic_call which are not in the argument list,
for example the closure passed to a higher-order call or
the typeclass_info for a class method call.
compiler/llds.m:
compiler/exprn_aux.m:
compiler/dupelim.m:
compiler/llds_out.m:
compiler/opt_debug.m:
Add builtin labels for the Aditi update operations.
compiler/hlds_module.m:
Add predicate predicate_table_search_pf_sym, used for finding
possible matches for a call with the wrong number of arguments.
compiler/intermod.m:
Don't write predicates which build `aditi_top_down' goals,
because there is currently no way to tell importing modules
which RL code fragment to use.
compiler/simplify.m:
Obey the `cannot_remove' field of explicit quantification goals.
compiler/make_hlds.m:
Parse Aditi updates.
Don't typecheck clauses for which syntax errors in Aditi updates
are found - this avoids spurious "undefined predicate `aditi_insert/3'"
errors.
Factor out some common code to handle terms of the form `Head :- Body'.
Factor out common code in the handling of pred and func expressions.
compiler/typecheck.m:
Typecheck Aditi builtins.
Allow the argument types of matching predicates to be adjusted
when typechecking the higher-order arguments of Aditi builtins.
Change `typecheck__resolve_pred_overloading' to take a list of
argument types rather than a `map(var, type)' and a list of
arguments to allow a transformation to be performed on the
argument types before passing them.
compiler/error_util.m:
Move the part of `report_error_num_args' which writes
"wrong number of arguments (<x>; expected <y>)" from
typecheck.m for use by make_hlds.m when reporting errors
for Aditi builtins.
compiler/modes.m:
compiler/unique_modes.m:
compiler/modecheck_call.m:
Modecheck Aditi builtins.
compiler/lambda.m:
Handle the markers for predicates introduced for
`aditi_top_down' and `aditi_bottom_up' lambda expressions.
compiler/polymorphism.m:
Add extra type_infos to `aditi_insert' calls
describing the tuple to insert.
compiler/call_gen.m:
Generate code for Aditi builtins.
compiler/unify_gen.m:
compiler/bytecode_gen.m:
Abort on `aditi_top_down' and `aditi_bottom_up' lambda
expressions - code generation for them is not yet implemented.
compiler/magic.m:
Use the `aditi_call' generic_call rather than create
a new procedure for each Aditi predicate called from C.
compiler/rl_out.pp:
compiler/rl_gen.m:
compiler/rl.m:
Move some utility code used by magic.m and call_gen.m into rl.m.
Remove an XXX comment about reference counting being not yet
implemented - Evan has fixed that.
library/ops.m:
compiler/mercury_to_mercury.m:
doc/transition_guide.texi:
Add unary prefix operators `aditi_bottom_up' and `aditi_top_down',
used as qualifiers on lambda expressions.
Add infix operator `==>' to separate the tuples in an
`aditi_modify' call.
compiler/follow_vars.m:
Thread a `map(prog_var, type)' through, needed because
type information is no longer held in higher-order call goals.
compiler/table_gen.m:
Use the `make_*_construction' predicates in hlds_goal.m
to construct constants.
compiler/*.m:
Trivial changes to add extra fields to hlds_goal structures.
doc/reference_manual.texi:
Document Aditi updates.
Use @samp{pragma base_relation} instead of
@samp{:- pragma base_relation} throughout the Aditi documentation
to be consistent with other parts of the reference manual.
tests/valid/Mmakefile:
tests/valid/aditi_update.m:
tests/valid/aditi.m:
Test case.
tests/valid/Mmakefile:
Remove some hard-coded --intermodule-optimization rules which are
no longer needed because `mmake depend' is now run in this directory.
tests/invalid/*.err_exp:
Fix expected output for changes in reporting of call_ids
in typecheck.m.
tests/invalid/Mmakefile
tests/invalid/aditi_update_errors.{m,err_exp}:
tests/invalid/aditi_update_mode_errors.{m,err_exp}:
Test error messages for Aditi updates.
tests/valid/aditi.m:
tests/invalid/aditi.m:
Cut down version of extras/aditi/aditi.m to provide basic declarations
for Aditi compilation such as `aditi__state' and the modes
`aditi_di', `aditi_uo' and `aditi_ui'. Installing extras/aditi/aditi.m
somewhere would remove the need for these.
Estimated hours taken: 6
Allow construction unifications for existentially typed functors,
using the syntax "X = 'new foo'(Y)" rather than the usual "X = foo(Y)".
We need to use a special syntax for exisentially typed constructions
because type analysis and polymorphism need to know which occurrences
of existentially typed functors are constructors and which are deconstructors.
Note that we still don't yet support RTTI for existentially typed data types.
compiler/typecheck.m:
For existentially typed functors, allow the functor to have
a "new " prefix, and if so, make the quantifiers and constraints
universal rather than existential.
compiler/polymorphism.m:
For unifications with existentially typed functors,
check for a "new " prefix on the functor.
If the functor has such a prefix, strip off the prefix,
and treat the unification as a construction rather than
treating it as a deconstruction.
compiler/type_util.m:
Define a new predicate `remove_new_prefix', for use by typecheck.m
and polymorphism.m.
compiler/modecheck_unify.m:
For construction unifications, check that all the type_info
and typeclass_info arguments introduced by polymorphism.m
are ground.
tests/hard_coded/typeclasses/existential_data_types.m:
Change the test case to use this new feature,
rather than hacking it using the C interface.
doc/reference_manual.texi:
Document the new features.
Estimated hours taken: 0.5
Add .ispell_words to the doc directory.
To add a word to this file, just press `I' when using ispell to spell
check the documentation.
Estimated hours taken: 4
Merge in the changes from the existential_types_2 branch.
This change adds support for mode re-ordering of code involving
existential types. The change required modifying the order of the
compiler passes so that polymorphism comes before mode analysis,
so that mode analysis can check the modes of the `type_info' or
`typeclass_info' variables that polymorphism introduces, so that
it can thus re-order the code accordingly.
This change also includes some more steps towards making existential data
types work. In particular, you should be able to declare existentially
typed data types, the compiler will generate appropriate unification
and compare/3 routines for them, and deconstruction unifications for them
should work OK. However, currently there's no way to construct them
except via `pragam c_code', and we don't generate correct RTTI for them,
so you can't use `io__write' etc. on them.
library/private_builtin.m:
compiler/accumulator.m:
compiler/bytecode_gen.m:
compiler/check_typeclass.m:
compiler/clause_to_proc.m:
compiler/code_util.m:
compiler/common.m:
compiler/dead_proc_elim.m:
compiler/dependency_graph.m:
compiler/det_analysis.m:
compiler/det_report.m:
compiler/follow_code.m:
compiler/follow_vars.m:
compiler/goal_util.m:
compiler/higher_order.m:
compiler/hlds_goal.m:
compiler/hlds_out.m:
compiler/hlds_pred.m:
compiler/intermod.m:
compiler/lambda.m:
compiler/live_vars.m:
compiler/magic.m:
compiler/make_hlds.m:
compiler/mercury_compile.m:
compiler/mercury_to_c.m:
compiler/mode_errors.m:
compiler/mode_info.m:
compiler/mode_util.m:
compiler/modecheck_call.m:
compiler/modecheck_unify.m:
compiler/modes.m:
compiler/pd_cost.m:
compiler/polymorphism.m:
compiler/post_typecheck.m:
compiler/purity.m:
compiler/quantification.m:
compiler/rl_exprn.m:
compiler/rl_key.m:
compiler/simplify.m:
compiler/table_gen.m:
compiler/term_traversal.m:
compiler/type_util.m:
compiler/typecheck.m:
compiler/unify_gen.m:
compiler/unify_proc.m:
compiler/unique_modes.m:
compiler/unused_args.m:
compiler/notes/compiler_design.html:
doc/reference_manual.texi:
tests/hard_coded/typeclasses/Mmakefile:
tests/hard_coded/typeclasses/existential_data_types.m:
tests/hard_coded/typeclasses/existential_data_types.exp:
tests/warnings/simple_code.exp:
tests/hard_coded/Mmakefile:
tests/term/arit_exp.trans_opt_exp:
tests/term/associative.trans_opt_exp:
tests/term/pl5_2_2.trans_opt_exp:
tests/term/vangelder.trans_opt_exp:
tests/term/arit_exp.trans_opt_exp:
tests/term/associative.trans_opt_exp:
tests/term/pl5_2_2.trans_opt_exp:
tests/term/vangelder.trans_opt_exp:
tests/invalid/errors2.err_exp2:
tests/invalid/prog_io_erroneous.err_exp2:
tests/invalid/type_inf_loop.err_exp2:
tests/invalid/types.err_exp2:
tests/invalid/polymorphic_unification.err_exp:
tests/invalid/Mmakefile:
tests/warnings/simple_code.exp:
tests/debugger/queens.exp:
tests/hard_coded/Mmakefile:
tests/hard_coded/existential_reordering.m:
tests/hard_coded/existential_reordering.exp:
Merge in the changes from the existential_types_2 branch.
Estimated hours taken: 500
Add a new pass to the compiler, that attempts to introduce accumulators
into a procedure so as to make that procedure tail recursive.
WORK_IN_PROGRESS:
Document that the transformation now exists.
compiler/goal_util.m:
Create goal_util__can_reorder_goals, which is a version of
pd_util__can_reorder_goals that will work on the alias branch.
compiler/instmap.m:
Add instmap__changed_vars. This predicate is meant to provide the
same functionality as instmap_delta_changed_vars, but work on the
alias branch.
Also add comment to instmap_delta_changed_vars about using
instmap_changed_vars
compiler/accumulator.m:
The transformation.
compiler/mercury_compile.m:
Call the transformation.
compiler/options.m:
Add the option to turn the transformation on.
doc/user_guide.texi:
Document the option.
profiler/demangle.m:
util/mdemangle.c:
Demangle the accumulator version of the procedure labels.
compiler/notes/compiler_design.html:
Add the new pass to the documentation.
Estimated hours taken: 3 (including time to learn enough about TeXinfo to
figure out what was going on)
New versions of TeXinfo are more picky about the correct use of `@xref' and
friends. In particular, they insist that an `@xref' be followed immediately
by a comma or a full stop. There were a few instances in the user manual
where this was not the case.
doc/user_guide.texi:
Changed a few incorrect uses of `@xref' to use `@ref' instead, to
keep texinfo happy.
Estimated hours taken: 4.5
Remove support for --args simple. We don't use it, we won't use it even for
experiments, and it is unnecessary complication.
If anybody were using --args simple, this would need bootstrapping, but
since nobody does, there is no need, and this can be committed as an
ordinary change.
compiler/options.m:
doc/user_guide.texi:
scripts/*.in:
scripts/*.sh-subr:
Remove the --args option.
compiler/globals.m:
Remove the args_method global and its access predicates.
compiler/handle_options.m:
Don't set the args_method global from the option.
compiler/arg_info.m:
Remove support for --args simple. This allows us to remove a now
redundant argument from an exported predicate.
compiler/mercury_compile.m:
Remove the code for passing -DCOMPACT_ARGS to the C compiler.
compiler/bytecode_gen.m:
compiler/fact_table.m:
compiler/follow_vars.m:
compiler/live_vars.m:
compiler/call_gen.m:
Don't pass the unnecessary argument to arg_info.
compiler/call_gen.m:
compiler/unify_gen.m:
Remove now unnecessary assertions.
compiler/hlds_pred.m:
Don't include an args_method in proc_infos; instead, include
a slot that says whether the procedure's address is taken or not.
(In most cases, this determined whether the args_method was
simple or compact.) We will need this bool in the near future
(when we generate layout structures for procedures whose address
is taken).
Modify the signatures of exported predicates to accommodate
this change to the data structure.
compiler/hlds_out.m:
Print the new slot, not the args_method.
compiler/lambda.m:
When creating procedures from lambdas, set the address-taken slot
to address_is_taken instead of setting up its args_method.
compiler/make_hlds.m:
Minor changes to conform to the changes in the signatures of
the predicates exported from hlds_pred.m.
compiler/check_typeclass.m:
compiler/clause_to_proc.m:
compiler/dnf.m:
compiler/magic.m:
compiler/magic_util.m:
compiler/modecheck_call.m:
compiler/pd_info.m:
compiler/post_typecheck.m:
compiler/unify_gen.m:
Minor changes to conform to the changes in the signatures of
the predicates exported from hlds_pred.m and make_hlds.m.
runtime/mercury_type_info.h:
Remove the conditional definition of the macros that provided
an argument-method-independent way of referring to the registers
holding the inputs and outputs of e.g. unification procedures.
We don't need the independence anymore, and using registers instead
of macros in the code ensures that maintainers are aware of register
reuse issues (e.g. they copy an input from r1 before overwriting it
with an output).
runtime/mercury_conf_param.h:
runtime/mercury_grade.h:
Remove support for the args method component of the grade.
runtime/mercury_ho_call.c:
runtime/mercury_tabling.c:
library/*.m:
Conform to the changes in runtime/mercury_type_info.h by effectively
applying the #defines appropriate to compact args by hand.
Remove code and data structures only needed for simple args.
Remove comments needed only in the presence of uncertainty about
the args method.
Estimated hours taken: 0.25
doc/texinfo.tex:
Change the annoying warning message about the Tex 3.0 incompatibility
so that it does not contain the string '**'; this makes it easier
to grep the log files for error messages from Mmake.
Estimated hours taken: 8
Add an option that causes the compiler to pass information to the
execution tracing system in one struct, rather than four separate arguments.
Two of these arguments are pointers, which each require two instructions
to set up on SPARC, MIPS and other RISCs that do not use a global pool.
The other two arguments are small constants. Therefore on 32-bit RISCs,
replacing MR_trace/4 with MR_trace_struct/1 will probably replace
six instructions with two, which saves four instructions' worth
of time and 16 bytes of code, at the cost of 12 bytes of data,
and possibly the cost of some instructions later loading the info
from the struct into registers. However, this loading cost does not have
to be paid if tracing is not enabled, and other optimizations may
reduce the cost even if tracing is enabled. For example, I strongly suspect
that on out-of-order machines, which means most CPUs you can buy today,
the load instructions are effectively free, because they happen while
the indirect jump to MR_trace_real takes place.
I intend to benchmark this option on our various platforms,
and have autoconfigure set it on the machines in which it is beneficial.
doc/user_guide.texi:
Document the new --call-trace-struct option, and say it is not
for general use.
compiler/options.m:
Add the new option.
compiler/trace.m:
If the option is set, call MR_trace_struct instead of MR_trace,
and create a new kind of static (in both senses) global data structure
to hold the arguments.
Move the definition of trace_port to llds.m, and the procedure to
convert it to string to llds_out.m
compiler/code_info.m:
Add an extra code_info slot to hold this new kind of global data,
and its access predicates.
compiler/code_gen.m:
Transfer this new kind of global data from code_info to the global_data
part of module_info.
compiler/hlds_module.m:
Add a new field to the global_data data structure to hold this data.
compiler/mercury_compile.m:
Include the new global data in the list of things we give to llds_out.
compiler/llds.m:
Add a new kind of comp_gen_c_data to hold MR_trace_struct arguments.
Also move the definition of trace_port from trace.m to here,
since the new kind of comp_gen_c_data refers to this type.
compiler/llds_out.m:
Add code to print the new kind of comp_gen_c_data.
Move the code to print trace_ports from trace.m to here.
compiler/llds_common.m:
Ignore the new kind of comp_gen_c_data, since by construction
its contents are never common with anything else.
runtime/mercury_trace_base.[ch]:
Add a new variant of MR_trace, MR_trace_struct, that consolidates
the arguments into a single MR_Trace_Call_Info struct.
Fix a bad variable name: the int argument to MR_trace is a max r
register number, not a max mr register number.
Estimated hours taken: 16
Allow the compiler to handle create rvals whose arguments have a size
which is different from the size of a word. Use this capability to reduce
the size of RTTI information, in two ways.
The first way is by rearranging the way in which we represent information
about the live values at a label. Instead of an array with an entry for
each live value, the entry being a pair of Words containing a shape
representation and a location description respectively, use an array
of shape representations (still Words), followed by an array of 32-bit ints
(which may be smaller than Word) describing locations whose descriptions
don't fit into 8 bits, followed by an array of 8-bit ints describing
locations whose descriptions do fit into 8 bits.
The second way is by reducing the sizes of some fields in the C structs
used for RTTI. Several of these had to be bigger than necessary in the
past because their fields were represented by the args of a create rval.
On cyclone, this reduces the size of the object file for queens.m by 2.8%.
IMPORTANT
Until this change is reflected in the installed compiler, you will not be
able to use any modules compiled with debugging in your workspaces if the
workspace has been updated to include this change. This is because the RTTI
data structures generated by the old installed compiler will not be compatible
with the new structure definitions.
The workaround is simple: if your workspace contains modules compiled with
debugging, don't do a cvs update until this change has been installed.
configure.in:
Check whether <stdint.h> is present. If not, autoconfigure
types that are at least 16 and 32 bits in size.
runtime/mercury_conf.h.in:
Mention the macros used by the configure script, MR_INT_LEAST32_TYPE
and MR_INT_LEAST16_TYPE.
runtime/mercury_conf_param.h:
Document the macros used by the configure script, MR_INT_LEAST32_TYPE
and MR_INT_LEAST16_TYPE.
runtime/mercury_types.h:
If <stdint.h> is available, get the basic integer types (intptr_t,
int_least8_t, etc) from there. Otherwise, get them from the
autoconfigure script. Define types such as Word in terms of these
(eventually) standard types.
runtime/mercury_stack_layout.h:
Add macros for manipulating short location descriptions, update the
types and macros for manipulating long location descriptions.
Modify the way the variable count is represented (since it now must
count locations with long and short descriptions separately),
and move it to the structure containing the arrays it describes.
Reduce the size of the some fields in structs. This required some
reordering of fields to avoid the insertion of padding by the compiler,
and changes to the definitions of some types (e.g. MR_determinism).
runtime/mercury_layout_util.[ch]:
runtime/mercury_stack_trace.c:
runtime/mercury_accurate_gc.c:
trace/mercury_trace.c:
trace/mercury_trace_external.c:
trace/mercury_trace_internal.c:
Update the code to conform to the changes to stack_layout.h.
compiler/llds.m:
Modify the create rval in two ways. First, add an extra argument to
represent the types of the arguments, which used to always be implicit
always a word in size, but may now be explicit and possibly smaller
(e.g. uint_least8). Second, since the code generator would do the wrong
thing with creates with smaller than wordsize arguments, replace
the old must-be-unique vs may-be-nonunique bool with a three-valued
marker, must_be_dynamic vs must_be_static vs can_be_either.
Add uint_least8, uint_least16, uint_least32 (and their signed variants)
and string as llds_types.
Add a couple of utility predicates for checking whether an llds_type
denotes a type whose size is the same as word.
compiler/llds_out.m:
Use explicitly given argument types when declaring and initializing
the arguments of a cell, if they are given.
compiler/llds_common.m:
Don't conflate creates with identical argument values but different
C-level argument types. The probability of a match is minuscule anyway.
compiler/stack_layout.m:
Use the new representation of creates to generate the new versions of
RTTI data structures.
compiler/code_exprn.m:
If a create is marked must_be_static, don't inspect the arguments
to decide whether it can be static or not. If it can't, we'll get
an abort later on in llds_out or during C compilation anyway.
compiler/base_type_layout.m:
When creating pseudo typeinfos, return the llds_type of the resulting
rval.
Minor changes required by the change in create.
compiler/base_type_info.m:
compiler/base_typeclass_info.m.m:
compiler/code_util.m:
compiler/dupelim.m:
compiler/exprn_aux.m:
compiler/jumpopt.m:
compiler/livemap.m:
compiler/lookup_switch.m:
compiler/middle_rec.m:
compiler/opt_debug.m:
compiler/opt_util.m:
compiler/string_switch.m:
compiler/unify_gen.m:
compiler/vn_cost.m:
compiler/vn_filter.m:
compiler/vn_flush.m:
compiler/vn_order.m:
compiler/vn_type.m:
compiler/vn_util.m:
compiler/vn_verify.m:
Minor changes required by the change in create.
library/benchmarking.m:
library/std_util.m:
Use the new macros in hand-constructing proc layout structures.
library/Mmakefile:
Add explicit dependencies for benchmarking.o and std_util.o
on ../runtime/mercury_stack_layout.h. Although this is only a subset
of the truth (in reality, all library objects depend on most of the
runtime headers), it is a good tradeoff between safety and efficiency.
The other runtime header files tend not to change in incompatible ways.
trace/Mmakefile:
Add explicit dependencies for all the object files on
../runtime/mercury_stack_layout.h, for similar reasons.
Estimated hours taken: 3
Prefix everything defined in runtime/mercury_{stacks,tags}.h MR_.
In the process, get rid of the grade component MR_DEBUG_NONDET_STACK,
since this makes the update to mercury_stacks.h simpler and its use is
long obsolete.
runtime/mercury_tags.h:
Put MR_ prefixes in front of everything defined here.
runtime/mercury_stacks.h:
Put MR_ prefixes in front of everything defined here.
Remove support for MR_DEBUG_NONDET_STACK. Replace most of the
lost functionality by calling an updated mkframe_msg.
Remove the definitions of push() and pop(). Their use conflicts with
the idea that everything on the det stack is part of a frame, which
the RTTI stuff depends on.
runtime/mercury_bootstrap.h:
Add backward compatibility macros for the old names in the above two
files.
Remove some old entries in this file which are no longer needed.
runtime/mercury_wrapper.c:
Remove the only uses of push() and pop().
Put MR_ in front of some things that need them.
runtime/mercury_engine.c:
Put MR_ in front of some things that need them.
runtime/mercury_misc.[ch]:
Make mkframe_msg get the name of the procedure that owns the stack
frame from an explicitly passed argument, rather than the prednm slot
(which no longer exists). This actually improves low-level debugging
support without MR_DEBUG_NONDET_STACK.
Remove unnecessary return statements.
runtime/mercury_debug.h:
Pass on the new arg of mkframe_msg.
Fix long lines.
runtime/mercury_conf_param.h:
Remove the documentation of MR_DEBUG_NONDET_STACK.
runtime/mercury_grade.h:
Remove the grade component of MR_DEBUG_NONDET_STACK.
doc/reference_manual.texi:
Document the MR_ prefixed versions of list_empty, list_cons etc.
library/io.m:
library/std_util.m:
library/string.m:
Add prefixes to some references to the runtime.
Estimated hours taken: 0.2
Remove the obsolete option --heap-space, which was used only with NU-Prolog.
compiler/options.m:
Remove the option.
compiler/handle_options.m:
Don't set the option.
doc/user_guide.texi:
Don't document the option.
library/io.m:
Delete the code that is only invoked when the option is set.
Estimated hours taken: 0.5
doc/reference_manual.texi:
Consistently use `set' to refer to a collection of type class
instances, since order is not important, and use `sequence'
to refer to a collection of type class parameters, where
the order is important. Remove the multiplicative inverse
method from the `ring' example type class, since the usual
definition of a ring does not require this. Also fix a
couple of grammatical errors.
Estimated hours taken: 60
User-guided type specialization.
compiler/prog_data.m:
compiler/prog_io_pragma.m:
compiler/modules.m:
compiler/module_qual.m:
compiler/mercury_to_mercury.m:
Handle `:- pragma type_spec'.
compiler/prog_io_pragma.m:
Factor out some common code to parse predicate names with arguments.
compiler/hlds_module.m:
Added a field to the module_sub_info to hold information about
user-requested type specializations, filled in by make_hlds.m
and not used by anything after higher_order.m.
compiler/make_hlds.m:
For each `:- pragma type_spec' declaration, introduce a new predicate
which just calls the predicate to be specialized with the
specified argument types. This forces higher_order.m to produce
the specialized versions.
compiler/higher_order.m:
Process the user-requested type specializations first to ensure
that they get the correct names.
Allow partial matches against user-specified versions, e.g.
map__lookup(map(int, list(int)), int, list(int)) matches
map__lookup(map(int, V), int, V).
Perform specialization where a typeclass constraint matches a
known instance, but the construction of the typeclass_info is
done in the calling module.
Give slightly more informative progress messages.
compiler/dead_proc_elim.m:
Remove specializations for dead procedures.
compiler/prog_io_util.m:
Change the definition of the `maybe1' and `maybe_functor' types
to avoid the need for copying to convert between `maybe1'
and `maybe1(generic)'.
Changed the interface of `make_pred_name_with_context' to allow
creation of predicate names for type specializations which describe
the type substitution.
compiler/make_hlds.m:
compiler/prog_io_pragma.m:
Make the specification of pragma declarations in error
messages consistent. (There are probably some more to
be fixed elsewhere for termination and tabling).
compiler/intermod.m:
Write type specialization pragmas for predicates declared
in `.opt' files.
compiler/mercury_to_mercury.m:
Export `mercury_output_item' for use by intermod.m.
compiler/options.m:
Add an option `--user-guided-type-specialization' enabled
with `-O2' or higher.
compiler/handle_options.m:
`--type-specialization' implies `--user-guided-type-specialization'.
compiler/hlds_goal.m:
Add predicates to construct constants. These are duplicated
in several other places, I'll fix that as a separate change.
compiler/type_util.m:
Added functions `int_type/0', `string_type/0', `float_type/0'
and `char_type/0' which return the builtin types.
These are duplicated in several other places,
I'll fix that as a separate change.
library/private_builtin.m:
Added `instance_constraint_from_typeclass_info/3' to extract
the typeclass_infos for a constraint on an instance declaration.
This is useful for specializing class method calls.
Added `thread_safe' to various `:- pragma c_code's.
Added `:- pragma inline' declarations for `builtin_compare_*', which
are important for user-guided type specialization. (`builtin_unify_*'
are simple enough to go in the `.opt' files automatically).
compiler/polymorphism.m:
`instance_constraint_from_typeclass_info/3' does not need type_infos.
Add `instance_constraint_from_typeclass_info/3' to the
list of `typeclass_info_manipulator's which higher_order.m
can interpret.
NEWS:
doc/reference_manual.texi:
doc/user_guide.texi
Document the new pragma and option.
tests/invalid/Mmakefile:
tests/invalid/type_spec.m:
tests/invalid/type_spec.err_exp:
Test error reporting for invalid type specializations.
tests/hard_coded/Mmakefile:
tests/invalid/type_spec.m:
tests/invalid/type_spec.exp:
Test type specialization.
Estimated hours taken: 11
This change allows interactive queries to be typed from the external debugger.
browser/debugger_interface.m:
Define new debugger requests: query/1, cc_query/1, io_query/1 and
mmc_options/1.
Define 2 new procedures that are used in trace/mercury_trace_external.c:
get_list_modules_to_import/3 retrieves from a *query/1 request a list
of modules to be imported; and get_mmc_options/2 retrieves from a
mmc_options/1 request the option to pass to mmc to compile the query.
browser/interactive_query.m:
Define a new procedure query_external/7 that does the same job as
query/7 but for the external debugger.
Unset the environment variable `MERCURY_OPTIONS' before compiling a
query; `MERCURY_OPTIONS' is exported before executing a program under
the control of Opium-M (and mdb) and is not supposed to be set before
compiling a program.
trace/mercury_trace_browse.ch:
Add a new function MR_trace_query_external() to interface the
ML_query_external() function defined by browser/interfactive_query.m.
trace/mercury_trace_external.c:
Add code to implement new commands `query', `cc_query', `io_query',
and `mmc_options', using the MR_trace_query_external() function defined
by trace/mercury_trace_browse.h.
trace/mercury_trace_external.h:
Export MR_debugger_socket_in and MR_debugger_socket_out since there
are needed in interactive_query.m.
doc/user_guide.texi:
Add a comment to tell that there exists duplicated documentation betwenn
Opium-M/source/interactive_queries.op and doc/user_guide.texi and to
tell me to update it if someone update the documentation here.
Estimated hours taken: 2
Rearrange and improve the documentation of the compilation model and
code generation options.
doc/user_guide.texi:
compiler/options.m:
- Move the `--max-jump-table-size' option to the code generation
options section, since this option is not a compilation model
option (it doesn't affect binary compatibility).
- Move the compilation model options that are not intended for general
use into a new subsection "developer compilation model options".
- Move the code generation options that are used for optimizing
the generated C code based on the target architecture
(these also happen to be all the ones that are not intended for
general use) into a new subsection "code generation target options".
- Add line breaks, i.e. "@*" in TexInfo, after all the
"(This option is not intended for general use.)" statements.
compiler/options.m:
- Move the `--have-delay-slot' and `--num-real-{r,f}-{regs,temps}'
options to the code generation options section, since these options
are not a compilation model option (they don't affect binary
compatibility). These options were already in the code generation
options section in user_guide.texi.
- Fix a few minor layout error in the options help message.
doc/user_guide.texi:
Document the `--no-reclaim-heap-on-failure' option. Previously
this was documented in options.m but not in user_guide.texi.
Estimated hours taken: 1.5
compiler/llds_out.m:
Only emit #line directives if the option --line-numbers is given.
compiler/option.m:
Make --line-numbers the default, and remove the -n shorthand for
this option (since it would have the wrong sense).
Document the new use of this option, and the new default.
doc/user_guide.texi:
Document the new use of this option, and the new default.
Estimated hours taken: 0.5
Fix a bug where doc/generate_mdb_doc was putting the documentation for
the interactive query commands in the category "interactive" whereas
doc/mdb_categories was expecting this category to be called "queries".
util/info_to_mdb.c:
Print error messages to stderr rather than stdout.
Document the first argument as being a category name
(the name of an mdb help category) rather than a section name.
doc/generate_mdb_doc:
Avoid the assumption that the category name is the same as the
section name; that is still the default, but it now sets the
category for the "interactive" section to "queries".
Invoke info_to_mdb with the category name rather than the
section name.
trace/mercury_trace_internal.c:
Update the category names in the pseudo-automatically-generated
command list to reflect the above change.
(Also improve an error message slightly.)
Estimated hours taken: 0.1
doc/faq.texi:
doc/library.texi:
doc/reference_manual.texi:
doc/transition_guide.texi:
doc/user_guide.texi:
Comment out the @direntry and @dircategory commands.
They were not needed (since they weren't actually being used --
only the corresponding commands in mercury.info were being used),
and caused problems for the HTML version, because the current
version of texi2html that we have does not yet implement those
new TexInfo commands. They also caused some problems due to
many of our machines having older versions of `makeinfo' which
don't support the new commands yet either.
Estimated hours taken: 0.1
doc/generate_mdb_doc:
Add "interactive" (queries) to the list of user guide section names
containing documentation about mdb commands.
Estimated hours taken: 0.25
doc/reference_manual.texi:
Split the "Data-terms" section up into sub-sections,
since it has grown long enough now to make that worthwhile.
Estimated hours taken: 0.5
Deprecate the old style of lambda expressions.
NEWS:
doc/reference_manual.texi:
Document that the old-style lambda expressions are now deprecated.
compiler/notes/todo.html:
Mention that we should warn about the use of old-style lambda
expressions.
Estimated hours taken: 3
Improve the autoconfiguration for sockets and the dlopen() stuff,
and ensure that the libraries needed for these are only linked in
when debugging.
This change also fixes a bug: Erwan's recent change to add -lsocket
broke static linking on Solaris 2.6 machines. This change means that
static linking works again, so long as you don't enable debugging.
Estimated hours taken: 5
Remove support for NU-Prolog and SICStus Prolog.
The reasons for this are:
(a) We now have a proper working debugger, so we don't need to use
NU-Prolog or SICStus Prolog for debugging.
(b) The Prolog support was only ever a hack, not a proper solution;
Mercury language features like functions or mode reordering
were never supported.
(c) It was a maintenance problem.
compiler/make_hlds.m:
Warn that NU-Prolog `when' declarations are deprecated.
compiler/prog_io.m:
Update a comment to say that NU-Prolog `when' declarations
are now deprecated.
library/*.m:
Delete `when' declarations.
configure.in:
bindist/bindist.configure.in:
Delete the autoconf tests for NU-Prolog and SICStus Prolog.
Delete the stuff for generating the NU-Prolog and SICStus Prolog
scripts.
tools/bootcheck:
Delete the options for testing using SICStus Prolog.
library/Mmakefile:
Delete the rules for building NU-Prolog and SICStus Prolog stuff.
library/library.nu.nl.in:
library/swi_*.m:
library/*.nu.nl:
library/array.nu.nl:
library/assoc_list.nu.nl:
library/char.nu.nl:
library/float.nu.nl:
library/int.nu.nl:
library/io.nu.nl:
library/library.nu.nl.in:
library/map.nu.nl:
library/mercury_builtin.nu.nl:
library/nc_builtin.nl:
library/require.nu.nl:
library/sp_builtin.nl:
library/sp_lib.nl:
library/std_util.nu.nl:
library/store.nu.nl:
library/string.nu.nl:
library/swi_builtin.m:
library/swi_lib.m:
library/term_io.nu.nl:
Delete these files.
scripts/mnc.in:
scripts/mnp.in:
scripts/mnl.in:
scripts/msc.in:
scripts/msl.in:
scripts/msp.in:
Delete these files.
doc/user_guide.texi:
Delete the documentation about the Prolog support.
NEWS:
w3/news/newsdb.inc:
Mention that we've removed the Prolog support.
Estimated hours taken: 0.5
boehm_gc/Mmakefile:
browser/Mmakefile:
compiler/Mmakefile:
doc/Mmakefile:
library/Mmakefile:
runtime/Mmakefile:
scripts/Mmakefile:
Separated out all the commands to create installation directories
into a single target in each Mmakefile, upon which all targets which
used to create directories depend. This avoids a race condition
with parallel installs into a new directory tree, whereby two or
more `mkdir -p' commands simultaneously try to create the same
missing path component, resulting in all but one failing.
Estimated hours taken: 0.25
compiler/make_hlds.m:
compiler/quantification.m:
doc/reference_manual.texi:
Some trivial changes to fix bugs in my previous change.
Estimated hours taken: 4
Fix some problems with quantification of lambda expressions.
doc/reference_manual.texi:
Document the new rules for quantification of lambda expressions.
compiler/make_hlds.m:
Implement the new rules for quantification of lambda expressions:
ensure that all variables in arguments of predicate or function
lambda expressions are locally quantified, but that variables
in the return value term of function lambda expressions are
quantified according to the usual rules.
compiler/quantification.m:
Add a comment about quantification of lambda expressions.
Also, in `rename_apart', check for and optimize the case
where no renaming is needed.
Estimated hours taken: 17
Add support for invoking interactive queries to mdb.
browser/interactive_query.m:
New module, to implement interactive queries.
browser/dl.m:
browser/name_mangle.m:
Copy these files from extras/dynamic_linking, since
they are needed by browser/interactive_query.m.
configure.in:
runtime/mercury_conf.h.in:
Autodetect the presence of support for dlopen() etc.
browser/dl.m:
Add #ifdefs so that the code will compile (but report
an error at runtime) if dlopen() etc. are not supported.
browser/browser_library.m:
Add interface_query, dl, and name_mangle to the list of
modules in this library.
trace/mercury_trace_browse.h:
trace/mercury_trace_browse.c:
Add a new function MR_trace_query() to interface to the ML_query()
function defined by browser/interfactive_query.m.
trace/mercury_trace_internal.c:
Add code to implement new commands `query', `cc_query', `io_query',
and `mmc_options', using the MR_trace_query() function defined by
trace/mercury_trace_browse.h.
runtime/mercury_grade.h:
Add code to define MR_GRADE_OPT, so that browser/interactive_query.m
can use this to invoke mmc with the same grade that the executable
being debugged was built with.
doc/mdb_categories:
doc/user_guide.texi:
Document the new commands `query', `cc_query', `io_query',
and `mmc_options'.
Estimated hours taken: 0.25
doc/reference_manual.texi:
Use the term "type class" rather than "typeclass" other than when
we are talking about the _declaration_. Basically, I have changed
all occurences of "typeclass" into "type class" unless it appears
inside `@code'.
Also fix a bug in a piece of example code; the call to `print' should
actually be a call to `portray'.
Estimated hours taken: 0.1
Fix some errors in the reference manual pointed out
by David Powers <powers@ist.flinders.edu.au>.
doc/reference_manual.texi:
Fix a typo: s/whole/whose/
Estimated hours taken: 0.5
Fix some errors in the reference manual pointed out
by David Powers <powers@ist.flinders.edu.au>.
doc/reference_manual.texi:
Document the fact that a pair of double quotes inside a string
stands for a single double quote, and that a pair of single
quotes inside a quoted name stands for a single single quote.
(This was always the intent -- it is also what the current
implementation implements and what that the ISO Prolog standard
requires.)
Also fix a typo: s/)/]/.
Estimated hours taken: 2
Add support for `install-info' and related TexInfo innovations.
configure.in:
Check for the `install-info' command.
doc/Mmakefile:
If we have `install-info', use it to install the entry
for mercury.info file in the .../info/dir file.
doc/mercury.info:
Add *INFO-DIR* commands, so that `install-info' works properly.
doc/*.texi:
Add @direntry and @dircategory commands, so that
`install-info' works properly.
(The initial version of this patch was provided by
Marko Schuetz <marko@ki.informatik.uni-frankfurt.de>.)
This replaces the old technique of hard-coding the *INFO-DIR*
info commands, inside `@ifinfo'.
Note that currently the Mmakefile does not actually invoke
install-info on all the info files; currently it only does that
for the menu file mercury.info, since it seems more polite to
just add a single entry in the top-level directory rather than
one for every single piece of Mercury-related documentation.
The change here to *.texi is just in case we should ever
decide to reverse that policy decision, or in case any other
tools that process info files start to make use of the
@direntry or @dircategory commands.
doc/texinfo.tex:
Update to the version from GNU texinfo 3.12, so that it
supports the @direntry and @dircategory commands.
Estimated hours taken: 0.1
doc/reference_manual.texi:
Fix some off-by-one errors in the code examples
for the use of nondet `pragma c_code'.
Thanks to Juergen Stuber <juergen@mpi-sb.mpg.de>
for pointing out the errors.
Estimated hours taken: 0.25
doc/reference_manual.texi:
Reword a few things, as suggested by dgj's review of my recent change.
Also mention that the typeclass constraints on an abstract instance
declaration must exactly match those on the corresponding definition.