Commit Graph

220 Commits

Author SHA1 Message Date
Thomas Conway
a349384beb fixed the counting of the number of stackslots used by
code_info.nl:
	fixed the counting of the number of stackslots used by
	a procedure.
1995-01-09 07:09:41 +00:00
Thomas Conway
4a69d897d4 added code to reuse stack slots.
live_vars.nl:
	added code to reuse stack slots.
	This algorithm is only preliminary. An algorithm to use
	standard graph colouring techniques should replace this
	eventually.

code_info.*, call_gen.*:
	minor modifications so that stack slot reuse works.
1995-01-09 02:07:51 +00:00
Zoltan Somogyi
33974b50c6 generate code to test primary tags from most shared to least shared.
switch_gen:
	generate code to test primary tags from most shared to least shared.

frameopt:
	separated out the pass that removes superfluous saves of succip.

llds, opt_debug:
	added two new unary operators, unmktag and unmkbody, that reverse
	the effects of mktag and mkbody.

graph, value_number:
	fixed occurrences of implied modes.

code_info:
	fixed a spelling error in a comment.

*** Tom, please fix the mismatch in the names of the unification procedures.
1994-12-16 05:21:02 +00:00
Fergus Henderson
e3725ca5ff Improve an error message.
code_info.nl:
	Improve an error message.

followcode.nl:
	Add a comment.

hlds_out.nl:
	Output ":=", "==", or "=" for the different types of unifications.
======> READ THIS: <======
	(Known bug: the order of the operands for ":=" is wrong.)

make_hlds.nl, unify_proc.nl:
	Make complicated unifications work!
1994-12-14 12:02:10 +00:00
Thomas Conway
dc11b26211 fix the livevals stuff so that it includes saved heap pointers
code_info.nl:
	fix the livevals stuff so that it includes saved heap pointers
	(etc) in the set of livevals.

mercury_compile.pp:
	rename a variable (trivial change)

term.nl:
	enforce the invariant that new variable numbers should be
	unique. This costs, but if we don't to it, it will kill us
	one day.
1994-12-05 23:20:13 +00:00
Thomas Conway
efa5675423 Bugfix in code_info__generate_eager_flush.
code_info.nl:
	Bugfix in code_info__generate_eager_flush.

code_gen.nl:
	Bugfix in rebuild_registers.
1994-11-02 06:18:19 +00:00
Zoltan Somogyi
6df9d73fa9 a lot less functionality is missing now :-)
value_number.nl:
	a lot less functionality is missing now :-)

atsort.nl:
	approximate topological sort for value numbering

opt_*.nl:
	changes to supprt value numbering

llds.nl, *_gen.nl:
	changed livevals/1 into livevals/2 to support value numbering

list.nl:
	added a predicate to delete a list (set) of items from a list

peephole.nl:
	implement shortcircuiting inside computed goto label lists. Not tested
	since the only place we use computed gotos has no opportunities for
	short circuiting.

options.nl:
	added option to control the maximum number of repetitions of
	the peephole optimizations; default value is 2.

dir.nl:
	fixed spelling error
1994-10-13 08:39:01 +00:00
Fergus Henderson
fd2470dd0a Add some more stuff for compiling to .o
Makefile*:
	Add some more stuff for compiling to .o

Makefile*, mercury_compile*, code_gen*:
	Add some stuff for handling `.pp' files.
	`.pp' files are Mercury source code containing
	NU-Prolog hacks inside

		#if NU_PROLOG
		...
		#endif

	These hacks are preprocessed out (using sed, not cpp)
	except when compiling with `mnc'.

term_io.nl, term_io.nu.nl, interpreter.nl, prog_out.nl:
	Make sure all the predicates in term_io.nl are
	prefixed with `term_io__', not `io__'.

