Commit Graph

16 Commits

Author SHA1 Message Date
Fergus Henderson
49c25842cf Fix a problem reported by Baudouin Le Charlier <ble@info.fundp.ac.be>
where switch detection was getting confused by explicit existential
quantifications.

compiler/switch_detection.m:
	When detecting switches, traverse through some/2 goals.
	Also simplify the code a bit.

tests/valid/Mmakefile:
tests/valid/some_switch.m:
	Regression test for the above change.
1998-05-12 17:05:04 +00:00
Fergus Henderson
40f7fad627 Fix some code rot in the rules for `make clean';
Estimated hours taken: 0.5

Makefile:
tests/valid/Mmakefile:
tests/invalid/Mmakefile:
	Fix some code rot in the rules for `make clean';
	amoung other things, change them so that they
	handle `--use-subdirs' correctly.
1998-04-09 03:59:12 +00:00
Fergus Henderson
5653ad9190 Change a hard-coded test for `$file.o' so that it will
Estimated hours taken: 0.25

tests/valid/runtests:
tests/valid/Mmakefile:
	Change a hard-coded test for `$file.o' so that it will
	work with --use-subdirs.
1998-03-30 13:25:05 +00:00
Fergus Henderson
7ebc79e927 Fix some problems with the `--use-subdirs' option.
Estimated hours taken: 6

Fix some problems with the `--use-subdirs' option.
The compiler itself now compiles and bootstraps fine with --use-subdirs.

compiler/modules.m:
	Put `.h' files in the source directory, rather than
	in the `Mercury/hs' subdirectory.

compiler/mercury_compile.m:
scripts/Mmake.rules:
	If `--use-subdirs' is enabled, pass `-I.' to the C compiler,
	so that #include statements work relative to the source directory
	rather than relative to the `Mercury/cs' subdirectory.

scripts/Mmake.vars.in:
	Define $(cs_subdir), $(os_subdir) etc. variables;
	these are set to the directory to use for .c, .o, etc. files,
	(including the trailing `/'), or to the empty string,
	if --use-subdirs is not set.

scripts/Mmake.rules:
	Use $(cs_subdir), $(os_subdir) etc. to avoid the code
	duplication created by my previous change to handle
	--use-subdirs.
	Also add lots of comments, and reorder the code
	in a more logical order.

Mmakefile:
library/Mmakefile:
compiler/Mmakefile:
profiler/Mmakefile:
tests/term/Mmakefile:
tests/valid/Mmakefile:
	Use $(cs_subdir), $(os_subdir) etc. to fix a few hard-coded
	file-names (e.g. *.dep, *_init.[co], tree234.o) that were
	used in some of the rules.

library/Mmakefile:
	Add `rm -f tags' to the rule for `mmake realclean'.

tools/bootcheck:
	Add `--use-subdirs' option (defaults to setting of the
	MMAKE_USE_SUBDIRS environment variable).
	Change the code which compares the stage2 & stage3 C files
	to use the appropriate location for them based on the
	setting of this option.
1998-03-20 02:58:33 +00:00
Simon Taylor
c76b0fb370 Fix a bug: recompute_instmap_delta wasn't recomputing
Estimated hours taken: 1

compiler/mode_util.m
	Fix a bug: recompute_instmap_delta wasn't recomputing
	the instmap_deltas of lambda goals.

tests/valid/lambda_recompute.m
	Regression test.
1998-02-28 11:33:46 +00:00
Simon Taylor
4ab55e32a5 Fix a bug in the optimization where polymorphism.m passes a
Estimated hours taken: 5

Fix a bug in the optimization where polymorphism.m passes a
base_type_info in place of a type_info for non-polymorphic types.
The type of the variable was `base_type_info' not `type_info'.
This caused inlining.m to be unable to compute a type substitution,
and code_util__cons_id_to_tag aborted on an unsubstituted type
variable.

