Commit Graph

2423 Commits

Author SHA1 Message Date
Fergus Henderson
b9bfa4bcc1 Fix some misleading variable names and comments:
Estimated hours taken: 0.25

compiler/prog_io_goal.m:
	Fix some misleading variable names and comments:
	at this point in the compilation, arguments of lambda expressions
	may be arbitrary terms, not just variables, so refer to them
	as "Arg" or "argument" rather than "Var" or "variable".
1999-03-24 13:30:21 +00:00
Fergus Henderson
d4694d2e48 Deprecate the old style of lambda expressions.
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.
1999-03-24 05:32:26 +00:00
Tyson Dowd
ec5cfac2e8 Rename some missed references to base_type_* as type_ctor_* in
Estimated hours taken: 0.1

compiler/base_type_layout.m:
compiler/polymorphism.m:
compiler/type_util.m:
	Rename some missed references to base_type_* as type_ctor_* in
	some comments and an error message.
1999-03-24 03:11:16 +00:00
Tyson Dowd
a5fcfcabcb Rename some missed references to base_type_* as type_ctor_* in
Estimated hours taken: 0.1

compiler/base_type_layout.m:
compiler/polymorphism.m:
compiler/type_util.m:
	Rename some missed references to base_type_* as type_ctor_* in
	some comments and an error message.
1999-03-24 03:11:13 +00:00
Tyson Dowd
9e3a8eae9c During the writing of the RTTI paper, we decided that type_ctor_info
Estimated hours taken: 8

During the writing of the RTTI paper, we decided that type_ctor_info
was a much better name than base_type_info.

Rename base_type* as type_ctor*, except we don't rename the modules
base_type_info and base_type_layout just yet.

Most of these changes were made using the following sed patterns:

