Commit Graph

37 Commits

Author SHA1 Message Date
Mark Brown
784dc26cab Fix bugs that were stopping *.res and *.out files being cleaned up properly.
Estimated hours taken: 0.5

Fix bugs that were stopping *.res and *.out files being cleaned up properly.

tests/Mmake.common:
tests/general/accumulator/Mmakefile:
tests/invalid/Mmakefile:
tests/misc_tests/Mmakefile:
tests/tabling/Mmakefile:
tests/term/Mmakefile:
tests/valid/Mmakefile:
tests/warnings/Mmakefile:
	Make cleaning tasks depend on (real)clean_local rather than
	(real)clean.  This is because tests/startup and tests/shutdown
	use the *_local targets.

tests/general/Mmakefile:
	Fix bugs in the recursive mmake calls.
1999-07-14 17:04:41 +00:00
Peter Ross
f897757c22 Update the .cvsignore file.
Estimated hours taken: 0.25

Update the .cvsignore file.
1999-07-14 00:56:21 +00:00
Zoltan Somogyi
9a2a5e0d68 Explicitly specify --no-line-numbers for the pretty_print_test,
Estimated hours taken: 0.2

tests/misc_tests/Mmakefile:
	Explicitly specify --no-line-numbers for the pretty_print_test,
	since my recent change made --line-numbers the default.
1999-04-17 08:08:10 +00:00
Fergus Henderson
da72ea6d1f Tell cvs to ignore the `CLEAN' files produced by the
Estimated hours taken: 0.25

tests/debugger/.cvsignore:
tests/tabling/.cvsignore:
tests/misc_tests/.cvsignore:
tests/warnings/.cvsignore:
	Tell cvs to ignore the `CLEAN' files produced by the
	tests/{startup,shutdown} scripts.
1999-03-25 18:23:18 +00:00
Tyson Dowd
399f7a8375 Update the demangler test case to use type_ctor_* rather than
Estimated hours taken: 0.2

tests/misc_tests/mdemangle_test.inp:
tests/misc_tests/mdemangle_test.exp:
	Update the demangler test case to use type_ctor_* rather than
	base_type_*.
1999-03-22 08:09:33 +00:00
Fergus Henderson
2dd14c4726 Delete some long obsolete references to `.mod' files.
Estimated hours taken: 0.25

tests/general/Mmakefile:
tests/hard_coded/Mmakefile:
tests/hard_coded/typeclasses/Mmakefile:
tests/misc_tests/Mmakefile:
	Delete some long obsolete references to `.mod' files.
1998-07-27 11:09:35 +00:00
Fergus Henderson
44a5c5b2f8 Make the code a little bit more readable:
Estimated hours taken: 6