term_io.nl, require.nl:
	Add some `external' declarations.

call_gen.nl, unify_gen.nl:
	A temporary hack - generate incorrect code for complicated/polymorphic
	unifications, rather than aborting.

random.nl:
	Make the code more efficient.

hlds.nl, term.nl:
	Allocate pred_ids and variable numbers randomly rather than
	sequentially, so that the binary trees remain reasonably balanced.

code_info.nl, unify_gen.nl, hlds_out.nl:
	Generate informative comments for tag tests: say the name of
	the variable being tested, and which constructor we are testing for.

llds.nl:
	Cast field() expressions to (int) when used as rvals, so
	that comparisons work as expected.

make_hlds.nl:
	Improve error reporting.
1994-10-09 18:26:41 +00:00
Thomas Conway
1ea03d18f3 fixes to the generation of livevals. These should
code_info.nl, call_gen.nl, code_gen.nl:
		fixes to the generation of livevals. These should
		work _about_ right. zs?

		re-add some of the declarations that I zapped on
		fergus' advice. :-)
1994-10-07 06:06:02 +00:00
Fergus Henderson
ffebda2b05 Fix a couple of typos - in string literals.
code_info.nl, mercury_to_mercury,
	Fix a couple of typos - in string literals.

interpreter.nl:
	Fix determinism error.

io.nl, io.nu.nl:
	A large-scale reorganization of the I/O handling,
	so that I can more easily re-implement the NU-Prolog
	parts in C.  `io__see' is now implemented using `io__open_input'
	rather than vice versa.  Added `io__open_append'.

list.nl:
	Implement merge/3, member/3, reverse/2, and sort/2 in Mercury
	rather than using the NU-Prolog versions.
	XXX Note that it is not possible to implement length/2 in
	Mercury in a way that is deterministic in both forwards
	and backwards modes!

modes.nl:
	Fix a mode error - the Mercury mode analysis didn't detect
	this one, since it would have reordered the code to be
	correct!  I can't wait until we bootstrap ;-)
1994-10-06 18:04:50 +00:00
Thomas Conway
f2222f77e9 Deleted some unused predicate declarations for predicates
code_info.nl:
	Deleted some unused predicate declarations for predicates
	which don't exist.
1994-10-04 13:15:24 +00:00
Fergus Henderson
18df737589 Fix determinism error.
code_info.nl:
	Fix determinism error.
1994-10-03 07:21:29 +00:00
Fergus Henderson
d8c9479872 Override the MERCURY_LIB_OBJS variable when invoking ml.
Makefile.mercury:
	Override the MERCURY_LIB_OBJS variable when invoking ml.
	This avoids some bootstrapping problems.
	Also, add mercury_compile.nu.

Makefile.common:
	Bump NU-Prolog's -u option up to 2000 (8M), to avoid some memory
	problems.

array.nl, bintree.nl, char.nl, dir.nl, globals.nl, list.nl, map.nl, modes.nl,
prog_util.nl, stack.nl, std_util.nl, string.nl, term.nl:
	Avoid the use of implied modes.

code_info.nl, bimap.nl, make_hlds.nl, mercury_compile.nl,
mercury_to_mercury.nl, unify_proc.nl:
	Fix determinism errors which had previously not been discovered
	because of either implied modes or running out of memory.
	(Note that I had to change the interface to bimap__lookup, since
	it's not possible to make it bidirectional.)

code_util.nl, llds.nl, opt_debug.nl, value_number.nl:
	Rename `operator' as `binary_op'.

hlds.nl, code_info.nl, unify_gen.nl, llds.nl, opt_debug.nl, switch_gen.nl:
	*** Handle simple cases of higher-order pred terms. ***
	(We don't yet handle taking the address of an overloaded
	predicate or a predicate with multiple modes.
	We don't handle closures.  call/1 and call/N are not yet implemented.
	This has not yet been tested.)

make_hlds.nl:
	Modify the mode priority ordering so that semidet modes get
	selected before det ones.

llds.nl:
	Don't include the priority part of the mode number in the mangled
	label name.  *** Note: this will break some things! ***

mercury_compile.nl:
	Move the NU-Prolog hacks into mercury_compile.nu.nl.

switch_gen.nl:
	Fix a simple logic bug in handling the grab/slap of the code_info.

prog_io.nl, builtins.nl, int.nl:
	Fix bugs and omissions with handling of the new arithmetic operators.