compiler/mercury_builtin.m
compiler/code_util.m
	Add a new builtin, unsafe_type_cast/2, used by common.m
	to preserve type correctness.
	Make unsafe_promise_unique/2 a builtin, since it is basically
	the same as unsafe_type_cast/2.

compiler/polymorphism.m
	Set the type of a `base_type_info' passed where a `type_info'
	is expected to `type_info'.
	Don't add the type_info argument for unsafe_type_cast, since it is
	not needed and would make the code in common.m more complicated.

compiler/common.m
	Generate a call to unsafe_type_cast rather than an assignment
	unification when the assignment would not be type correct.

tests/valid/inlining_bug.m
	Regression test.

tests/general/common_type_cast.m
tests/general/common_type_cast.exp
	Test of type casts.
1998-02-25 00:12:16 +00:00
Simon Taylor
e3e2a9a870 Add the test case for modules.m which was committed
Estimated hours taken: 0.01

tests/valid/Mmakefile
	Add the test case for modules.m which was committed
	previously to the list of tests.
1998-02-09 00:44:42 +00:00
Fergus Henderson
cabfd6bd1a Fix a problem where the use of explicit quantifiers lead to
Estimated hours taken: 1

compiler/quantification.m:
	Fix a problem where the use of explicit quantifiers lead to
	spurious warnings about unbound type variables, by deleting
	explicit quantifiers during quantification (once the
	variables have been renamed apart, the explicit quantifiers
	are no longer needed).

tests/valid/Mmakefile:
tests/valid/explicit_quant.m:
	Regression test.
1998-01-22 07:29:47 +00:00
Fergus Henderson
e22c6fd3d2 Fix a bug introduced in stayl's changes to add support for
Estimated hours taken: 1

compiler/modules.m:
	Fix a bug introduced in stayl's changes to add support for
	`use_module': it was not reading in the `.int2' files
	for modules indirectly imported from `.int' files.

tests/valid/Mmakefile:
tests/valid/module_a.m:
tests/valid/module_b.m:
tests/valid/module_c.m:
tests/valid/module_d.m:
	A regression test for the above-mentioned bug.
1998-01-09 12:35:16 +00:00
Tyson Dowd
e96e89c657 Turn off the accurate GC tests for "jump" and "fast" grades.
Estimated hours taken: 0.5

tests/valid/Mmakefile:
tests/valid/runtests:
	Turn off the accurate GC tests for "jump" and "fast" grades.
1998-01-06 04:16:17 +00:00
Fergus Henderson
82744e5b95 Add new options for disabling some warnings, so that they
Estimated hours taken: 1

Add new options for disabling some warnings, so that they
can be disabled by `--inhibit-warnings'.

compiler/options.m:
	Add new options `warn-missing-module-name'
	and `warn-wrong-module-name' (enabled by default),
	and ensure that `--inhibit-warnings' disables these options.

compiler/prog_io.m:
	Add code to conditionalize the printing of warnings
	based on the settings of the new options.

doc/user_guide.texi:
	Document the new options.

tests/valid/Mmakefile:
tests/valid/inhibit_warn_test.m:
	A regression test.
1998-01-05 08:40:43 +00:00
Fergus Henderson
239e96ec59 Clean up the handling of unbound type variables.
Estimated hours taken: 8

Clean up the handling of unbound type variables.
Fix a bug with unbound type variables in lambda expressions.
Run purity analysis, modechecking etc. even if there were type errors.

compiler/mercury_compile.m:
	Run purity analysis, modechecking etc. even if there were type
	errors.  This fixes a bug (inconsistency between the code and
	the comments) that seems to have been introduced in stayl's
	change to mercury_compile.m (revision 1.25) to add intermodule
	unused argument elimination: the comment said "continue,
	even if type checking found errors", but the code did not
	continue.

	This change was needed to ensure that we still report a warning
	message about unused type variables for tests/invalid/error2.m;
	without it, we stop after type checking and don't do purity
	analysis, and so don't report the warning.

compiler/typecheck.m:
compiler/purity.m:
	Move the code for checking for unbound type variables
	from typecheck.m to purity.m.  It needs to be done
	*after* type inference has been completed, so it
	can't be done in the ordinary type checking/inference
	passes.  Add code to purity.m to bind the
	unbound type variables to the builtin type `void'.

