Commit Graph

4 Commits

Author SHA1 Message Date
Ralph Becket
a8ffd3680c Change the compiler and tools so that .' and not :' is now used as the
Estimated hours taken: 14
Branches: main

Change the compiler and tools so that `.' and not `:' is now used as the
module separator in all output.

Infix `.' now has associativity yfx and priority 10.

NEWS:
	Report the change.

configure.in:
	Amend the test for an up-to-date Mercury compiler to check whether
	it recognises `.' as a module qualifier.

compiler/code_gen.m:
compiler/error_util.m:
compiler/hlds_out.m:
compiler/prog_out.m:
compiler/prog_util.m:
compiler/rl_exprn.m:
compiler/rl_gen.m:
compiler/source_file_map.m:
compiler/unused_args.m:
library/io.m:
library/rtti_implementation.m:
library/type_desc.m:
runtime/mercury_debug.c:
runtime/mercury_deconstruct.c:
runtime/mercury_stack_trace.c:
	Change `:' to `.' as module separator for output.

compiler/mercury_to_mercury.m:
compiler/prog_io_typeclass.m:
	As above.
	Fixed a bug where `.' was not being recognised as a module separator.

doc/reference_manual.texi:
	Report the change.

library/term_io.m:
	Ensure that infix `.' is written without surrounding spaces.

tests/hard_coded/dot_separator.m:
tests/hard_coded/dot_separator.exp:
tests/hard_coded/Mmakefile:
	Test case added.
2003-01-17 05:57:20 +00:00
Thomas Conway
303c81f3ed Fix the test cases involving univ.
Estimated hours taken: 1

Fix the test cases involving univ.
2001-01-13 02:30:33 +00:00
Zoltan Somogyi
184e4710b1 Get the system to work with --no-special-preds, relying on RTTI interpretation
Estimated hours taken: 30

Get the system to work with --no-special-preds, relying on RTTI interpretation
to perform unifications and comparisons, in almost all cases. The only thing
that doesn't work is comparisons involving types with user-defined equality;
the generated exception does not get propagated across MR_call_engine
boundaries properly.

compiler/make_hlds.m:
	With --no-special-spreds, do not generate even declarations for
	type-specific index and compare predicates. Generate declarations
	and clauses for type-specific unify predicates, since we may need
	them for unifications that are not (in,in). However, we prevent
	the generation of code for the (in,in) case (i.e. mode 0) by pretending
	that the unify predicate is pseudo_imported, even in the module
	defining the type. There is one exception to this: for types with
	user-defined equality, we do generate a proper __Unify__ predicate,
	since this is the only convenient way to convert the specified
	sym_name of the equality predicate into a pred_id and proc_id,
	and a proper __Compare__ predicate, since this is the only convenient
	way to generate the full type name for the error message at runtime
	(due to polymorphism, the full type may not be known at compile time).
	(Finding the pred_id may require resolving type overloading,
	and finding the proc_id may require mode checking.)

compiler/simplify.m:
	When converting complicated unifications to calls, call the generic
	unify/2 and compare/3 predicates instead of the type-specific
	__Unify__ and __Compare__ predicates, if the latter do not exist.

compiler/higher_order.m:
	Do not specialize calls to the generic unify/2 and compare/3 predicates
	to type-specific __Unify__ and __Compare__ predicates, if the latter
	do not exist.

	Previously, we were not specializing comparisons of builtins and
	enumerations here, leaving it to inlining. In the absence of
	--special-preds, that doesn't work for enumerations, since there
	is no compiler-generated comparison predicate to do the inlining in.
	We therefore now perform both specializations.

compiler/polymorphism.m:
	Fix a bug: the code for looking up the special preds for user defined
	types was handling enums as builtins, which they are not: they can have
	user-defined equality.

compiler/type_ctor_info.m:
	Even with --no-special-preds, the type has type-specific __Unify_
	and __Compare__ predicates if it has user-defined equality. These
	predicates must be, and now are, put into the type_ctor_info.

runtime/mercury_wrapper.[ch]:
	Expand the facilities for collecting statistics about unify, index
	and compare operations. We used to collect only counts of operations
	for each type_ctor_rep; we now also collect counts of operations
	for each specific type. Rename MR_CTOR_REP_STATS as MR_TYPE_CTOR_STATS
	to reflect this expansion.

runtime/mercury_conf_param.h:
	Document MR_TYPE_CTOR_STATS instead of MR_CTOR_REP_STATS.

runtime/mercury_ho_call.c:
runtime/mercury_unify_compare_body.h:
	Fix a bug that showed with --no-special-preds: the Mercury predicate
	unify_2_0 cannot call the MR_generic_compare function to handle the
	arguments of a function symbol, because comparison is not defined
	on types with user-defined equality. Instead, we need to call the new
	MR_generic_unify C function, which does work on such types.

	Fix a bug that showed with --no-special-preds: the MR_succip register
	has to be saved and restored across calls to MR_generic_unify, since
	for types with user-defined equality, such calls involve a recursive
	invocation of the Mercury engine.

	Optimize the unification of du types by performing only one
	functor_desc lookup instead of two, and failing as early as possible.

	Use the new statistics facilities provided by mercury_wrapper.c.

tools/bootcheck
	If the new --type-stats option is given, preserve the type constructor
	statistics derived from (a) the stage 3 compilation process, and (b)
	compiling the test suite, for later analysis.

tools/type_ctor_stats:
	A new shell script to analyze type constructor statistics in their
	new, expanded format.

tests/hard_coded/user_defined_equality.{m,exp}:
	Test comparisons as well as unifications on enums with user-defined
	equality.
2000-04-05 06:29:12 +00:00
Fergus Henderson
ed5a77a57b Disable the MR_UNIFY_COMPARE_BY_CTOR_REP code,
Estimated hours taken: 0.5

runtime/mercury_ho_call.c:
	Disable the MR_UNIFY_COMPARE_BY_CTOR_REP code,
	because it does the wrong thing for enumerations
	with user-defined equality types.

tests/hard_coded/Mmakefile:
tests/hard_coded/user_defined_equality.m:
tests/hard_coded/user_defined_equality.exp:
	Add a regression test.
1999-10-26 15:01:47 +00:00