s/base_type_info/type_ctor_info/g
s/base_type_layout/type_ctor_layout/g
s/base_type_functors/type_ctor_functors/g
s/BASETYPE_INFO/TYPE_CTOR_INFO/g
s/TYPEFUNCTORS/TYPE_CTOR_FUNCTORS/g
s/TYPELAYOUT/TYPE_CTOR_LAYOUT/g
s/BASE_TYPEINFO/TYPE_CTOR_INFO/g
s/BASE_TYPE_INFO/TYPE_CTOR_INFO/g
s/BaseTypeInfo/TypeCtorInfo/g
s/BaseTypeLayout/TypeCtorLayout/g
s/base_type(/type_ctor(/g
s/:- module type_ctor_info/:- module base_type_info/g
s/:- module type_ctor_layout/:- module base_type_layout/g
s/type_ctor_info__/base_type_info__/g
s/type_ctor_layout__/base_type_layout__/g
/import_module/s/type_ctor_info/base_type_info/g
/import_module/s/type_ctor_layout/base_type_layout/g

compiler/*.m:
library/*.m:
runtime/*.{c,h}:
profiler/demangle.m:
util/mdemangle.c:
	Applied the above sed commands.

runtime/mercury_bootstrap.h:
	Add bootstrapping #defines so the type_ctor_* substitutions in
	the library don't cause link problems.

	Delete some redundant bootstrapping definitions.
1999-03-22 08:09:52 +00:00
Tyson Dowd
1f312b45e9 During the writing of the RTTI paper, we decided that type_ctor_info
Estimated hours taken: 8

During the writing of the RTTI paper, we decided that type_ctor_info
was a much better name than base_type_info.

Rename base_type* as type_ctor*, except we don't rename the modules
base_type_info and base_type_layout just yet.

Most of these changes were made using the following sed patterns:

s/base_type_info/type_ctor_info/g
s/base_type_layout/type_ctor_layout/g
s/base_type_functors/type_ctor_functors/g
s/BASETYPE_INFO/TYPE_CTOR_INFO/g
s/TYPEFUNCTORS/TYPE_CTOR_FUNCTORS/g
s/TYPELAYOUT/TYPE_CTOR_LAYOUT/g
s/BASE_TYPEINFO/TYPE_CTOR_INFO/g
s/BASE_TYPE_INFO/TYPE_CTOR_INFO/g
s/BaseTypeInfo/TypeCtorInfo/g
s/BaseTypeLayout/TypeCtorLayout/g
s/base_type(/type_ctor(/g
s/:- module type_ctor_info/:- module base_type_info/g
s/:- module type_ctor_layout/:- module base_type_layout/g
s/type_ctor_info__/base_type_info__/g
s/type_ctor_layout__/base_type_layout__/g
/import_module/s/type_ctor_info/base_type_info/g
/import_module/s/type_ctor_layout/base_type_layout/g

compiler/*.m:
library/*.m:
runtime/*.{c,h}:
profiler/demangle.m:
util/mdemangle.c:
	Applied the above sed commands.

runtime/mercury_bootstrap.h:
	Add bootstrapping #defines so the type_ctor_* substitutions in
	the library don't cause link problems.

	Delete some redundant bootstrapping definitions.
1999-03-22 08:09:08 +00:00
Simon Taylor
d38f9f8bee Change the bit shift functions to perform checking to avoid
Estimated hours taken: 1

Change the bit shift functions to perform checking to avoid
implementation defined behaviour.

library/int.m:
	Add checking to `int:<<' and `int:>>'.
	Add `int:unchecked_left_shift' and `int:unchecked_right_shift'
	which do not perform any checking.

compiler/code_util.m:
	Replace `int:<<' and `int:>>' with `int:unchecked_left_shift' and
	`int:unchecked_right_shift' in the builtin table.

NEWS:
	Mention the changes to int.m.

tests/hard_coded/Mmakefile:
tests/hard_coded/shift_test.m:
tests/hard_coded/shift_test.exp:
	Test the shift functions.
1999-03-22 00:33:54 +00:00
Simon Taylor
8513f29471 Don't add indexes to relations twice.
Estimated hours taken: 0.1

compiler/rl_out.m:
	Don't add indexes to relations twice.
1999-03-19 04:47:39 +00:00
Simon Taylor
a25222f13f Fix a bug caused by confusing a relation_id with an index
Estimated hours taken: 0.25

compiler/rl_out.m:
	Fix a bug caused by confusing a relation_id with an index
	into the generated code's variable table.
1999-03-19 03:38:21 +00:00
Simon Taylor
4e8a28fe23 Accept `*_optimise_*' for the Aditi optimization options.
Estimated hours taken: 0.1

compiler/options.m:
	Accept `*_optimise_*' for the Aditi optimization options.
1999-03-19 01:43:40 +00:00
Simon Taylor
0ee3e16d5c Use floating point functions instead of the obsolete predicates.
Estimated hours taken: 0.1

compiler/fact_table.m:
compiler/term_pass1.m:
	Use floating point functions instead of the obsolete predicates.
1999-03-18 01:31:33 +00:00
Simon Taylor
062331338d Fix a bug where the generated code tested whether
Estimated hours taken: 0.5

Fix a bug where the generated code tested whether
a relation which was never created was empty.

compiler/rl_gen.m:
	Don't include procedures with `generate_inline' markers
	(used to create input relations for calls) in the list of entry
	points for a procedure. Difference relations for these
	are never created, so they should not be included in the
	fixpoint check at the start of each iteration.
1999-03-18 00:55:07 +00:00
Fergus Henderson
f37e8ff1f2 Fix a bug with typeclasses where the compiler would sometimes
Estimated hours taken: 2

Fix a bug with typeclasses where the compiler would sometimes
generate code that called the wrong method.

compiler/make_hlds.m:
	Ensure that the list(pred_proc_id) in the hlds_class_defn
	is sorted, to match the way that check_typeclass.m generates
	the corresponding list(pred_proc_id) for the hlds_instance_defn.

tests/hard_coded/typeclasses/Mmakefile:
tests/hard_coded/typeclasses/func_default_mode_bug.m:
tests/hard_coded/typeclasses/func_default_mode_bug.exp:
tests/hard_coded/typeclasses/mode_decl_order_bug.m:
tests/hard_coded/typeclasses/mode_decl_order_bug.exp:
	Add a couple of regression tests for problems fixed by
	the above change.
1999-03-17 20:41:50 +00:00
Fergus Henderson
b36c784213 Improve the way we print out type class method calls:
Estimated hours taken: 0.25

compiler/hlds_out.m:
	Improve the way we print out type class method calls:
		- fix a missing newline bug
		- print out the method number
1999-03-17 18:19:34 +00:00
Fergus Henderson
14728289fa Remove support for NU-Prolog and SICStus Prolog.
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.
1999-03-15 08:48:36 +00:00
Warwick Harvey
4a52a9b94c Separated out all the commands to create installation directories
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.
1999-03-15 00:39:30 +00:00
Simon Taylor
d53fd6a5d8 Materialise streams where necessary when taking references.
Estimated hours taken: 0.1

compiler/rl_out.m:
	Materialise streams where necessary when taking references.
	Add indexes to the output of a copy instruction where appropriate.
1999-03-14 23:31:14 +00:00
Fergus Henderson
8adf7ea76f Some trivial changes to fix bugs in my previous change.
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.
1999-03-13 01:29:14 +00:00
Fergus Henderson
282a153978 Fix some problems with quantification of lambda expressions.
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.
1999-03-12 07:45:48 +00:00
Zoltan Somogyi
8d41d4200a Fix some old problems with HLDS dumps, including blank lines between goals
Estimated hours taken: 4

Fix some old problems with HLDS dumps, including blank lines between goals
(using vi's paragraph commands to move between predicates now works),
unescaped characters in strings and chars in unifications, and extra dots
in type definitions.

compiler/hlds_out.m:
	Make the above fixes. To fix the problem of blank lines between goals,
	we reinterpret the meaning of the Follow arguments of several
	predicates that print goals, which say what to print after the
	goal, to include the newline to print after the goal. This avoids
	lots of separate calls to io__write_string("\n").

	Document the meanings of the arguments of many predicates.

compiler/prog_out.m:
	Modify prog_out__write_sym_name to escape any special characters
	(e.g. newlines) in the symbols written. (Strings, as cons_ids,
	are printed as symbols.)

	Add a new predicate for printing a symbol with single forward quotes
	around it.

compiler/mercury_to_mercury:
	When printing cons_id, quote strings.

compiler/constraint.m:
compiler/mode_errors.m:
compiler/pd_debug.m:
compiler/rl_dump.m:
compiler/saved_vars.m:
	Conform to the new meaning of the Follow arguments in hlds_out.m.
1999-03-12 06:14:17 +00:00
Zoltan Somogyi
e33efd211a Allow the native collector to work for nondet code, by generating layout
Estimated hours taken: 10

Allow the native collector to work for nondet code, by generating layout
structures for the resumption points whose addresses can be put into
redoip slots in nondet stack frames.

If the program is compiled with both native gc and debugging, entries
to disjunctions will have two labels and two layout structures, one
for gc and one for the debugger. At the moment we make no attempt
to try to combine the two structures, since doing so would add significant
extra complexity. Optimizing this option combination will not be important
for a while yet anyway.

compiler/code_info.m:
	Update the code that generates resume points to also optionally
	generate layout structures for the stack labels.

compiler/disj_gen.m:
	When we save the heap pointer, update not only the current code_info
	but the saved code_info that represents the branch start position
	as well, since the slot containing the saved heap pointer will be
	live in each of the following disjuncts.

compiler/labelopt.m:
compiler/mercury_compile.m:
compiler/optimize.m:
compiler/value_number.m:
	Arrange to pass the global_data structure to the label elimination
	and value numbering passes. This is to (a) prevent the label
	elimination pass from removing labels (e.g. stack resume labels)
	that have layout structures, and (b) to prevent value numbering
	for moving computations across such labels, since that would
	invalidate the layout structure.

	(The presence of pragma_c_code fragments in the generated code avoids
	both these potential problems for layout structures that correspond
	to trace events, but that solution would be suboptimal for resume
	labels.)

compiler/hlds_module.m:
	Add a utility predicate needed by optimize.m.
1999-03-12 05:53:29 +00:00
Simon Taylor
eb8068df7c Don't halt-at-warn for warnings about clauses for builtins, since
Estimated hours taken: 0.1

compiler/make_hlds.m:
	Don't halt-at-warn for warnings about clauses for builtins, since
	this would require messing about with the test scripts.
1999-03-12 05:46:27 +00:00
Simon Taylor
e73084a0c2 Ignore (with a warning) clauses for builtins.
Estimated hours taken: 0.1

compiler/make_hlds.m:
	Ignore (with a warning) clauses for builtins.
	This will make it easier to bootstrap a future change
	to add checking for the integer shift operations.
1999-03-12 03:30:43 +00:00
Fergus Henderson
51562aafa2 Separate out some duplicated code into a subroutine.
Estimated hours taken: 0.25

compiler/make_hlds.m:
	Separate out some duplicated code into a subroutine.
1999-03-10 21:26:27 +00:00
Simon Taylor
4311c94072 Fix reversed arguments in a call.
Estimated hours taken: 0.1

compiler/bytecode_data.m
	Fix reversed arguments in a call.
1999-03-10 00:01:42 +00:00
Simon Taylor
0c558c9b87 Turn on duplicate removal for sort.
Estimated hours taken: 0.1

compiler/rl_out.m:
	Turn on duplicate removal for sort.
1999-03-08 23:57:04 +00:00
Simon Taylor
65780aaf5d Fix bugs in the Aditi bytecode output routines.
Estimated hours taken: 2

Fix bugs in the Aditi bytecode output routines.

compiler/bytecode.m:
compiler/bytecode_data.m:
	Move the data conversion predicates from bytecode.m to a new module
	so they can be used by for output of Aditi-RL bytecode in the
	compiler and in the RL bytecode assembler in the Aditi distribution.
	Add new predicates to convert integers and floats to lists of
	bytes rather than writing them out immediately.

compiler/rl_code.m:
	Use the same data conversion predicates for Aditi-RL
	bytecodes as for Mercury bytecodes.
	This fixes a bug with the output of integers on 32 bit machines
	(integers were being shifted by more than the width of the type,
	the result of which is undefined) and endianness problems with
	floating point numbers.
1999-03-08 06:09:38 +00:00
Simon Taylor
4156e96d3c Fix a performance bug where multiple copies of the
Estimated hours taken: 1

compiler/rl_block_opt.m:
	Fix a performance bug where multiple copies of the
	output of a projection were being created.
	Add some comments.
	Reorder the arguments of a predicate.
1999-03-08 06:07:14 +00:00
Fergus Henderson
306f592d27 Avoid some spurious flow-on diagnostics.
Estimated hours taken: 1

Avoid some spurious flow-on diagnostics.

compiler/mercury_compile.m:
	Pass down a boolean indicating whether we got any type errors
	to purity.m.

compiler/purity.m:
	Only call post_typecheck__check_type_bindings if we didn't get
	any type errors, because if we did get any type errors, then
	calling check_type_bindings may lead to a lot of spurious
	diagnostics.

tests/invalid/types.err_exp:
tests/invalid/errors2.err_exp:
	Update the expected error messages for these test cases to
	reflect the fact that we no longer warnings in these cases.
1999-03-05 13:09:36 +00:00
Fergus Henderson
da786650c5 Update the documentation to use the new ftp site ftp.mercury.cs.mu.oz.au.
Estimated hours taken: 2

Update the documentation to use the new ftp site ftp.mercury.cs.mu.oz.au.

w3/include/mcorba.inc:
w3/download/include/*.inc:
	Change the ftp site from turiel.cs.mu.oz.au to ftp.mercury.cs.mu.oz.au.

compiler/notes/release_checklist.html:
	Update the documentation on ftp site maintenance
	and also a few other things.
1999-02-28 17:51:03 +00:00
David Jeffery
23884b50f8 Fix a bug whereby the @#$!% typeclass-infos nested inside another
Estimated hours taken: 25

Fix a bug whereby the @#$!% typeclass-infos nested inside another
typeclass-info (ie. from the constraints on an instance decl) were being
inserted in the reverse order. This caused the code to jump to the wrong
type class method.

compiler/polymorphism.m:
        Reverse the list of argument variables that we get back from
        polymorphism__make_typeclass_info_vars_2 because they are built
        up in reverse.

        Also fix a buggy comment about the order that the extra arguments
        are added in by this pass.

tests/hard_coded/typeclasses/implied_instance_multi_constraint.{m, exp}:
        A test case for this bug fix.
tests/hard_coded/typeclasses/Mmakefile:
        Add this test case.
1999-02-28 06:54:44 +00:00
Fergus Henderson
bf76f85e9a Use more meaningful variable names,
Estimated hours taken: 0.1

compiler/make_hlds.m:
	Use more meaningful variable names,
	as suggested by dgj's review of my previous change.
1999-02-19 19:47:33 +00:00
Zoltan Somogyi
32cced660a Allow HLDS dumps to contain references to the pointers used by tabling.
Estimated hours taken: 0.5

Allow HLDS dumps to contain references to the pointers used by tabling.
Without this chance, HLDS dumps can abort on modules containing tabled
procedures.

compiler/hlds_out.m:
	Allow HLDS dumps to contain references to the pointers used by tabling.
	This requires adding an extra argument to an exported procedure.

compiler/mode_errors.m:
compiler/typecheck.m:
	Pass the extra argument that exported procedure.
1999-02-18 03:48:47 +00:00
Fergus Henderson
1f535128ae Fix a bug with the handling of instance declarations with no methods.
Estimated hours taken: 0.5

Fix a bug with the handling of instance declarations with no methods.

compiler/check_typeclass.m:
	Ensure that the MaybePredProcs field of the HLDS instance definition
	for instance definitions with no methods is set to `yes([])' rather
	than `no' -- the latter would indicate that this pass hasn't been
	run yet.
1999-02-15 07:13:22 +00:00
Fergus Henderson
39e15e87d7 Implement abstract instance declarations.
Estimated hours taken: 0.25

Implement abstract instance declarations.
(I forgot to commit changes to these two files as part of my last commit.)

compiler/mercury_to_mercury.m:
compiler/module_qual.m:
	Change the code to reflect the new name and representation
	of `instance_interface'.
1999-02-14 13:02:37 +00:00
Fergus Henderson
59fda6bfdf Implement abstract instance declarations.
Estimated hours taken: 9

Implement abstract instance declarations.

compiler/prog_data.m:
	Rename the `instance_interface' type as `instance_body',
	and make it a discriminated union: either `abstract',
	or `concrete(Methods)'.

compiler/prog_io_typeclass.m:
compiler/hlds_data.m:
compiler/hlds_out.m:
compiler/equiv_type.m:
compiler/check_typeclass.m:
	Change the code to reflect the new name and representation
	of `instance_interface'.

compiler/prog_io_typeclass.m:
	Parse abstract instance declarations.

compiler/make_hlds.m:
	Clean up the code a bit, and make sure that it detects some errors
	which previously we didn't detect: duplicate or overlapping
	instance declarations, and instance declarations with methods for
	classes with no methods.

compiler/check_typeclass.m:
	If an instance is abstract, then we don't need to check
	that the methods in the instance body match those in the class.

compiler/base_typeclass_info.m:
	Only generate base_typeclass_infos for concrete instance
	declarations, not for abstract ones.

doc/reference_manual.texi:
	Document the change.

tests/hard_coded/typeclasses/Mmakefile:
tests/hard_coded/typeclasses/abstract_instance.m:
tests/hard_coded/typeclasses/use_abstract_instance.m:
tests/hard_coded/typeclasses/use_abstract_instance.exp:
tests/invalid/Mmakefile:
tests/invalid/typeclass_test_9.m:
tests/invalid/typeclass_test_9.err_exp:
	Some test cases.

tests/hard_coded/typeclasses/Mmakefile:
	Uncomment typeclass_test_5.m, since we pass that now
	(and have done so for quite some time).

tests/invalid/typeclass_test_[3-5].err_exp:
	Update to reflect additional error messages produced
	by the improved error checking in compiler/make_hlds.m.
1999-02-12 03:46:59 +00:00
Fergus Henderson
28b8d56689 Put back a blank line that I accidentally deleted in my previous
Estimated hours taken: 0.01

compiler/modules.m:
	Put back a blank line that I accidentally deleted in my previous
	change.
1999-02-09 00:27:44 +00:00
Fergus Henderson
c60e618e9a Fix a bug with the arguments passed to c2init by the generated `.dep'
Estimated hours taken: 1

compiler/modules.m:
	Fix a bug with the arguments passed to c2init by the generated `.dep'
	file when using fact tables: it should not pass the fact table `.c'
	files to c2init, because the fact table `.c' files do not have
	(or need) any initialization function.
1999-02-08 23:20:30 +00:00
Fergus Henderson
16b9fbe1f0 Fix a bug where inlining of fact tables caused duplicate
Estimated hours taken: 1.5

Fix a bug where inlining of fact tables caused duplicate
labels in the generated C code.

compiler/make_hlds.m:
	Make `pragma fact_table' imply `pragma no_inline'.

compiler/fact_table.m:
	Update some old comments which said that nondet `pragma c_code'
	was not yet implemented.

doc/reference_manual.texi:
	Document that `pragma c_code' should not contain labels
	unless there is a matching `pragma no_inline'.
1999-02-08 22:42:51 +00:00
Fergus Henderson
0cf838a152 Fix a bug with the dependencies computed when using
Estimated hours taken: 1

compiler/modules.m:
	Fix a bug with the dependencies computed when using
	both fact tables and `--use-subdirs'.
1999-02-08 22:40:56 +00:00
Fergus Henderson
474a223d6d Fix typo in comment: s/fals/fails/
Estimated hours taken: 0.01

compiler/prog_io.m:
	Fix typo in comment: s/fals/fails/
1999-02-08 20:52:38 +00:00
Fergus Henderson
af9b463a58 Implement demangling for instance declarations (i.e. base_typeclass_infos).
Estimated hours taken: 4.5

Implement demangling for instance declarations (i.e. base_typeclass_infos).

compiler/base_typeclass_info.m:
compiler/llds_out.m:
	Change the way name mangling for base_typeclass_infos is done
	to ensure that they can be unambiguously demangled.

util/mdemangle.c:
profiler/demangle.m:
	Add code to demangle base_typeclass_infos.

util/mdemangle.c:
	Fix a bug: if it got part way through demangling a symbol
	before noticing that it had the wrong format, then it would
	sometimes print out a partially demangled version of the
	symbol rather than printing out the original symbol unchanged.

tests/debugger/*.exp*:
	Update the expected output to reflect the new mangling scheme.
	(Really the debugger ought to demangle the names, but
	currently it doesn't.)
1999-02-04 14:58:38 +00:00
Fergus Henderson
6f1f6bcb17 Fix some bugs where we were not properly escaping special characters in
Estimated hours taken: 0.75

Fix some bugs where we were not properly escaping special characters in
C strings in the generated code.

compiler/llds_out.m:
	Change a number of places to call output_quoted_c_string instead of
	io__write_string, so that special characters will be properly escaped.
	Add new predicate llds_out__quote_c_string, for use by pragma_c_gen.m.

compiler/pragma_c_gen.m:
	Call llds_out__quite_c_string, to ensure that special characters
	in the generated "pragma_c_raw_code" are properly escaped.

tests/valid/int64.m:
tests/valid/Mmakefile:
	Regression test for the above-mentioned bug fix.
1999-01-27 08:34:38 +00:00
Fergus Henderson
fbfb6de3ae Fix a bug reported by Warwick Harvey <wharvey@cs.monash.edu.au>.
Estimated hours taken: 0.75

Fix a bug reported by Warwick Harvey <wharvey@cs.monash.edu.au>.

compiler/prog_io.m:
	Don't complain if the module name in the final `end_module'
	declaration doesn't match the expected name for the top-level
	module, because it could be for a nested module.

compiler/make_hlds.m:
	Report errors for unexpected `module' and `end_module' declarations.
	This will catch the cases that used to be caught by prog_io.m,
	among others.
1998-12-16 17:24:18 +00:00
Fergus Henderson
946e69b3d1 Fix a bootstrapping problem with the changes to MR_OBTAIN_GLOBAL_C_LOCK()
Estimated hours taken: 0.5

Fix a bootstrapping problem with the changes to MR_OBTAIN_GLOBAL_C_LOCK()
that Tom Conway recently committed.

runtime/mercury_thread.h:
compiler/pragma_c_gen.m:
	Rename MR_{OBTAIN,RELEASE}_GLOBAL_C_LOCK()
	as     MR_{OBTAIN,RELEASE}_GLOBAL_LOCK().
	Also delete the unnecessary trailing semicolons
	from the definitions of those macros.

runtime/mercury_bootstrap.h:
	Add a definition of the old zero-arity MR_*_GLOBAL_C_LOCK() macros
	in terms of the new unary MR_*_GLOBAL_LOCK() macros.
1998-12-16 16:35:42 +00:00
Thomas Conway
b2b99e5b50 Improvements to coroutining support. These changes allow us to do
Estimated hours taken: 20

Improvements to coroutining support. These changes allow us to do
provide io primatives that cause the Mercury context to suspend rather
than causing the engine to block.

configure.in:
	Test to see if we can handle contexts that block on IO
	using select().

compiler/pragma_c_gen.m:
	Include the predicate name in the calls to MR_OBTAIN_GLOBAL_C_LOCK
	and MR_RELEASE_GLOBAL_C_LOCK for improved debugging.

	Fix a bug where the global lock was not being released when
	semidet pragma c code failed.

runtime/mercury_thread.h:
	Change the global lock macros to include the message generated
	by the changes to pragma_c_gen.

library/char.m:
library/std_util.m:
	include `thread_safe' in the flags for a couple of pragma c
	definitions that seem to have missed out.

runtime/mercury_context.{c,h}:
	Add a list of "pending" contexts that are blocked on a
	file descriptor. When the runqueue becomes empty, we call
	select on all the pending contexts.

	Move schedule from the header file to the c file (changing
	it from a macro to a function) for easier debugging at a
	slight performance cost.

	TODO: add a nonblocking call to select so that we can poll
	for io from time to time rather than waiting till there is
	nothing else to do.

runtime/mercury_reg_workarounds.{c,h}:
	Make functions that forward to the FD_* macros, which on Linux
	attempt to use registers that we've already grabbed. Aarrggh!

runtime/mercury_thread.c:
	Tidy up some of the conditional compilation.

runtime/mercury_types.h:
	Remove the definition of SpinLock since we're not using them
	and are not likely to any time soon.
1998-12-15 00:22:29 +00:00
Fergus Henderson
55ffc62ed3 Add support for exceptions to the debugger, and
Estimated hours taken: 8

Add support for exceptions to the debugger, and
add support for debugging to the exception module.

browser/debugger_interface.m:
	Add `exception' to the trace_port_type enumeration.

runtime/mercury_trace_base.h:
	Add MR_PORT_EXCEPTION to the MR_Trace_Port enumeration.

trace/mercury_trace_internal.c:
trace/mercury_trace.h:
trace/mercury_trace.c:
	Modify the code to handle MR_PORT_EXCEPTION.

extras/exceptions/exception.m:
	- Define stack layout structures for the hand-written procedures
	  `builtin_throw' and `builtin_catch'.
	- Use mktempframe() rather than mkframe() to allocate the temporary
	  frames used to prevent hijacking of the exception-catching frame
	  (this is more efficient, and avoids the need to give a stack
	  layout for those frames).
	- Change the code for builtin_throw/1 so that if MR_trace_enabled
	  is true, it calls a new function trace_throw(), which calls
	  MR_trace(..., MR_PORT_EXCEPTION, ...) for each stack frame.
	- Fix some type errors occurring for non-GC grades.
	- Fix some uses of obsolete names (e.g. replace `hp' with `MR_hp').

runtime/mercury_trace_base.c:
compiler/trace.m:
	Add some comments relating to the above changes.
1998-12-14 16:05:20 +00:00
Fergus Henderson
f5c2cef828 Fix a few bugs in the debugger.
Estimated hours taken: 8

Fix a few bugs in the debugger.

compiler/trace.m:
	Fix a bug for procedures compiled with shallow tracing:
	if from_full is false, it still needs to save the call depth,
	since calls in the body of the procedure will reset the
	call depth to the saved value.

trace/mercury_trace_internal.c:
	Fix a couple of problems with the retry command:
	- if we're already at a call port, then just print a
	  warning rather than finishing the call and then
	  retrying it;
	- restore MR_trace_from_full to TRUE before jumping
	  to the procedure.

runtime/mercury_stack_trace.c:
	Fix some problems with the printing of detailed stack traces:
	- for procedures whose stack layouts didn't include execution
	  tracing information, the columns didn't match up;
	- for procedures with shallow (interface) tracing only,
	  it was sometimes printing out bogus details.

runtime/mercury_trace_base.c:
	Fix some formatting problems in the error message output by
	MR_trace_fake().
1998-12-09 12:26:45 +00:00
Fergus Henderson
3622fa7c04 Delete a few obsolete things: don't ignore
Estimated hours taken: 0.1

compiler/.cvsignore:
	Delete a few obsolete things: don't ignore
	mercury_compile.m, optimize.m, code_gen.m, or conf.m.
1998-12-09 11:40:05 +00:00
Peter Ross
4813940099 Add an alias from petdr -> "din".
Estimated hours taken: 0.1

compiler/handle_options.m
    Add an alias from petdr -> "din".
1998-12-09 03:26:21 +00:00