prog_io.nl:
	As a quick hack, strip off calls to io__gc_call
	(this avoids spurious error messages which are due to
	the fact that we don't get mode analysis right in those cases).
1994-10-02 17:00:57 +00:00
Fergus Henderson
1a27233878 Make the handling of builtins a little more general.
call_gen.nl:
	Make the handling of builtins a little more general.

code_info.nl, unify_gen.nl:
	Use code_info__get_next_label_number rather than
	the lower-level routines code_info__get_label_count
	and set_label_count.

code_util.nl:
	Rame atom_to_operator as code_util__atom_to_binop
	and add code_util__atom_to_unop.

prog_io.nl, code_util.nl, llds.nl, int.nl, opt_debug.
	Add bitwise operators.
	Add array_index binary operator.
	Add hash_string unary operator.
	Add int__log2 predicate.
	Cast operands to (int) in llds.nl, so that we
	get integer comparisons and integer operations.

string.nl:
	Add string__hash predicate.

interpreter.nl:
	Use disjunction in semidet preds.

options.nl:
	Add --smart-indexing option (enabled by default).

switch_gen.nl:
	**** Generate a hash table lookup for string switches. ****
1994-09-30 21:42:27 +00:00
Fergus Henderson
e646a016e5 Fix determinism error which was due to the lack of multi-level
opt_util.nl:
	Fix determinism error which was due to the lack of multi-level
	indexing.

code_info.nl:
	A very minor code simplification.

switch_gen.nl:
	Generate better code for switches on atomic types.
	We now use jump tables in more cases.
	(This speeds up `crypt' by about 0.4% - not much).
1994-09-29 10:19:42 +00:00
Thomas Conway
4c72741f6a trivial change... Removed a couple of underscores where they
bintree.*
	trivial change... Removed a couple of underscores where they
	were not needed.

code_info.nl:
	(mostly) fixed the livevals stuff.
1994-09-29 06:03:35 +00:00
Thomas Conway
15d42f5a75 Added more comments.
code_info.nl:
	Added more comments.
1994-09-22 21:33:27 +00:00
Zoltan Somogyi
efac525fb1 changed the argument of the livevals instr from list to bintree_set
code_{gen,info}.nl, llds.nl, peephole.nl:
	changed the argument of the livevals instr from list to bintree_set

code_{gen,info}.nl:
	we now generate livevals even if value numbering isn't being done,
	since the new peephole optimizations work better this way

opt_util.nl:
	made the code that deletes unwanted livevals info more robust
1994-09-22 09:22:15 +00:00
Fergus Henderson
236684b21b Get rid of the "unused" rval, since it doesn't have any well-defined
llds.nl:
	Get rid of the "unused" rval, since it doesn't have any well-defined
	semantics (as far as I can tell) and we don't need it.  The only
	thing it is used for is for fields of create() instructions which
	do not need to be initialized, and I changed create() to take
	a list(maybe(rval)) rather than a list(rval).

code_info.nl:
	Get rid of register_status "unused" and variable_status "unused",
	since they aren't needed.

	Fix *some* of the (probably many) bugs with remembering
	register contents and variable locations.

	Change code_info__generate_expression_vars(var(Var), ...)
	to just call code_info__produce_variable.

	In shuffle_register, fix the test for determining whether
	we need to swap the old value out by combining the test
	for arguments and the test for live variables into a single
	test.  I had to disable this fix, because it triggers the
	aforementioned bugs with remembering variable locations.

	Change generate_livevals so that it doesn't do anything unless
	the --peephole-value-number option has been set.

	Slightly simplify the instruction sequence generated for
	create() expressions.

peephole.nl, opt_util.nl:
	Move peephole__instr_labels to opt_util.nl.

typecheck.nl:
	A couple of extremely minor formatting changes.

code_info.nl, llds.nl, unify_gen.nl, options.nl:
	Add a new option --static-ground-terms, which is enabled by default,
	for generating ground terms at compile time and emitting a static
	constant.
1994-09-12 19:28:17 +00:00
Thomas Conway
92f54f4c17 Add the livevals instruction type and get the code generator
code_gen, code_info, call_gen llds:
	Add the livevals instruction type and get the code generator
	to emit livevals instructions just before calls and proceeds.
	WARNING WARNING WARNING
		These changes break the peephole optimiser.
1994-09-12 04:12:16 +00:00
Fergus Henderson
37474a09f1 Reorganize the LLDS representation to minimize duplication.
llds.nl, *_gen.nl, code*.nl, unify_proc.nl, peephole.nl:
	Reorganize the LLDS representation to minimize duplication.
1994-09-09 23:24:40 +00:00
Fergus Henderson
2d421c9dcf - Add another rule to suppress the default Modula-2 rule.
Makefile.mercury:
	- Add another rule to suppress the default Modula-2 rule.
	- Remove the rule for making *_init.c; this has to be done
	manually by the user's makefile, since the necessary
	information isn't available here.
	- Change the default MOD2INITFLAGS to -wmercury__main_predicate_3_0.

*_gen.nl, code_info.nl:
	Generate fail() rather than redo() if we know the redoip
	must point to do_fail.
1994-09-08 11:58:01 +00:00
Fergus Henderson
91ee238587 Added a new pred code_info__produce_variable, which combines
*_gen.nl, code_info.nl:
	Added a new pred code_info__produce_variable, which combines
	flush_variable and variable_get_register, except that it
	returns an rval rather than an lval.  The idea is
	that using produce_variable means we don't have to store
	constants in registers before we can use them.

code_info.nl:
	Avoid generate some unnecessary register shuffles.

mercury_compile.nl, Makefile.mercury.
	Add some gross hackery to do manual memory management
	with NU-Prolog.  Up the -u option to 1200.
1994-09-08 07:31:38 +00:00
Fergus Henderson
98b7357f35 Add a reminder about fixing the permissions
Makefile.common:
	Add a reminder about fixing the permissions

code_info.nl:
	Fix some determinism errors introduced by adding new
	llds instruction types.

det_analysis.nl:
	Count the number of determinism errors in the code
	and pass this back to the top-level, so that we
	don't attempt to compile code which contains determinism errors.

	For if-then-elses with a deterministic condition,
	optimize the else part away.  This prevents the code
	generator from getting confused when the else part is semidet
	but the if-then-else as a whole is det.

hlds.nl, make_hlds.nl:
	Change the predicate_table so that it allows more than
	one predicate with the same module, name, and arity.
	Move the checking for duplicate preds from hlds.nl to make_hlds.nl.
	This is so we can insert automatically generated unification
	predicates, which must be overloaded, into the predicate_table.

hlds.nl:
	Add a few comments.

mercury_compile.nl:
	Split mercury_compile/7, which was becoming huge, into
	about a dozen smaller predicates.
	Ensure that we report the memory/time usage statistics
	after every pass.

mercury_to_mercury.nl, modes.nl, typecheck.nl, prog_io.nl:
	Fix some determinism errors.
	(There are still 6 determinism errors that remain, 5 in
	mercury_compile and 1 in prog_io.  These are caused
	by calls to io__gc_call, because we haven't yet implemented
	mode analysis for higher-order preds.)
1994-09-05 17:07:43 +00:00
Zoltan Somogyi
6736705367 changed if_val so that its second argument can be either
llds.nl, code_info.nl, call_gen.nl, peephole.nl:
	changed if_val so that its second argument can be either
	goto(Label), fail or redo.

value_number.nl:
	minor fix.
1994-09-04 08:59:10 +00:00
Fergus Henderson
d948aecd92 Make a start at implementing code generation for complicated
lots of files:
	Make a start at implementing code generation for complicated
	unifications.  In the HLDS, change complicated_unify/4 to
	complicated_unify/2 since we didn't need the extra two args
	after all.

peephole.nl:
	A couple of minor efficiency improvements.

queue.nl:
	Add queue__queue_to_list/2.
1994-09-01 20:31:58 +00:00
Thomas Conway
79fef42151 added list__split3 which matches a list with a head and a
list*:
	added list__split3 which matches a list with a head and a
	tail and returns the middle.

code_info.nl, disj_gen.nl:
	patch things so that the first disjunct uses the registers
	not the framevars.
1994-08-31 04:41:05 +00:00
Fergus Henderson
d6ca6e3797 Ensure that Makefile.mercury can be used as a generic
*Makefile*:
	Ensure that Makefile.mercury can be used as a generic
	Makefile for Mercury programs.  It now gets included by the
	Makefiles in the tests/ directory.
	(It's highly likely that these changes have broken something.)

code_util.nl, peephole.nl, code_info.nl:
	Move peephole__neg_rval to code_util.nl, so that it can
	also be used by code_info.nl.  Improve it a bit.

disj_gen.nl:
	Minor stylistic changes.

peephole.nl:
	Use bintree_set(label) rather than map(label, bool).

ite_gen.nl:
	Implement non-deterministic if-then-elses.

mercury_compile.nl:
	Change the action in the automatically generated .dep makefile
	to use `$(MNL)' rather than `$(NC)' to link the `.no' files
	together.

mode_util.nl, mode_info.nl:
	Fix some (recently detected) determinism errors.

options.nl:
	Rearrange the options into a vaguely meaninful order and
	add a couple of comments.
1994-08-30 21:07:52 +00:00
Fergus Henderson
ac0f113de6 Install ml.sh.
Makefile:
	Install ml.sh.

*_gen.nl, code_info.nl:

	Reorganize the handling of failure continuations and mixing
	det/semidet/nondet code in the one procedure.
	It should now work! ;-)

	The category_context field has gone away.
	The fall_though field is now a stack(maybe(label)) rather
	than a stack(label).  If Cont = yes(label), then we
	fail by jumping to that label.  If Cont = no, then we
	fail by executing a redo().  Whenever we create a semidet
	choice point, we just push a failure continuation label.
	Whenever we create a nondet choice point, we do two things:
	(1) generate code which does a `modframe()'
	(2) push a failure continuation label
	The failure continuation records what value is currently in the
	redoip.  This allows us to short-circuit redo() instructions
	into direct jumps.  Whenever we get to a nondet goal, we change
	the current failure continuation to `no', since the nondet goal
	might have left some choice points behind.
	(TODO: The same sort of mechanism would allow us to optimize `redo()'
	to `fail()' but we don't do that yet; also currently we generate
	quite a few unnecessary modframe() instructions.)

	`generate_[i]cond_branch' has gone away.
	Instead, push a failure continuation and then call
	generate_test_and_fail.

code_util.nl, llds.nl:
	Fix newly discovered determinism errors.

code_info.nl, live_vars.nl:
	framevars start at 0, not at 1!!!
1994-08-28 21:39:24 +00:00
Fergus Henderson
a407841788 Only save and restore the heap pointer if the goal being
backtracked over contains a construction unification or a
non-builtin call.  Add code to save/restore the heap pointer
in one or two places where this was missing, e.g. semidet disjunctions.

Change switch/2 into switch/3 so that we can store the `local
determinism' of the switch there, rather than in the goal_info.

Fix code generation for semidet/nondet switches, so that
we omit the test for the last case if the switch is locally
det.
1994-08-27 08:29:26 +00:00
Fergus Henderson
f2686fcb5a Fix typo in comment. 1994-08-24 05:00:19 +00:00
Fergus Henderson
ad555c63b6 Add a couple of comments to both the source code and the generated
code_gen.nl, code_info.nl:
	Add a couple of comments to both the source code and the generated
	code.
1994-08-21 08:39:26 +00:00
Fergus Henderson
b93a184b3f RISC-ify the LLDS instruction set: remove the if_tag, if_not_val,
llds.nl, code_info.nl, unify_gen.nl, call_gen.nl:
	RISC-ify the LLDS instruction set: remove the if_tag, if_not_val,
	and test instructions, replacing them all with new uses of if_val.
1994-08-17 15:49:58 +00:00
Fergus Henderson
0ce51d7a2f Add a new pred proc_info_interface_determinism and
arg_info.nl, call_gen.nl, code_gen.nl, live_vars.nl, hlds.nl:
	Add a new pred proc_info_interface_determinism and
	ensure that it is called from the appropriate places.

code_gen.nl:
	Improve the code generation for commits (don't bother
	to restore maxfr if the goal fails, since maxfr won't
	have been modified).

llds.nl:
	Add a generate way of inserting arbitrary C code in the LLDS.

switch_gen.nl, code_info.nl:
	Generate correct code for switches whose determinism has
	incorrectly been inferred as det.
1994-08-16 10:08:11 +00:00
Fergus Henderson
22f4452c35 Remove the optimization of mkframe()/modframe() for the
disj_gen.nl, code_info.nl, code_gen.nl:
	Remove the optimization of mkframe()/modframe() for the
	first continuation, since it was broken.

hlds_out.nl:
	Write the instmap deltas out on separate lines.

liveness.nl:
	Fixed bugs in processing of if_then_elses.

live_vars.nl:
	Fixed a bug in the processing of if_then_elses.

mode_util.nl:
	Fix the recompute_instmap_delta so that it restricts the
	instmap_delta to the non-local variables for the goal.

unify_gen.nl:
	Implement string equality tests.

llds.nl:
	Remove some unnecessary parentheses in the output.
	Handle string equality.
1994-08-15 05:26:12 +00:00
Fergus Henderson
dfbc21f997 Change the way code_info__push_rval and pop_lval work, so
code_info.nl:
	Change the way code_info__push_rval and pop_lval work, so
	that they just record the amount of space used, rather than
	actually adjusting the stack pointer.

code_gen.nl:
	Call code_info__total_stackslots rather than code_info_stackslots,
	so that space for pushes and pops is allocated in the procedure
	prolog.

disj_gen.nl:
	Reclaim heap space on backtracking.
1994-08-14 18:07:43 +00:00
Fergus Henderson
693d42285f Rename globals__lookup*option as globals__io_lookup*option.
*.nl:
	Rename globals__lookup*option as globals__io_lookup*option.
	Create new globals__lookup*option predicates.
	Fix up the option handling in the code generator.
1994-08-14 14:26:38 +00:00
Fergus Henderson
3e984e7793 Various bug fixes for non-deterministic code.
code_gen.nl, code_info.nl, disj_gen.nl, ite_gen.nl, switch_gen.nl:
	Various bug fixes for non-deterministic code.
	(nqueens now works! ;-)

live_vars.nl:
	Bug fix: initial liveness should be {input vars} not {output vars}.
	(Apologies from Thomas ;-).

llds.nl:
	Couple of minor bug fixes.  Added code to output redo().

io.nl, portray.nl, prog_io.nl, std_util.nu.nl, term_io.nu.nl:
	Change X.Xs into [X|Xs].

swi_builtin.nl, doit.pl:
	Add some support for SWI-Prolog.

set.nl, stack.nl:
	Suppress bogus SWI-Prolog singleton variables warnings in
	type declarations.

term_io.nu.nl:
	Remove some of the dependences on NU-Prologisms.
1994-08-14 12:14:51 +00:00
Fergus Henderson
df22b2f583 Implement calls to nondet goals from semidet contexts (by
code_gen.nl, call_gen.nl:
	Implement calls to nondet goals from semidet contexts (by
	generating a commit).
	Reduce the amount of cut-and-paste duplication in
	generate_category_goal.


code_info.nl:
	Add predicates to generate commits.
	Fix a bug in store_map handling.
	Fix a bug in code_info__generate_failure (I think the fix may
	have introduced a different bug, because compiling qdelete now
	results in a C compiler error: reference to an undefined label).

llds.nl:
	Add the `curredoip' and `maxfr' registers (so that we can implement
	commit).
1994-08-13 13:54:47 +00:00
Fergus Henderson
6f0724bfbb Fix bug in when declaration.
code_info.nl:
	Fix bug in when declaration.
1994-08-13 05:40:43 +00:00
Thomas Conway
0f1d52581c Fix assumptions about where variables go at the end of switches.
code_gen.nl code_info.nl:
	Fix assumptions about where variables go at the end of switches.
	Add StoreMap.

live_vars.nl store_alloc.nl:
	Passes to compute the stack allocations, and the "known" locations
	for variables.

hlds.nl:
	Add fields to procinfo for stack allocations.

options.nl:
	Add options for eager and lazy code generation.
	Eager code generation is still mostly untested. Its
	even possible that there are unimplemented preds!

llds.nl:
	Print the code in a slightly nicer format.
1994-08-13 05:01:13 +00:00
Fergus Henderson
2410aeafcb Add a comment indicating the source of the determinism error
(the error is still unresolved).
1994-08-07 04:18:49 +00:00
Fergus Henderson
eaedceec24 Combine the code for setting up input arguments in calls with the
call_gen.nl, code_gen.nl, code_info.nl:
	Combine the code for setting up input arguments in calls with the
	code for seting up output unifications in the procedure epilogue
	(which hopefully fixed a bug in the latter).

disj_gen.nl:
	Fix a bug with label assignment in nested disjunctions,
	tidy up the code a bit, and avoid generating some redundant
	jumps-to-jumps.
1994-07-28 10:52:15 +00:00
Thomas Conway
6dee433148 Generate code with field numbers 0.... rather than 1....
code_info.nl ite_gen.nl unify_gen.nl
	Generate code with field numbers 0.... rather than 1....
	Add stuff for heap reclaiming on failure.
	Add options in code generation (not patched through to the
	top levels of the compiler yet.

liveness.nl:
	fix some bugs.

options.nl mercury_compile.nl:
	Add some options for follow[code|vars].
1994-07-11 05:18:55 +00:00
Fergus Henderson
900285dc1b Add a new library module for file and directory name handling.
dir.nl:
	Add a new library module for file and directory name handling.

string.nl, list.nl:
	Add a bunch of new preds.

code_info.nl:
	list__nth_member_lookup has been renamed list__index1_det.

io.nu.nl:
	Change io__progname so that it uses the new dir__basename.

prog_io.nl:
	Fix the type error left in my last change to prog_io.nl.
	Change a few XXX comments, since the things they comment
	about are wishlist items, not XXX-level problems.

ite_gen.nl, code_info.nl:
	Fix determinism problem.
1994-07-08 17:54:44 +00:00
Thomas Conway
fc2aa5cf3d Improve the generation of tests.
code_info.nl switch_gen.nl unify_gen.nl:
		Improve the generation of tests.

llds.nl:	fix a few things (some brackets and stuff).
1994-07-07 08:39:07 +00:00
Thomas Conway
2159997b50 More work on nondet code generation. Apart from problems with
code_gen.nl code_info.nl disj_gen.nl:
	More work on nondet code generation. Apart from problems with
	implied modes which need to be dealt with, path/2 is correctly
	generated.

liveness.nl:
	Fix bugs in the generation of liveness information for
	if-then-else constructs in the presence of erroneous predicates.
1994-07-07 06:29:41 +00:00
Thomas Conway
42920f22f5 Bugfixes. Implement the basics of nondeterministic code.
code_info.nl, *_gen.nl:
	Bugfixes. Implement the basics of nondeterministic code.
	Lots of cases still not handled, but look, you've got to
	start somewhere :-)

liveness.nl:
	Fix bugs shown up by the follow* transformations.

llds.nl:
	Add a few extra things for nondeterministic code.
1994-07-06 16:36:49 +00:00
Thomas Conway
f776ba61eb Fixed the handling of liveness in the presence of erroneous
liveness.nl:
	Fixed the handling of liveness in the presence of erroneous
	predicates. Bug was shown up by the followcode/followvars
	transformation.

*_gen.nl code_info.nl:
	Bugfixes. Laid some of the groundwork in preparation for
	nondeterministic code generation (long live bottom up design!)
1994-07-06 09:28:22 +00:00
Fergus Henderson
c816f8406f Minor improvements to the output.
hlds_out.nl:
	Minor improvements to the output.

code_info.nl, type_util.nl:
	Change make_type_id to fail rather than call error/1
	if the type is not valid.

undef_types.nl:
	Report invalid types.

mode_util.nl:
	Add a new pred `type_constructors'.

modes.nl:
	Detect determinism of deconstruction unifications properly,
	using the type information.
1994-07-05 05:07:29 +00:00