Estimated hours taken: 8
Fix a bug in the module import mechanism -- use_module should
not be transitive. This change is needed for smart recompilation
to avoid needing to check whether the removal of a transitive
import could cause compilation errors -- it never should.
Also fix some bugs in the handling of type class declarations.
compiler/prog_data.m:
Add a `transitively_imported' pseudo-declaration, which
is placed before the items from `.int2' files and `.opt'
files.
Fix the representation of type class bodies.
`:- typeclass foo where [].' declares a typeclass with no
methods. `:- typeclass foo.' declares an abstract typeclass.
The old representation made no distinction between these cases.
compiler/hlds_data.m:
compiler/prog_data.m:
compiler/module_qual.m:
Move the declaration of type type_id from hlds_data.m to prog_data.m.
This avoids a duplicate declaration in module_qual.m.
compiler/modules.m:
Add a `transitively_imported' pseudo-declaration before the
items from `.int2' files.
Remove the bodies of typeclass declarations placed in `.int2'
files -- the methods should not be available unless the module
is explicitly imported.
compiler/module_qual.m:
Items after the `transitively_imported' pseudo-declaration
should not be considered when module qualifying locally
declared items.
compiler/equiv_type.m:
compiler/mercury_to_mercury.m:
compiler/prog_io_typeclass.m:
Handle the change to the representation of typeclass bodies.
compiler/prog_io_typeclass.m:
Check that the arguments of a typeclass declaration
are distinct variables.
compiler/make_hlds.m:
Handle abstract typeclass declarations.
compiler/check_typeclass.m:
Check that all typeclasses have a definition somewhere.
compiler/intermod.m:
Write abstract_exported typeclasses to the `.opt' file.
compiler/add_trail_ops.m:
compiler/context.m:
compiler/llds.m:
compiler/vn_type.m:
Add missing imports.
compiler/magic_util.m:
compiler/ml_type_gen.m:
Remove unnecessary imports.
NEWS:
Note that this change may break existing programs.
compiler/notes/todo.html:
Remove the item relating to this change.
tests/invalid/transitive_import.{m,err_exp}:
Add some tests for uses of transitively imported items.
tests/invalid/transitive_import_class.m:
tests/invalid/transitive_import_class2.m:
tests/invalid/transitive_import_class3.m:
tests/invalid/transitive_import_class.err_exp:
Add a test for use of transitively imported class methods.
tests/invalid/invalid_typeclass.{m,err_exp}:
Add some tests for invalid typeclass declarations.
tests/invalid/Mmakefile:
Add the new tests.
Estimated hours taken: 2
Branches: main
Merge the changes from the dotnet-foreign branch which deal with
namespaces.
compiler/ilasm.m:
compiler/ilds.m:
compiler/mlds_to_il.m:
compiler/mlds_to_mcpp.m:
For the module foo.m, place all the code in a type called
mercury_code in the namespace foo rather than in the type foo and no
namespace. This helps avoid problems where you have a type and a
namespace at the top level with the same name.
Only output a namespace declarations if the namespace has a name.
library/array.m:
library/builtin.m:
library/private_builtin.m:
library/std_util.m:
runtime/mercury_il.il:
Change to using the new convention for namespaces.
Estimated hours taken: 1
Branches: main
compiler/mlds_to_il.m:
Add hard-coded references to the public_key_tokens for the mercury and
mscorlib assemblies. This allows us to put the mercury library into
the global assembly cache.
Estimated hours taken: 45
Branches: main
Implement a C# interface for the .NET backend.
To use it, you currently need to set
--backend-foreign-language csharp --use-foreign-language csharp
in your MCFLAGS.
The C# foreign language interface works by introducing a new sort of
MLDS statement called outline_foreign_proc. outline_foreign_proc is expected
to be turned into a separate procedure in a separate file. This is
quite different to normal foreign code which has been renamed as inline
target code, as it is really intended to be generated inline, inside the
generated code.
Because outline_foreign_proc is expected to be generated outside the
normal code, we don't need to generate variable renamings,
initializations, casts and other complicated interfacing code.
Any marshalling is done by the backend, which knows how to marshall
arguments across the boundary into the outline code and back. In the
case of marshalling to C# from the .NET backend, we currently don't do
anything special (part of the point of .NET is that data
representation don't have to change very often just because you are
using different languages, so this is a property we should try to
preserve).
The actual implementation of the foreign code is therefore very simple.
Simply generate an appropriate procedure, and insert the user's code in
the middle.
The bulk of this change to delay the mangling of MLDS var names, so we
can still use the original user's var name when we output the outline
procedure (since the user's foreign code will refer to these var names,
it's important to keep them around).
compiler/foreign.m:
Handle the csharp foreign language.
compiler/globals.m:
Fix an XXX about converting to lowercase to do language name
comparisons.
Add new predicates to make conversion of foreign languages
to strings more uniform.
compiler/handle_options.m:
Don't set backend_foreign_language to the default if it has
already been set by hand.
compiler/ml_call_gen.m:
compiler/ml_code_gen.m:
compiler/ml_code_util.m:
Delay the mangling of MLDS var names by keeping the variable
number around until the output phase.
Slightly generalize the handling of foreign language interfacing.
Handle C# foreign language interfacing.
Add value_output_vars to the ml_gen_info, which are the variables
returned rather than passed by reference. We need to know
these variables for C# interfacing so that we can handle the return
value of the forwarding function.
Mark the beginning and end of the MLDS foreign language processing as
a "sub-module" (in comments at least). Later I may put this code
into a separate module.
Rename some predicates from c_code to foreign_code.
compiler/ml_elim_nested.m:
compiler/ml_optimize.m:
compiler/ml_string_switch.m:
compiler/ml_type_gen.m:
compiler/ml_unify_gen.m:
compiler/ml_util.m:
compiler/rtti_to_mlds.m:
Handle the new var_name type, and the new target_code constructors.
compiler/mlds.m:
Add outline_foreign_proc which is handled differently to the old
target_code (which has been renamed inline_target_code).
Change the definiton for mlds__var_name.
compiler/mlds_to_c.m:
Factor out mlds_output_to_file.
Handle the new var_name type, and the new target_code constructors.
compiler/mlds_to_csharp.m:
A new module to generate C# code suitable for foreign language
interfacing. This is largely lifted from the MC++ code, with a few
changes to the output syntax.
compiler/mlds_to_il.m:
Return the set of foreign languages processed instead of a bool
saying wither MC++ was present. This is so we can generate the
appropriate output .cs or .cpp files, and because we need to keep
track of all the external assembly references we need to put in the
.il file.
Handle the inline_target_code and mlds__var_name changes.
compiler/mlds_to_ilasm.m:
Output .cpp and .cs files conditionally.
Factor out output_to_file.
Move MC++ output code to mlds_to_mcpp.m
compiler/mlds_to_java.m:
Factor out output_to_file.
Handle the new var_name type, and the new target_code constructors.
compiler/mlds_to_mcpp.m:
New file to handle generating MC++ code suitable for foreign language
interfacing.
compiler/options.m:
Add a way of setting the backend-foreign-language option.
compiler/passes_aux.m:
Add output_to_file which is used by the MLDS backend to generate
output files.
compiler/prog_data.m:
Uncomment csharp as a foreign language.
Estimated hours taken: 0.25
Branches: main, release
compiler/typecheck.m:
Update an outdated error message: suggest using "with_type"
for explicit type qualifications.
Estimated hours taken: 8
Branches: main, release
Fix bugs with the handling of existentially typed data types
in various parts of the RTTI code.
Most of these bugs were due to passing in the pointer to the secondary
tag, rather than the pointer to the first real argument (one word
past the secondary tag).
library/std_util.m:
Fix bugs in ML_expand() and du_get_functor_info.
runtime/mercury_tabling.c:
Fix bug in MR_table_type().
runtime/mercury_deep_copy_body.h:
Fix bug in MR_agc_deep_copy(), the accurate GC version of deep_copy().
Also fix another bug in the same function: when copying existentially
typed data types, it was trying to use the type_infos in the original
data after they had already been replaced by forwarding pointers.
compiler/polymorphism.m:
For existentially typed data types, make sure that the
type_infos come BEFORE the typeclass_infos, not vice versa.
This is needed to match the code in the runtime system.
It's also consistent with the way we order them for procedure calls.
runtime/mercury_type_info.h:
Improve the comments a little.
tests/hard_coded/Mmakefile:
tests/hard_coded/deep_copy_exist.m:
tests/hard_coded/deep_copy_exist.exp:
Regression tests.
Estimated hours taken: 6
Branches: main, release
Fix a bug where the compiler was silently accepting invalid code.
doc/reference_manual.texi:
Document that type class methods must have their modes and
determinism explicitly declared.
compiler/make_hlds.m:
Report errors for predicate type class methods with no modes
or with modes but no determinism.
compiler/check_typeclass.m:
compiler/polymorphism.m:
Handle the case where a method has no declared determinism:
since make_hlds.m will have already reported the error,
we just need to avoid aborting or issuing spurious flow-on errors.
tests/invalid/Mmakefile:
tests/invalid/typeclass_missing_mode.m:
tests/invalid/typeclass_missing_mode.err_exp:
tests/invalid/typeclass_missing_mode_2.m:
tests/invalid/typeclass_missing_mode_2.err_exp:
tests/invalid/typeclass_missing_det.m:
tests/invalid/typeclass_missing_det.err_exp:
tests/invalid/typeclass_missing_det_2.m:
tests/invalid/typeclass_missing_det_2.err_exp:
tests/invalid/typeclass_missing_det_3.m:
tests/invalid/typeclass_missing_det_3.err_exp:
Add some regression tests.
tests/invalid/tc_err1.err_exp:
Update the expected output for this existing test.
Estimated hours taken: 1
Branches: main
Reorganize optimization levels 4 and 5, to use --no-lazy-code, --use-local-vars
and --delay-construct instead of --lazy-code and --optimize-value-number.
The new meanings of those optimization levels are the following:
opt_level(4, _, [
use_local_vars - bool(yes),
inline_simple_threshold - int(8),
inline_compound_threshold - int(20),
higher_order_size_limit - int(30)
]).
opt_level(5, _, [
optimize_repeat - int(5),
delay_construct - bool(yes),
inline_compound_threshold - int(100),
higher_order_size_limit - int(40)
]).
compiler/options.m:
Implement the new scheme for optimization levels 4 and 5.
Estimated hours taken: 10
Branches: main
Get highlevel-data working in the .NET backend.
Apart from problems with overloaded constructors (different arity but same
name), highlevel-data now appears to generate roughly correct code and
assemble correctly.
compiler/mlds_to_il.m:
Map types from MLDS to ILDS differently for --highlevel-data.
This involves passing some state around to tell the type conversion
routines what the value of the option --highlevel-data is.
compiler/mlds_to_ilasm.m:
Pass the appropriate data representation to procedures in mlds_to_il.
Estimated hours taken: 20
Branches: main
Add a new optimization, --use-local-vars, to the LLDS backend. This
optimization is intended to replace references to fake registers and stack
slots with references to temporary variables in C code, since accessing these
should be cheaper.
With this optimization and one for delaying construction unifications,
the eager code generator should generate code at least good as that produced by
the old value numbering pass. This should make it possible to get rid of value
numbering, which is much harder to maintain.
compiler/use_local_vars.m:
New module containing the optimization.
compiler/notes/compiler_design.html:
Mention the new module.
compiler/exprn_aux.m:
Add new utility predicates for use by use_local_vars.
If --debug-opt is specified, do not dump instruction sequences to
standard output. Instead, put them in separate files, where they can be
compared more easily.
compiler/options.m:
Add the --use-local-vars option to control whether the use_local_vars
pass gets run.
compiler/llds.m:
Add liveness information to the c_code and pragma_foreign_code LLDS
instructions, in order to allow use_local_vars to work in the presence
of automatically-generated C code (e.g. by debugging).
compiler/livemap.m:
Use the new liveness information to generate useful livemap information
even in the presence of automatically generated C code.
compiler/code_gen.m:
compiler/code_info.m:
compiler/dupelim.m:
compiler/frameopt.m:
compiler/llds_common.m:
compiler/llds_out.m:
compiler/middle_rec.m:
compiler/opt_debug.m:
compiler/opt_util.m:
compiler/pragma_c_gen.m:
compiler/trace.m:
compiler/vn_block.m:
compiler/vn_cost.m:
compiler/vn_filter.m:
compiler/vn_verify.m:
Provide and/or ignore this additional liveness information.
compiler/wrap_block.m:
The post_value_number pass wraps LLDS instruction sequences
using temporaries in a block instruction which actually declares
those temporaries. It used to be used only by value numbering;
it is now also used by use_local_vars. It has therefore been renamed
and put in its own file.
compiler/optimize.m:
Invoke use_local_vars if required, and call wrap_blocks instead of
post_value_number.
compiler/value_number.m:
Since the value numbering pass still cannot handle automatically
generated C code, check for it explicitly now that livemap carries out
only a weaker check.
compiler/basic_block.m:
Add a module qualification.
library/set.m:
library/set_bbbtree.m:
library/set_ordlist.m:
library/set_unordlist.m:
Add a new predicate, union_list, to each implementation of sets,
for use by some of the new code above.
tests/general/array_test.m:
Print out the result of each operation as soon as it is done, so that
if you get a seg fault, you know which operations have completed and
which haven't.
Estimated hours taken: 8
Branches: main
compiler/delay_construct.m:
A new module for delaying construction unifications past builtins in
conjunctions that can fail. The idea is to incur the cost of memory
allocation only if those tests succeed. This can speed up code (e.g.
tests/benchmarks/query) by integer factors.
compiler/notes/compiler_design.m:
Mention the new module.
compiler/options.m:
doc/user_guide.texi:
Add a new option, --delay-construct, that switches on the new
optimization.
compiler/mercury_compile.m:
Invoke the new optimization if the option calls for it.
Estimated hours taken: 2
Branches: main
Add support for nested classes.
Fix the implementation of inheritance.
compiler/ilasm.m:
Add code to allow nested classes in the IL assembler.
compiler/mlds_to_il.m:
Add code to generate nested classes.
Fix bugs in the code to handle inheritance -- most of the
inheritance was hand-coded for the case of continutation
environments.
Estimated hours taken: 1
Branches: main
compiler/pragma_c_gen.m:
We have traditionally generated the same code for model_semi
pragma foreign code, regardless of its actual determinism. This diff
changes that; for foreign code whos determinism is failure, it does not
check SUCCESS_INDICATOR, but fails directly instead.
The objective of this change is to speed up deep profiling, which
inserts many calls to procedures implemented in foreign code whose
determinism is failure.
Estimated hours taken: 0.25
Branches: main
compiler/intermod.m:
Fix a minor bug: the "% done" message for reading a `.opt' file
was being printed before the `.opt' file had actually been read.
Estimated hours taken: 2
Branches: main, release
compiler/ml_code_gen.m:
Fix a bug that occaisionally caused some type errors in the
generated code for --high-level-code grades (gcc was just issuing
a warning, but lcc was reporting an error message). The bug was
that we were using the wrong type when determining whether or
not a cast was needed for some code emitted for `pragma c_code'
procedures -- the type we need to use is the variable's original
type, not the type after inlining (which can be an instance
of the original type, if the original type is polymorphic).
Estimated hours taken: 0.1
Branches: main
compiler/handle_options.m:
Add a comment reminding us to modify scripts/canonical_grade.sh-subr
when we change the handling of the grade components.
Estimated hours taken: 6
Branches: main dotnet-foreign
Add assembly names to IL structured names, and pass state through the
IL assembly output phase. This allows us better control over output,
and lets us handle assembly reference outputs more intelligently.
This also allows us to eliminate lots of hacky code that tried to guess
the assembly name from the namespace name.
compiler/ilasm.m:
Thread state through the IL output phases.
Clean up the debugging code in here.
Move output_assembly_decl to a better palce.
compiler/ilds.m:
Redefine structured names to include the assembly name.
compiler/mlds_to_il.m:
Keep track of the current assembly in the il_info.
Clean up some of the hard-coded class names.
compiler/mlds_to_ilasm.m:
Write nested namespaces recursively.
Estimated hours taken: 2
Branches: main
compiler/mlds_to_il.m:
Handle lvals more intelligently -- now that type information is
available, we no longer need to guess about types of non-local
vars that are sometimes used in lvals. Also we need to
handle non-local vars when storing to lvals.
A side effect of this fix is that references to
private_builtin::dummy_var now have the correct type, and are
handled correctly, which fixes a bug where exception.il refused
to assemble because it was referencing a local variable called
"dummy_var".
library/private_builtin.m:
Add a definition of dummy_var.
Estimated hours taken: 1
Branches: main dotnet-foreign
compiler/ilasm.m:
compiler/mlds_to_il.m:
Add support for assembly declarations such as version numbers,
file hashes and public key tokens, which were previously
unavailable in our IL backend. We don't yet use any of these
declarations.
Estimated hours taken: 0.5
Branches: main
Fix a problem reported by Fergus where deforestation was missing
opportunities for optimization.
compiler/deforest.m:
Run simplification on each goal before processing it
to take advantage of any extra information provided by
inlined sub-goals.
Estimated hours taken: 2
Branches: main, release
Some changes needed to port Mercury to work on MinGW <http://www.mingw.org>.
util/Mmakefile:
Compile mkinit.c with `mgnuc --no-ansi'.
This is needed to get the declaration of `struct stat' on MinGW.
compiler/modules.m:
If renaming the `tmp_d' file doesn't work,
try again after removing the `.d' file.
This is needed since on MinGW, io__rename_file
(i.e. rename()) won't remove the target if it already exists.
Note that the behaviour of io__rename_file is explicitly
documented as being implementation-dependent in this situation,
so we need to handle this case here.
library/io.m:
Delete some MSVC-specific stuff that isn't needed.
Estimated hours taken: 4.5
Branches: main
Add the shorthand_goal_expr wrapper type to ease hlds->hlds transformations.
compiler/hlds_goal.m
Create a new type, the `shorthand_goal_expr', for goals kinds that
are implemented by a (ordinary_hlds + shorthand) -> (ordinary_hlds)
transformation. At present, bi_implication is the only kind of
of goal that is implemented in this way.
Moved bi_implication functor from the type goal_expr to the new
shorthand_goal_expr type.
Added the functor shorthand to the goal_expr type.
compiler/*.m
Change switches on hlds_goal_expr that call error when they recognise
`bi_implication' from calling error when they recognise
`bi_implication' to calling error when they recognise `shorthand'.
For all predicates K that
a) switch on hlds_goal_expr and
b) perform non-trivial processing when they recognise
`bi_implication'
change K such that it now calls K_shorthand upon recognising the
functor `shorthand'. Define K_shorthand to switch on
shorthand_goal_expr, where the code for the `bi_implication' case
formerly contained in K is now contained in K_shorthand.
Estimated hours taken: 0.25
Branches: main, release
compiler/modules.m:
We only need to generate a body for the install_hdrs target if we
have been generating high-level C code.
Estimated hours taken: 4.0
Branches: main
Rename foreign_code as foreign_proc where appropriate in the compiler.
The rationale for this change is that it makes maintaining the code much
simpler because it is clear whether `foreign' refers to a slab of code
(foreign_code) or a procedure (foreign_proc).
:- type pragma_foreign_code_attributes
:- type pragma_foreign_proc_attributes
The functors for pragma_type
foreign(Lang, BodyCode)
foreign(Attributes, Name, PredOrFunc, Vars, Varset, Impl)
become
foreign_code(Lang, BodyCode)
foreign_proc(Attributes, Name, PredOrFunc, Vars, Varset, Impl)
And the HLDS goal `pragma_foreign_code' becomes `foreign_proc'.
compiler/*.m:
Update the compiler to use the new names.
Estimated hours taken: 1.5
Branches: main, release
Fix a bug reported by dgj.
compiler/inst_util.m:
Fix a bug in inst_merge: it wasn't handling the case where a
bound inst containing any insts was merged with a ground inst.
That case should be allowed.
tests/valid/Mmakefile:
tests/valid/any_inst_merge.m:
A regression test.
Estimated hours taken: 15
Branches: main
Fix the handling of purity in the optimization and tabling passes.
Without this change tests/tabling/unused_args.m fails with
inter-module optimization.
compiler/purity.m:
compiler/post_typecheck.m:
Allow purity checking to be rerun on a single procedure
without requiring an io__state. If the purity is worse
(due to inlining a predicate with a `:- pragma promise_pure'
declaration), add `promised_pure' or `promised_semipure'
to the pred_info.
compiler/hlds_out.m:
compiler/hlds_pred.m:
compiler/intermod.m:
compiler/make_hlds.m:
compiler/mercury_to_mercury.m:
compiler/module_qual.m:
compiler/modules.m:
compiler/prog_data.m:
compiler/prog_io_pragma.m:
compiler/purity.m:
doc/reference_manual.texi:
NEWS:
Implement `:- pragma promise_semipure'. This is needed if
an predicate marked `promised_pure' which calls impure
predicates is inlined into a semipure predicate.
compiler/inlining.m:
Make sure the purity markers on the goal_infos are correct
after inlining predicates which are promised pure.
Export a predicate inlining__can_inline_proc which is used
by deforestation to determine whether inlining a procedure
will change the semantics or will break code generator invariants.
compiler/deforest.m:
Use the same method as inlining.m to work out whether
a procedure can be inlined. Don't inline predicates which
are promised pure because the extra impurity which
will be propagated through the goal will stop deforestation
working on the goal.
compiler/simplify.m:
Make sure the goal_info resulting from converting a singleton
switch into a conjunction has the correct purity.
compiler/table_gen.m:
Make sure the purity markers on the generated goal_infos are
correct.
Make sure that call_table_gen goal features cannot be removed
by optimization passes.
Don't put unnecessary `impure' markers on calls to error/1.
tests/debugger/loopcheck.exp:
tests/debugger/retry.exp:
Adjust the expected output. The change to ensure that
`call_table_gen' goal features can't be removed alters
the goal paths slightly.
tests/invalid/impure_method_impl.m:
Adjust the expected output now that predicates can
be promised semipure.
Estimated hours taken: 0.5
Branches: main, reuse, release
compiler/mercury_compile.m:
Make sure that the exit status is set to a non-zero value if the
number of errors is > 0.
Estimated hours taken: 1
Branches: main
Ignore no_aliasing, unknown_aliasing and alias/2 attributes on
pragma_foreign_code. This allows the main branch to compile the
reuse branch.
compiler/prog_io_pragma.m:
Parse no_aliasing, unknown_aliasing and alias/2 attributes.
Estimated hours taken: 40
(to do this merge... 100s of hours on the HAL branch
itself by myself and Warwick Harvey though).
Merge the changes from the HAL branch onto the main branch. With the recent
changes made to the HAL implementation, this means adding just one grade,
`.rt' or --reserve-tag, which reserves one tag (zero) in each type for
use by HAL's Herbrand constraint solver. This disables no-tag types and
enumerations.
This grade will now bootstrap, and passes all tests, except for a few failing
cases in the debugger and tabling directories.
compiler/options.m:
compiler/handle_options.m:
Add the `.rt' or --reserve-tag grade option.
runtime/mercury_conf_param.h:
Document the macro MR_RESERVE_TAG
doc/user_guide.texi:
Document the `.rt' grade.
compiler/make_hlds.m:
Don't record any types as no-tag types if we are in a .rt grade.
compiler/make_tags.m:
compiler/type_ctor_info.m:
Allocate tags starting from `1' in .rt grades.
compiler/rtti_out.m:
In .rt grades, output a dummy ptag definition for tag `0'.
compiler/type_util.m:
Add predicates `type_util__constructors_are_dummy_argument_type' and
`type_constructors_are_type_info' for use when allocating tags to
ensure that type infos and dummy types (io__state/0 and store__store/1)
are still treated as no-tag types in .rt grades.
library/sparse_bitset.m:
When allocating a sparse bitset element, use tag `1' if we are in a
.rt grade.
runtime/mercury_tags.h:
Define a macro `MR_UNIV_TAG' which is `1' is we in a .rt grade and
`0' otherwise. (Now that univ is a user defined type, it is a also
assigned a `var' tag).
Also make the definitions of MR_RAW_TAG_NIL and MR_RAW_TAG_CONS take the
.rt grade into account.
runtime/mercury_type_info.h:
Define `MR_unravel_univ' and
`MR_initialise_univ' for taking apart and putting together univs.
Add a new secondary tag alternative: MR_SECTAG_VARIABLE, used to
represent Herbrand variables.
library/std_util.m:
Use MR_UNIV_TAG, MR_unravel_univ and MR_initialise_univ when
manipulating univs.
Handle the new MR_SECTAG_VARIABLE secondary tag by aborting.
runtime/mercury_deep_copy_body.h:
runtime/mercury_tabling.c:
runtime/mercury_unify_compare_body.h:
Handle the new MR_SECTAG_VARIABLE secondary tag by aborting.
library/std_util.m:
Add a constant for MR_SECTAG_VARIABLE in the MC++ back end.
scripts/canonical_grade.sh-subr:
scripts/init_grade_options.sh-subr:
scripts/mgnuc.in:
scripts/parse_grade_options.sh-subr:
Process the new grade.
scripts/mmake.in:
Add an option `--include-makefile', which includes a Makefile given
as a command line argument into the Makefile generated by mmake.
This is used to implement `halmake', a make program for HAL which
just passes a bunch of extra rules and variable definitions onto
mmake.
tests/debugger/existential_type_classes.m:
tests/hard_coded/existential_types_test.m:
trace/mercury_trace_declarative.c:
trace/mercury_trace_external.c:
trace/mercury_trace_internal.c:
Use MR_UNIV_TAG.
TODO:
- The declarative debugger falls over in .rt grades. This is possibly
because compiler/static_term.m assumes that the generated code uses
the same data representation as the compiler itself. This should be
fixed, although it is not critical; the declarative debugger won't
work with trailing as is, and the .rt grade is only ever used in
conjunction with trailing (.tr) at this stage.
Estimated hours taken: 5
Branches: main
Add support for context output to the .NET backend.
We output
.line 42 'filename.m'
into the IL aseembler. The assembler will create the appropriate
debugging information, and then the .NET debugger can do source linked
debugging.
Note that we don't handle contexts in foreign language (MC++) code yet.
compiler/il_peephole.m:
Handle context instructions.
compiler/ilasm.m:
compiler/ilds.m:
Add context instructions to the IL "instruction set".
compiler/mlds_to_il.m:
Create context instructions whenever we have context information
available.
Estimated hours taken: 0.25
Branches: main
Merge changes from the reuse branch back onto the main branch.
compiler/ml_unify_gen.m:
Handle the case where the tag on the cell to be reused is unknown.
compiler/hlds_goal.m:
Add a field which records what possible cons_ids the cell to be
reused can be tagged with.
compiler/builtin_ops.m:
Add the unary builtin operator strip_tag.
compiler/bytecode.m:
compiler/c_util.m:
compiler/java_util.m:
compiler/llds.m:
compiler/mlds_to_il.m:
compiler/opt_debug.m:
bytecode/mb_disasm.c:
bytecode/mb_exec.c:
Handle the strip_tag operator.
Estimated hours taken: 0.5
Branches: main, reuse
Back out my previous change to ml_unify_gen, and fix mlds_to_c instead
to handle the body binop.
compiler/ml_unify_gen.m:
Back out my previous broken change.
compiler/mlds_to_c.m:
Handle the body binop.
Estimated hours taken: 1.5
Branches: main and release
compiler/intermod.m:
Fix a bug which caused a software error when writing
instance declarations to a `.opt' file when the
method implementation for a function matched a constructor
or a field access function.
Test case: tests/hard_coded/typeclasses/record_syntax.m.
Estimated hours taken: 16
Branches: main
Fix the interaction of the eager code generator with accurate gc to the extent
of getting to the end of stage 2 of a bootcheck in the asm_fast.agc grade.
compiler/call_gen.m:
compiler/pragma_c_gen.m:
Kill the variables in the post-death set that are not needed after the
call is made before we make the call, in particular before we clear
the registers (to reflect the fact that the callee may modify any
register). This prevents var_locn from throwing exceptions in accurate
gc grades.
compiler/code_info.m:
Delete the code for killing the variables in post-death set in
code_info__setup_call, since this is now done in the setup_call's
callers in call_gen.m.
compiler/var_locn.m:
Turn back on the sanity check we had to turn off because we were
deleting the states of variables before we killed them.
Estimated hours taken: 1
Branches: main
Merge changes from the reuse branch to the main branch.
This change introduces a new import_status opt_exported.
A local predicate which appeared in a .opt file (even if it was only a
call to that predicate) needs to have its export status changed to
exported so that an entry point to that predicate is available. This
can confuse the structure reuse analysis, so we added the new
import_status: opt_exported.
compiler/hlds_pred.m:
Add opt_exported to the import_status, and adapt the predicates
corresponding predicates.
compiler/intermod.m:
When the status of a local predicate is changed due to its presence
in the .opt file, this status is now set to opt_exported instead of
exported.
compiler/unused_args.m:
When we check for pred_info_is_exported, also check for
pred_info_is_opt_exported.
compiler/termination.m:
Write out termination info pragmas for opt_exported procedures.
compiler/assertion.m:
compiler/hlds_out.m:
Minor changes.
Estimated hours taken: 0.5
compiler/intermod.m:
Don't append variable numbers to type variables in the
`:- pred' or `:- func' declarations for predicates
defined in foreign code. The foreign code may contain
references to variables such as `TypeInfo_for_T' which
will break if `T' is written as `T_1' in the `:- pred'
or `:- func' declaration.
tests/hard_coded/Mmakefile:
tests/hard_coded/intermod_c_code.m:
tests/hard_coded/intermod_c_code2.m:
tests/hard_coded/intermod_c_code.exp:
Test case.
Estimated hours taken: 0.5
Fix a problem where the nightly tests were failing the `--target asm'
tests, because they were passing `--pic-reg', and that option was
being used with different semantics for the gcc back-end.
compiler/options.m:
Add new `--pic' option.
compiler/mlds_to_gcc.m:
Use `--pic' rather than (ab)using `--pic-reg'.
doc/user_guide.texi:
Document the new option.
Estimated hours taken: 0.5
Branches: main
compiler/handle_options.m:
If we are introducing accumulators turn on two optimizations which
increase the chance of accumulator introduction.