Commit Graph

2 Commits

Author SHA1 Message Date
Fergus Henderson
d7113aeb2f Merge in the changes from the existential_types_2 branch.
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/follow_vars.m:
compiler/goal_util.m:
compiler/higher_order.m:
compiler/hlds_goal.m:
compiler/live_vars.m:
compiler/make_hlds.m:
compiler/mercury_to_c.m:
compiler/modecheck_unify.m:
compiler/pd_cost.m:
compiler/polymorphism.m:
compiler/rl_exprn.m:
compiler/rl_key.m:
compiler/simplify.m:
compiler/term_traversal.m:
compiler/unify_gen.m:
compiler/unused_args.m:
	Trivial changes to handle the new field of complicated_unifies.

compiler/hlds_pred.m:
	Define and use typedefs `type_info_varmap', `type_class_info_varmap',
	and `constraint_proof_map', rather than duplicating complicated
	map(...) types everywhere.

	Add two new fields to the clauses_info data structure:
	a type_info_varmap and a type_class_info_varmap.
	Define access predicates for the clauses_info data structure.
	Add type_info_varmap and type_class_info_varmap as extra
	arguments to proc_info_set_body.

compiler/check_typeclass.m:
compiler/clause_to_proc.m:
compiler/dead_proc_elim.m:
compiler/higher_order.m:
compiler/hlds_out.m:
compiler/hlds_pred.m:
compiler/intermod.m:
compiler/make_hlds.m:
compiler/mercury_to_c.m:
compiler/modes.m:
compiler/polymorphism.m:
compiler/post_typecheck.m:
compiler/purity.m:
compiler/typecheck.m:
compiler/unify_proc.m:
	Trivial changes to handle the two new fields of clauses_info.
	Change many places to use the the access predicates to access
	fields of the clauses_info rather than accessing them directly.

compiler/purity.m:
	Fix some non-standard layout to match our usual coding conventions.

XXX TODO:

	- termination analysis doesn't work; probably some mixup
	  regarding whether or not the pragmas in the .opt and
	  .trans_opt files are supposed to have the type_infos
	  included or not.

	- fixup error messages (argument numbers offset)

	- quite a few test cases are failing
1999-06-30 17:12:17 +00:00
Jane Anna Langley
527f7d6fc7 Added common.nl a module intended to do some common subexpression
optimisation.  It doesn't appear to be doing that yet but nor does
it appear to be doing any harm :-)

It can be switched out in any case with the --no-common-subexpression option
1995-01-31 06:03:30 +00:00