compiler/mercury_to_mercury.m:
compiler/mode_errors.m:
	Make the code a little bit more readable:
	use specific types rather than `bool' in a few places.

compiler/mercury_to_mercury.m:
	Fix bugs in the generation of interface files where it was
	outputting certain graphic tokens incorrectly.  In particular,
	it was outputting things like `module:?' without any parentheses,
	space, or quotes to separate the `:' as module qualifier from
	the symbol name.

tests/hard_coded/Mmakefile:
tests/hard_coded/quoting_bug.m:
tests/hard_coded/quoting_bug_test.m:
tests/hard_coded/quoting_bug_test.exp:
	Add some tests for the above-mentioned bug fix.

tests/term/*.trans_opt_exp:
tests/misc_tests/pretty_print_test.exp:
	Update expected output for these tests to reflect the
	above changes.
1998-05-20 13:10:50 +00:00
Zoltan Somogyi
564d358da3 Avoid about half of the slow "mmake realclean"s required by a bootcheck.
Estimated hours taken: 0.5

Avoid about half of the slow "mmake realclean"s required by a bootcheck.

tests/*/runtests:
	Concentrate all the actions performed before the test and after
	a successful tests (both of which involve an "mmake realclean")
	into two scripts, tests/{startup,shutdown}.

tests/shutdown:
	Clean up the directory, and touch the file CLEAN.

tests/startup:
	If the file CLEAN exists and is the most recent file in the directory,
	consider the directory clean to beging with. Otherwise, run mmake
	realclean.
1998-05-13 04:06:38 +00:00
Fergus Henderson
91386b16f1 Update the expected output for the pretty_print_test
Estimated hours taken: 0.5

tests/misc_tests/Mmakefile:
tests/misc_tests/pretty_print_test.exp:
	Update the expected output for the pretty_print_test
	test case to reflect the actual output, and re-enable
	that test case.  Arguably the extra parentheses in
	the output are undesirable, but they're needed to
	protect against the parser getting confused by
	the relative precedence of `:' and `/' for
	module-qualified symbols (e.g. in `.int' files).
	Also arguably the precedence of `:' is wrong,
	but it's probably not worth fixing this now since
	we plan to replace `:' with `.'.

	Also change the rule for `clean_ugly' to avoid hard-coding
	the path name `/bin/rm' and to instead use just `rm'.
	In some environments (e.g. Windows with gnu-win32),
	`rm' might not be in `/bin'.
1998-04-27 11:07:54 +00:00
Zoltan Somogyi
33a8e6e05a Remove .ugly files as part of the clean rule.
Estimated hours taken: 2

Mmakefile:
	Remove .ugly files as part of the clean rule. Without this,
	the .ugly file does not get remade, and the test is useless
	(it does not invoke the compiler at all).

	Temporarily disable the test (pretty_print_test) that uses a
	.ugly file, since it does not work.
1998-04-27 08:49:46 +00:00
Simon Taylor
75354e38bb Deforestation.
Estimated hours taken: 400

Deforestation.

This increases the code size of the compiler by ~80k when compiling
with --intermodule-optimization --deforestation.

The improvement from deforestation is not measurable for mmc -C make_hlds.m.
Compile time for make_hlds.m increased from 50.7 seconds to 52.2 seconds
when running deforestation.

compiler/simplify.m
compiler/common.m
	Provide a nicer interface for simplifying a goal,
	not an entire procedure.
	Rework the interface to avoid manipulating lots of booleans.
	Return an estimate of the improvement in cost from simplification.
	Remove failing cases and disjuncts.
	Add an option to optimize common structures even across calls.
	Remove code to merge branched goals, since that is now
	done by deforestation.

	Fix a bug: the code to collect instmap_deltas for cases was not
	including the switched-on variable in the instmap_delta,
	which caused an abort in merge_instmap_delta if the switched
	on variable was further instantiated in the switch.
	This came up while compiling the compiler with --deforestation.

compiler/det_report.
	Output duplicate call warnings even if --warn-simple-code is not set.
	XXX fix the same problem with `:- pragma obsolete'.

compiler/code_aux.m
	Update code_aux__cannot_loop to use termination information.

compiler/hlds_pred.m
compiler/dnf.m
	Pass the type_info_varmap and typeclass_info_varmap
	into hlds_pred__define_new_pred.
	Restrict the variables of the new procedure onto the variables
	of the goal.
	Make sure all relevant type_infos are passed into the new
	procedure if --typeinfo-liveness is set.

compiler/modes.m
compiler/unique_modes.m
compiler/mode_info.m
compiler/modecheck_unify.m
	Put `how_to_check_goal' into the mode_info, rather
	than passing it around.
	Add a field to the `check_unique_modes' case which
	controls whether unique modes is allowed to choose
	a different procedure. For deforestation, this is
	not allowed, since it could result in choosing a less
	efficient procedure after generalisation.

compiler/options.m
	New options:
	--deforestation
	--deforestation-depth-limit
		Safety net for termination of the algorithm.
	--deforestation-cost-factor
		Fudge factor for working out whether deforestation
		was worthwhile.
	--deforestation-vars-threshold
		Like --inline-vars-threshold.
	Enable deforestation at -O3.

	Removed an unnecessary mode for option_defaults_2, since it
	resulted in a warning about disjuncts which cannot succeed.

compiler/handle_options.m
	--no-reorder-conj implies --no-deforestation.

compiler/inlining.m
	Separate code to rename goals into inlining__do_inline_call.

compiler/hlds_goal.m
	Added predicates goal_list_nonlocals, goal_list_instmap_delta
	and goal_list_determinism to approximate information about
	conjunctions.

compiler/hlds_module.m
	Added module_info_set_pred_proc_info to put an updated
	pred_info and proc_info back into the module_info.

compiler/hlds_out.m
	Exported hlds_out__write_instmap for debugging of deforestation.
	Bracket module names on constructors where necessary.

compiler/mercury_compile.m
	Call deforestation.
	Use the new interface to simplify.m.

compiler/intermod.m
	Put recursive predicates with a top-level branched goal
	into `.opt' files.

goal_util.m
	Added goal_calls_pred_id to work out if a predicate is
	recursive before mode analysis.
	Export goal_util__goals_goal_vars for use by deforestation.
	Give a better message for a missing variable in a substitution.

compiler/instmap.m
	Give a better message for inst_merge failing.

compiler/notes/compiler_design.m
	Document the new modules.

library/varset.m
	Add varset__select to project a varset's names and values
	onto a set of variables.

doc/user_guide.texi
	Document deforestation.
	Remove a reference to a non-existent option, --no-specialize.

util/mdemangle.c
profiler/demangle.m
tests/misc_tests/mdemangle_test.{exp,inp}
	Handle the `DeforestationIn__' predicate names introduced by
	deforestation, similar to the `IntroducedFrom__' for lambda goals.

New files:

deforest.m	Deforestation.
pd_cost.m	Cost estimation.
pd_debug.m	Debugging output.
pd_info.m	State type and version control.
pd_term.m	Termination checking.
pd_util.m	Utility predicates
1998-04-27 04:05:12 +00:00
Zoltan Somogyi
cd31eecf88 When reporting the results, print the options that controlled
Estimated hours taken: 0.2

tests/runtests:
tests/*/runtests:
	When reporting the results, print the options that controlled
	the tests, so you don't have to search for them.

tests/*/runtests:
	Clean up the directory if the tests are successful, in order
	to reduce disk space usage.
1998-04-23 09:28:39 +00:00
Zoltan Somogyi
67d8308260 Same as previous message. 1998-04-08 11:36:13 +00:00
Fergus Henderson
7445bf79ca Update the expected debugger output to reflect my recent change
Estimated hours taken: 0.1

tests/misc_tests/debugger_test.exp:
	Update the expected debugger output to reflect my recent change
	to library/io.m which changed the way io__write prints out values
	of type `c_pointer'.
1998-03-12 21:33:01 +00:00
Fergus Henderson
ffaf587910 Tidy up the output of typeclass and instance declarations.
Estimated hours taken: 1.5

compiler/mercury_to_mercury.m:
	Tidy up the output of typeclass and instance declarations.
	Previously there were a number of minor problems (instance
	declarations not implemented, unnecessary parentheses,
	newlines in wrong places).

tests/misc_tests/Mmakefile:
tests/misc_tests/pretty_print_test.m:
tests/misc_tests/pretty_print_test.exp:
	Add a test case for pretty-printing.
1998-02-16 17:23:20 +00:00
Tyson Dowd
564d92c4c5 Turn off tracing tests in fast' and jump' grades.
Estimated hours taken: 0.5

tests/misc_tests/Mmakefile:
	Turn off tracing tests in `fast' and `jump' grades. The
	stack_layouts they rely on don't yet work in these grades.
1998-02-08 08:08:21 +00:00
Zoltan Somogyi
8e8ab025d8 Update the expected output after my recent change to the
Estimated hours taken: 0.2

tests/misc_tests/debugger_test.exp:
	Update the expected output after my recent change to the
	formatting of the output of the tracer.
1998-02-08 07:59:03 +00:00
Zoltan Somogyi
9797aa4029 This change fixes a bug in the tracer's handling of the virtual registers
Estimated hours taken: 1.5

This change fixes a bug in the tracer's handling of the virtual registers
that are not real registers.

runtime/mercury_regs.h:
	Make the saved_reg macro refer only to the given save area,
	not to the machine registers or to the fake_reg array.

runtime/mercury_trace.c:
	Make sure we save both real and fake registers in the save area.

	Make the internal functions and variables static, and make sure
	everything is prefixed by MR_. Use string concatenation in several
	places to make the code shorter.

tests/misc_tests/debugger_regs.{m,inp,exp}:
	A regression test case to make sure the tracer is handling high
	register numbers properly.
1998-02-04 03:55:54 +00:00
Zoltan Somogyi
5ef3bb6fdc Use stack layout tables to transmit information to the tracer, to allow
Estimated hours taken: 20

Use stack layout tables to transmit information to the tracer, to allow
the tracer to print the names and values of variables at CALL and EXIT ports.
Extend stack layout tables to permit this.

For the time being the tables do not contain information about how to fill
in pseudo-typeinfos, so printing only works for monomorphic procedures.

compiler/llds.m:
	Allow space for variable names in the information we gather about live
	variables at given labels.

compiler/llds_out.m:
	Print out variable names in the information we gather about live
	variables at given labels in comments.

compiler/continuation_info.m:
	Include variable names in the information we gather about live
	variables at given labels.

	Record the determinism of each procedure, not its code model.

compiler/{call_gen,code_gen,code_info}.m:
	Include the names of variables in the data given to
	continuation_info.m.

compiler/options.m:
	Add a new developer-only option, --procid-stack-layout, whose effect
	is to extend stack_layout structures with static info identifying the
	procedure. This is used by execution tracing, and could (should) be
	used by stack tracing and profiling.

	Rename --alternate-liveness as --typeinfo-liveness. This is more
	expressive. Later we should add a new option --trace-liveness, which
	preserves every variable until the end of the clause for use by
	the trace debugger.

compiler/handle_options.m:
	Handle the option implications of --procid-stack-layout.

compiler/stack_layout.m:
	Include the encoded determinism instead of the code model in stack
	layout tables.

	Include variable names in the live data section of stack layout tables
	if they are available.

	Include procedure identification information in the stack layout tables
	if --procid-stack-layout is set.

compiler/trace.m:
	Use the new interface to MR_trace.

compiler/*.m:
	Trivial changes following from the renaming of --alternate-liveness.

runtime/mercury_accurate_gc.h:
	Add macros to decode encoded determinisms.

	Define structs for accessing the stack layout tables.

runtime/mercury_regs.h:
	Define a macro similar to virtual_reg, except in that it can refer
	to an arbitrary memory area, not just fake_reg.

runtime/{mercury_string,mercury_types}.h:
	Move the typedefs of Char, UnsignedChar, String and ConstString
	from mercury_string.h to mercury_types.h to avoid problems with
	circular #includes.

runtime/mercury_trace.[ch]:
	Revise the interface to MR_trace so that it takes the layout table
	of the procedure as an argument. From the layout table, we can get
	to the module name, predicate name, arity, mode number, and
	determinism of the procedure, so we don't need to pass these any more,
	reducing parameter passing overhead. We can also get to information
	about where the input and output arguments are. We now use this
	information to allow the user to print out the value of the arguments
	at the CALL and EXIT ports.

	Change the prompt to a less intrusive "mtrace> ".

runtime/mercury_wrapper.[ch]:
	Add a new global variable, MR_library_trace_browser. We reserve space
	for this variable in mercury_wrapper.c. It will be initialized by the
	automatically generated xxx_init.c file to point to the procedure
	that the tracer will invoke to let the user browse the values of
	variables. This mechanism allows the runtime to maintain its current
	ignorance about the contents of the standard library.

util/mkinit.c:
	Generate additional code in the xxx_init.c files to fill in the value
	of MR_library_trace_browser.

tests/misc_tests/debugger_test.{inp,exp}:
	Add a few printing commands into the input for this test case, and
	update the expected output.
1998-02-03 08:20:12 +00:00
Fergus Henderson
e71755cdcb A small bug fix: add `./' at the start of the invocation of
Estimated hours taken: 0.1

tests/misc_tests/Mmakefile:
	A small bug fix: add `./' at the start of the invocation of
	debugger_test, so that it works even if you don't have `.'
	in your PATH.
1998-01-25 20:32:40 +00:00
Fergus Henderson
ad19f9c4e1 Add a test case for the `--generate-trace' debugger.
Estimated hours taken: 0.5

tests/misc_tests/Mmakefile:
tests/misc_tests/debugger_test.m:
tests/misc_tests/debugger_test.inp:
tests/misc_tests/debugger_test.exp:
	Add a test case for the `--generate-trace' debugger.
1998-01-25 08:44:37 +00:00
Fergus Henderson
8b96384162 Fix a bug that caused problems with profiling.
Estimated hours taken: 1

Fix a bug that caused problems with profiling.

util/mdemangle.c:
profiler/demangle.m:
	When demangling lambda goals, include the sequence number
	and module name in the demangled name.
	The profiler requires that the mapping between mangled
	and demangled names must be one-to-one.

tests/misc_tests/mdemangle_test.inp:
tests/misc_tests/mdemangle_test.exp:
	Update the tests to reflect the new demangling algorithm.
1997-10-13 10:18:37 +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
Fergus Henderson
84ffb7a96c Fix a bug introduced in Tom's recent changes to handle
Estimated hours taken: 0.5

util/mdemangle.c:
	Fix a bug introduced in Tom's recent changes to handle
	lamdbda goals: for ordinary predicates, it was just
	printing out the module name, not the predicate name.

tests/misc_tests/mdemangle_test.inp:
tests/misc_tests/mdemangle_test.exp:
	Some regression tests for the above bug fix.
1997-09-29 07:23:38 +00:00
Fergus Henderson
25f79e86ca Update to reflect my recent change to the name mangling algorithm
Estimated hours taken: 0.25

tests/misc_test/mdemangle_test.inp:
	Update to reflect my recent change to the name mangling algorithm
	(which was to make things work with Windows DLLs): s/entry/_entry/g.
1997-09-10 20:03:24 +00:00
Thomas Conway
7f76965114 add a couple of tests for the mangling of lambda goal names
tests/misc_tests/mdmangle.{inp,exp}:
	add a couple of tests for the mangling of lambda goal names

utils/mdemangle.c:
	bugfix to previous change.
1997-08-27 05:03:50 +00:00
Fergus Henderson
7de2281fcb Ensure that all names are properly demangled, both by mdemangle
and in the profiler.

util/mdemangle.c:
	Add code to demangle the special-case names properly.

tests/misc_tests/mdemangle_test.inp:
tests/misc_tests/mdemangle_test.exp:
	Modify the expected output to reflect the bug fix to util/demangle.c.

profiler/demangle.m:
	New module: contains a procedure for demangling Mercury labels.

profiler/demangle_test.m:
	Test harness for demangle.m.  Duplicates the functionality of
	util/demangle.c.  (Currently not used for anything except testing,
	but we might one day want to use this code to replace util/demangle.c)

profiler/read.m:
	Use the code in demangle.m to demangle labels.

profiler/output.m:
	Output the alphabetic listing using one column rather than two,
	since the demangled names are often too long to fit in a two-column
	format.

profiler/options.m:
profiler/prof_info.m:
	Remove some unnecessary `import_module' declarations.

compiler/unused_args.m:
	Fix a bug in the mangling of predicate names for unused-arg
	versions of special preds (index, compare, unify).
1997-07-26 11:45:06 +00:00
Fergus Henderson
eef924930d If the tests succeeded, remove the `.allres' file, rather than
Estimated hours taken: 0.25

test/*/runtests:
	If the tests succeeded, remove the `.allres' file, rather than
	leaving it lying around.
1997-07-14 03:18:46 +00:00
Fergus Henderson
80cd9413ab Update the expected output to reflect the new test that
Estimated hours taken: 0.2

tests/misc_tests/mdemangle_test.exp:
	Update the expected output to reflect the new test that
	Tyson added.
1997-06-07 08:22:06 +00:00
Tyson Dowd
dcc2b68266 Fix mdemangle to handle `base_type_functors'.
Estimated hours taken: 0.3

util/mdemangle.c:
	Fix mdemangle to handle `base_type_functors'.

tests/misc_tests/mdemangle_test.inp:
	Add a test case for `base_type_functors'.
1997-06-05 05:50:16 +00:00
Fergus Henderson
5c36287999 Fix a trivial bug: add mdemangle.out to $(OUTS).
Estimated hours taken: 0.1

tests/misc_tests/Mmake:
	Fix a trivial bug: add mdemangle.out to $(OUTS).
1997-05-23 17:47:57 +00:00
Tyson Dowd
630c98c8f1 Remove support for term_to_type and type_to_term implemented as special
Estimated hours taken: 5

Remove support for term_to_type and type_to_term implemented as special
preds.  Remove support for one-cell and one-or-two-cell type_infos (now
shared-one-or-two-cell type_infos). Move definitions that were in
mercury_builtin.m back to where they belong.

This code has been removed because it is no longer used, and was no
longer being maintained but was still quite complex.

tests/general/disj_disj.m:
tests/general/dnf.m:
tests/general/higher_order.m:
tests/general/nondet_disj.m:
tests/hard_coded/cc_nondet_disj.m:
tests/hard_coded/pragma_inline.m:
tests/invalid/funcs_as_preds.err_exp:
tests/misc_tests/mdemangle_test.exp:
tests/valid/agc_unbound_typevars.m:
tests/valid/middle_rec_labels.m:
tests/valid/subtype_switch.m:
tests/warnings/infinite_recursion.m:
	Import module `list' or `term' (or both).
1997-05-20 02:09:15 +00:00
Fergus Henderson
c53116eb7d Add a regression test for the bug I just fixed in util/mdemangle.c.
Estimated hours taken: 0.25

tests/misc_tests/mdemangle_test.inp:
	Add a regression test for the bug I just fixed in util/mdemangle.c.
1997-05-14 11:49:34 +00:00
Tyson Dowd
bc1e28d8d5 Fix bugs in the scripts for running tests.
Estimated hours taken: 6

Fix bugs in the scripts for running tests.

tests/handle_options:
	Quote EXTRA_CFLAGS and EXTRA_MCFLAGS so that we can use
	eval in runtests.

tests/Mmake.common:
	Set MGNUCFLAGS using $(EXTRA_MGNUFLAGS) and $(EXTRA_CFLAGS)

tests/*/runtests:
	Don't pass empty strings as arguments to mmake, as this can
	tickle bugs in make.
	Try
		make -f foo.123 ""
	on a CASE machine or hydra (not kryten, it has a different
	version of gnu-make). It will chop the `23' from that string.
	So when using `make -f mmake.$$', only the single digit pids
	work, which is fairly limiting.
1997-03-18 06:01:27 +00:00
Fergus Henderson
b1a17716b9 Fix a buggy test case: index/3 should have been index/2.
Estimated hours taken: 0.1

tests/mdemangle_test.inp:
tests/mdemangle_test.exp:
	Fix a buggy test case: index/3 should have been index/2.
1997-03-15 06:21:05 +00:00
Simon Taylor
96cd2cc5ba Added some more test cases for mdemangle.
Estimated hours taken: 0.1

tests/misc_tests/mdemangle_test.{exp, inp}
        Added some more test cases for mdemangle.
1997-01-29 07:01:11 +00:00
Tyson Dowd
03378d1c58 Add test for mdemangle.
Estimated hours taken: 1

Add test for mdemangle.

tests/misc_tests/Mmake:
tests/misc_tests/runtests:
    Scaffolding for testing in this directory.

tests/misc_tests/mdemangle_test.inp:
tests/misc_tests/mdemangle_test.exp:
	Test input and expected output for mdemangle, includes currently
    mangled symbols and expected outputs.
1997-01-29 01:17:07 +00:00