compiler/polymorphism.m:
	Comment out old code to bind unbound type variables
	to `void'; the old code was incomplete, and this
	is now done in purity.m.

compiler/notes/compiler_design.html:
	Document the above changes.

tests/valid/Mmakefile:
tests/valid/unbound_tvar_in_lambda.m:
	Regression test for the above-mentioned bug with unbound type
	variables in lambda expressions.

tests/warnings/singleton_test.exp:
tests/invalid/errors2.err_exp:
	Change the expected warning message for unbound type variables.
	The error context is not as precise as it used to be, I'm afraid:
	we only know which function/predicate the error occurred in,
	not which clause.  Also it now comes out in a different order
	relative to the other error messages.

tests/invalid/errors2.err_exp:
tests/invalid/funcs_as_preds.err_exp:
	Add some new error/warning messages that are output now that
	we run mode and determinism analysis even if there are type errors.
1998-01-02 00:11:41 +00:00
Fergus Henderson
9fc30fa8bb Change unique mode analysis (unique_modes.m) so that it does the same
Estimated hours taken: 4

Change unique mode analysis (unique_modes.m) so that it does the same
fixpoint analysis that ordinary mode analysis (modes.m) does.

This is a first step towards mode inference of "mostly-unique" modes.
Unique mode analysis still won't introduce any new modes, but it may
now change the final insts of inferred modes from `unique' to `mostly_unique'.

The next step (not included in this diff) will be to change the handling of
calls in unique_modes.m so that it does introduce new modes.

Also change things so that the inferred modes are normally printed
only after unique mode analysis, with determinism annotations attached.

compiler/modes.m:
	Add an extra WhatToCheck parameter to lots of predicates,
	so they can also be used for checking unique modes.
	Add a few small new bits of code to handle the
	`WhatToCheck = check_unique_modes' case.

compiler/unique_modes.m:
	Call the routines in modes.m rather than special casing things.
	The checking of goals is still special-cased, since for
	example unique_modes does not do reordering, but the traversal
	of modules and procedures now uses code from modes.m.

compiler/mode_errors.m:
	Add an extra bool parameter to write_mode_inference_messages
	indicating whether or not to print determinism annotations.

tests/valid/Mmakefile:
tests/valid/mostly_uniq_mode_inf.m:
	Test case for the above change.
1997-11-24 23:10:38 +00:00
Fergus Henderson
5d0414bbab For the tests of accurate gc, just add `--gc accurate'
Estimated hours taken: 0.5

tests/Mmake.common:
tests/valid/Mmakefile:
	For the tests of accurate gc, just add `--gc accurate'
	to GRADEFLAGS, rather than setting GRADE=asm_fast.agc.
	Otherwise the tests fail on systems for which we
	don't support asm_fast.* grades.
1997-11-22 17:14:02 +00:00
Zoltan Somogyi
9721c4b090 Recompute nonlocal sets before starting liveness computations
Estimated hours taken: 4

compiler/liveness.m:
	Recompute nonlocal sets before starting liveness computations
	in order to avoid a compiler abort. The new version could in
	some cases also lead to the generation of better code through
	saving fewer variables across disjuncts.

tests/valid/liveness_nonlocals.m:
	Test case to exercise the fix.

tests/valid/Mmakefile:
	Enable the new test case.
1997-10-16 07:01:58 +00:00
Fergus Henderson
6e06050558 Rename Mmake' as Mmakefile', since using the name `Mmake'
Estimated hours taken: 0.25

*/Mmake:
	Rename `Mmake' as `Mmakefile', since using the name `Mmake'
	causes problems on case-insensitive file systems.
1997-09-29 18:05:38 +00:00