Commit Graph

160 Commits

Author SHA1 Message Date
Mark Brown
0dfb9c4874 New module for directed graphs. This is essentially the relation
Estimated hours taken: 12
Branches: main

library/digraph.m:
	New module for directed graphs.  This is essentially the relation
	module but with more consistent terminology, and with argument
	ordering that suits state variables.  Other differences with the
	relation module:

	- The digraph_key type has a phantom type parameter, which helps to
	  ensure that keys from one digraph are not used with another digraph.

	- Exports a version of digraph.reduced which also returns the mapping
	  between the original digraph keys and the new ones.

	- The implementation of compose/3 doesn't try to use the "domain" and
	  "range" of the graphs (which is meaningless in the relation module
	  anyway).

	- New, more efficient algorithm for is_dag/1.  Correctness proof is
	  documented.

	- components/2 uses a more efficient data representation, and avoids
	  some intermediate data structures.

	- reduced/{2,3} avoids some intermediate data structures.

	- tc/2 avoids some intermediate data structures.

library/library.m:
	Add the new module.

library/relation.m:
	Document that this module is deprecated in favour of digraph.

	Flag relation.init/{0,1} as obsolete (it would be better to flag
	the entire module, or the relation/1 type as obsolete, but Mercury
	does not support this).

NEWS:
	Mention that the new module supersedes relation.m and svrelation.m.

compiler/*.m:
profiler/*.m:
	Use the digraph module rather than the relation module.
2007-09-07 15:08:21 +00:00
Peter Wang
7fa0dff1b5 Add more documentation for the Erlang backend.
Estimated hours taken: 6
Branches: main

Add more documentation for the Erlang backend.

Make it possible to configure and install the Erlang backend without too
much manual tweaking.

NEWS:
	Mention the Erlang backend.

README.Erlang:
	Add installation and other notes for Erlang.

doc/reference_manual.texi:
doc/user_guide.texi:
	Add documentation for Erlang.

aclocal.m4:
configure.in:
	Check that the bootstrap compiler knows about the
	builtin_compound_{eq,lt} builtins, and understands
	--erlang-native-code.

	Make configure check for Erlang tools.

	Add configure --enable-erlang-grade option.  Erlang support
	is disabled by default.

scripts/Mercury.config.in:
	Add `--erlang-compiler <erl>' and `--erlang-interpreter <erlc>'
	options to be set by configure.

analysis/ANALYSIS_FLAGS.in:
compiler/COMP_FLAGS.in:
mdbcomp/MDBCOMP_FLAGS.in:
	Add `--erlang-include-directory <dir>/Mercury/hrls' options so that
	the compiler can find Erlang header files from other subdirectories.

compiler/Mercury.options:
library/Mercury.options:
	Work around bugs in the HiPE compiler when compiling two modules.

	Delete the workaround that was necessary while bootstrapping
	builtin_compound_{eq,lt}.

compiler/options.m:
	Add notes that two options to check that the compiler is recent enough
	won't be recognised because they begin "no-" prefixes, and we have
	to use "--no-no-" instead.

compiler/options_file.m:
	Support ERLANG_FLAGS, EXTRA_ERLANG_FLAGS variables in options files to
	be the same as passing --erlang-flags.

browser/Mmakefile:
compiler/Mmakefile:
deep_profiler/Mmakefile:
library/Mmakefile:
mdbcomp/Mmakefile:
profiler/Mmakefile:
runtime/Mmakefile:
slice/Mmakefile:
trace/Mmakefile:
	Make the build system do the same things in the Erlang grade as for
	the IL and Java grades.

scripts/final_grade_options.sh-subr:
scripts/parse_grade_options.sh-subr:
	Make these scripts know about the erlang grade so that parts of the
	build system won't abort on seeing it.
2007-07-20 01:22:06 +00:00
Julien Fischer
2c2542814e Ignore autoconf generated files and files generated
Estimated hours taken: 0.1
Branches: main

*/.cvsignore:
	Ignore autoconf generated files and files generated
	by the tests.
2007-06-15 12:41:47 +00:00
Julien Fischer
9958d3883c Fix some formatting.
Estimated hours taken: 0
Branches: main

Fix some formatting.

compiler/distance_granularity.m:
compiler/exception_analysis.m:
compiler/implicit_parallelism.m:
compiler/inst_graph.m:
compiler/interval.m:
compiler/layout_out.m:
compiler/lp_rational.m:
compiler/make.program_target.m:
compiler/modules.m:
compiler/prog_data.m:
compiler/purity.m:
compiler/recompilation.check.m:
compiler/term_constr_data.m:
compiler/term_util.m:
compiler/xml_documentation.m:
deep_profiler/mdprof_cgi.m:
library/pqueue.m:
profiler/output.m:
	Fix the positioning of commas.

	s/[_|_]/[_ | _]/ in a spot.
2007-05-23 10:09:24 +00:00
Julien Fischer
7c8ee761ef Bump the year in the copyright messages.
Estimated hours taken: 0
Branches: main

.README.in:
compiler/handle_options.m:
doc/reference_manual.texi:
doc/user_guide.texi:
profiler/mercury_profile.m:
trace/mercury_trace_internal.c:
	Bump the year in the copyright messages.
2007-01-03 02:37:31 +00:00
Julien Fischer
b4c3bb1387 Clean up in unused module imports in the Mercury system detected
Estimated hours taken: 3
Branches: main

Clean up in unused module imports in the Mercury system detected
by --warn-unused-imports.

analysis/*.m:
browser/*.m:
deep_profiler/*.m:
compiler/*.m:
library/*.m:
mdbcomp/*.m:
profiler/*.m:
slice/*.m:
	Remove unused module imports.

	Fix some minor departures from our coding standards.

analysis/Mercury.options:
browser/Mercury.options:
deep_profiler/Mercury.options:
compiler/Mercury.options:
library/Mercury.options:
mdbcomp/Mercury.options:
profiler/Mercury.options:
slice/Mercury.options:
	Set --no-warn-unused-imports for those modules that are used as
	packages or otherwise break --warn-unused-imports, e.g. because they
	contain predicates with both foreign and Mercury clauses and some of
	the imports only depend on the latter.
2006-12-01 15:04:40 +00:00
Zoltan Somogyi
ff386022ae Fix a bunch of deviations from our coding standards.
Estimated hours taken: 1
Branches: main

profiler/*.m:
	Fix a bunch of deviations from our coding standards.

	Rename some predicates to make them better reflect the predicates'
	semantics.
2006-11-10 03:26:28 +00:00
Julien Fischer
459847a064 Move the univ, maybe, pair and unit types from std_util into their own
Estimated hours taken: 18
Branches: main

Move the univ, maybe, pair and unit types from std_util into their own
modules.  std_util still contains the general purpose higher-order programming
constructs.

library/std_util.m:
	Move univ, maybe, pair and unit (plus any other related types
	and procedures) into their own modules.

library/maybe.m:
	New module.  This contains the maybe and maybe_error types and
	the associated procedures.

library/pair.m:
	New module.  This contains the pair type and associated procedures.

library/unit.m:
	New module. This contains the types unit/0 and unit/1.

library/univ.m:
	New module. This contains the univ type and associated procedures.

library/library.m:
	Add the new modules.

library/private_builtin.m:
	Update the declaration of the type_ctor_info struct for univ.

runtime/mercury.h:
	Update the declaration for the type_ctor_info struct for univ.

runtime/mercury_mcpp.h:
runtime/mercury_hlc_types.h:
	Update the definition of MR_Univ.

runtime/mercury_init.h:
	Fix a comment: ML_type_name is now exported from type_desc.m.

compiler/mlds_to_il.m:
	Update the the name of the module that defines univs (which are
	handled specially by the il code generator.)

library/*.m:
compiler/*.m:
browser/*.m:
mdbcomp/*.m:
profiler/*.m:
deep_profiler/*.m:
	Conform to the above changes.  Import the new modules where they
	are needed; don't import std_util where it isn't needed.

	Fix formatting in lots of modules.  Delete duplicate module
	imports.

tests/*:
	Update the test suite to confrom to the above changes.
2006-03-29 08:09:58 +00:00
Zoltan Somogyi
a9a2825ace Replace __ with . as the module qualifier everywhere in all the modules
Estimated hours taken: 0.5
Branches: main

profiler/*.m:
deep_profiler/*.m:
compiler/*.m:
	Replace __ with . as the module qualifier everywhere in all the modules
	of the profiler and deep profiler and in some modules of the compiler.
2006-03-09 04:56:47 +00:00
Peter Wang
0290b5a4bf This fixes some problems with building everything with `mmake --use-mmc-make'
Estimated hours taken: 3
Branches: main

This fixes some problems with building everything with `mmake --use-mmc-make'
on x86, or possibly any platform where shared libraries are supported.

Mmake.workspace:
	Add "--mercury-linkage static" or "--mercury-linkage shared" to
	`MCFLAGS' depending on whether the `LINK_STATIC' makefile variable is
	yes or no.

analysis/ANALYSIS_FLAGS.in:
	Add -L<dir> options so that the analysis library can find the boehm_gc,
	runtime and standard library files when built in shared linking mode.

browser/Mercury.options:
	Work around a problem with per-file variables and `mmake
	--use-mmc-make'.

compiler/COMP_FLAGS.in:
profiler/PROF_FLAGS.in:
slice/SLICE_FLAGS.in:
	Remove "--linkage shared" from these files.  The Mmakefiles in these
	directories have "LINK_STATIC=yes" set.  This was causing a link error
	where the object files where being built with PIC but expected to
	link against lib*.a files.
2006-01-12 07:07:31 +00:00
Julien Fischer
e9babef3f7 Update the year in the copyright messages to 2006.
Estimated hours taken: 0.1
Branches: main

compiler/handle_options.m:
doc/reference_manual.texi:
doc/user_guide.texi:
profiler/mercury_profile.m:
trace/mercury_trace_internal.c:
	Update the year in the copyright messages to 2006.
2006-01-03 04:03:07 +00:00
Zoltan Somogyi
be034a61ca Reduce even further the clutter of boring command line arguments.
Estimated hours taken: 0.3
Branches: main

Reduce even further the clutter of boring command line arguments.

scripts/mgnuc.in:
	If a file named .mgnuc_opts exists in the current directory,
	read mgnuc options from it. This mechanism is very similar to the
	mechanism I added a while ago to get C compiler options from a
	file named .mgnuc_copts.

	Convert to four-space indentation.

scripts/mgnuc_file_opts.sh-subr:
	New file containing most of the option handling code that used to be
	in mgnuc.in. Now, it is is included in mgnuc twice: once for handling
	options from the command line, once for handling options from
	.mgnuc_opts files.

configure.in:
	Set up configure to insert mgnuc_file_opts.sh-subr into mgnuc.

*/.mgnuc_opts:
	New files specifying the --no-mercury-stdlibdir mgnuc option.

Mmake.workspace:
	Don't pass --no-mercury-stdlibdir on command lines anymore, since this
	is now taken care of by the .mgnuc_opts files.
2005-09-19 08:07:15 +00:00
Julien Fischer
de5ab1af8f Implement a procedure-local closure analysis that tracks the possible
Estimated hours taken: 30
Branches: main

Implement a procedure-local closure analysis that tracks the possible
values of higher-order valued variables within a procedure.  We will
eventually replace this with a more sophisticated analysis that tracks
these values across procedure and module boundaries but we need something
of this capability now in order to continue development of the termination
and exception analyses.

This analysis is similar to that carried out by higher-order
specialization except here we do keep track of higher-order variables
that have multiple possible values.

compiler/closure_analysis.m:
	Keep track of the possible values of higher-order variables
	within a procedure.  Annotate goals in the HLDS with this
	information where it might prove useful.

compiler/hlds_goal.m:
	Add an extra field to the goal_info that is designed
	to hold the results of optional analysis passes.  At
	the moment this is only used to hold the results of
	closure analysis.

compiler/options.m:
compiler/mercury_compile.m:
	Add code to invoke the new analysis.  Closure analysis
	is stage 117, directly before exception analysis.

compiler/passes_aux.m:
	Add a version of write_proc_progress_message, that does
	not require the caller to deconstruct a pred_proc_id.

compiler/prog_type.m:
	Add a predicate type_is_higher_order/1 that is similar
	type_is_higher_order/5 except that it doesn't have any
	outputs.

compiler/transform_hlds.m:
	Include the new module.

doc/user_guide.texi:
	Document the '--analyse-closures'  and '--debug-closures'
	options.  The documentation is currently commented out until
	closure analysis is useful for something.

doc/reference_manual.texi:
	s/must have give a definition/must give a definition/

*/.cvsignore:
	Have CVS ignore the various *_FLAGS files generated
	by the configure script.
2005-06-17 10:13:57 +00:00
Julien Fischer
865d7d4d26 Workaround a problem in the demangler so that mprof works when the
Estimated hours taken: 8
Branches: main, release

Workaround a problem in the demangler so that mprof works when the
library is compiled at -O5 and greater.  The problem is that the names
of the predicates generated by unused argument analysis were changed
(when Simon integrated unused argument analysis into the intermodule
analysis framework), but the code in the demangler was never updated
accordingly.  (The log message says that there was a change to the
demangler being planned at the same time, which is why it was never
updated - evidently it never happened.)

The above situation sometimes results in two different mangled names
demangling to the same name.  The workaround, for the moment, is to
disable all demangling, bar the fixing of mangled ASCII codes, for
predicates created by unused argument analysis.

profiler/demangle.m:
util/mdemangle.c:
	Add a workaround to the demanglers so that the profiler
	does not abort when processing procedures produced by
	unused argument analysis.
2005-06-01 03:56:16 +00:00
Julien Fischer
a0e730cdb7 Add a missing pair of io.state arguments.
Estimated hours taken: 0.1
Branches: main

profiler/demangle_test.m:
	Add a missing pair of io.state arguments.
2005-05-30 06:03:08 +00:00
Zoltan Somogyi
d124cad510 Reduce the amount of clutter on mgnuc command lines by moving arguments that
Estimated hours taken: 4
Branches: main

Reduce the amount of clutter on mgnuc command lines by moving arguments that
are always the same for a given directory into a file that is always consulted
by mgnuc in the current directory.

scripts/mgnuc.in:
	Always include as C compiler arguments the contents of a file named
	.mgnuc_copts in the current directory, if it exists. (It is named
	.mgnuc_copts instead of .mgnuc_opts because it may not contain
	general mgnuc options, such as --no-mercury-stdlib-dir.)

Mmake.workspace:
	Comment out the additions of search paths to CFLAGS.

*/Mmakefile:
	Delete the additions of search paths to CFLAGS.

*/.mgnuc_copts:
	New files containing the directory-specific search paths, and in some
	cases the required macro definitions. These replace what was taken out
	of Mmake.workspace and */Mmakefile. In some cases, the old search paths
	included inappropriate directories; the .mgnuc_copt files don't.

tests/.mgnuc_copts.ws:
	New files containing the directory-specific search paths; bootcheck
	makes tests/.mgnuc_copts from it.

*/.nocopyright:
	Don't require copyright notices in .mgnuc_copts files.

tools/bootcheck:
	Copy the various .mgnuc_copts files from the stage1 to stages 2 and 3.
	They aren't needed in stage3 right now, but that may change.

	Create tests/.mgnuc_copts.

browser/util.m:
	Delete an unused and inappropriate #include.

scripts/Mmake.rules:
	Use a single invocation of mkdir -p to create all subdirectories
	needed by Java. Update a piece of documentation.

scripts/Mmakefile:
	Reorganize the process of invoking config.status to avoid invoking
	it on inappropriate files, and to ensure the right permissions
	on the files it is invoked on.

scripts/prepare_tmp_dir_grade_part:
	Copy the .mgnuc_copts files when populating tmp_dir.
2005-05-20 06:15:28 +00:00
Zoltan Somogyi
d56de30e9d Remove most of the junk from the command lines executed by make when building
Estimated hours taken: 12
Branches: main

Remove most of the junk from the command lines executed by make when building
the compiler and by bootcheck when building test cases. We do this by moving
the junk into files consulted via the --flags option.

After this change, it is actually possible to see in a glance not just which
files are being compiled but also with which options. The size of the output
(measured in bytes) from a bootcheck is now only about 40% of what is was
before.

configure.in:
	Remember the path to the bootstrap compiler and the flags it should be
	invoked with separately. Put the flags into the FLAGS files in various
	directories.

	Test whether the default install directory actually exists, so that
	the -L and -R linker options referring to this directory are passed
	to the C compiler only if it does.

Mmake.common.in:
	Comment out a bunch of additions of MCFLAGS, the ones whose contents
	are now in FLAGS files.

	Conform to the changes in configure.in.

	Add a template rule for the dependencies of the FLAGS files.

Mmake.workspace:
	Comment out a bunch of additions of MCFLAGS, the ones whose contents
	are now in FLAGS files. In some cases, add references to the FLAGS
	files.

Mmakefile:
	When rebuilding Mmake.common, rebuild only Mmake.common, not all files
	created by configure.

analysis/ANALYSIS_FLAGS.in:
browser/MDB_FLAGS.in:
compiler/COMP_FLAGS.in:
deep_profiler/PROF_FLAGS.in:
library/LIB_FLAGS.in:
mdbcomp/MDBCOMP_FLAGS.in:
profiler/DEEP_FLAGS.in:
slice/SLICE_FLAGS.in:
tests/TESTS_FLAGS.in:
	Add these files, which each contain the junk flags (the flags which are
	the same on every invocation and mostly just clutter up compiler
	command lines) that are needed on each compiler invocation in the
	relevant directory. Besides the results of configuration (word size
	etc), and the paths to other parts of the system, these files mostly
	control which warnings are enabled.

	Restrict the list of directories in -I options to what is sensible;
	for example, don't specify -I../analysis in the deep_profiler
	directory.

*/.nocopyright:
	Don't require copyright notices in FLAGS files, since that would make
	them invalid.

library/INTER_FLAGS:
	Add this file, which contains the flags enabled with intermodule
	optimization.

tests/WS_FLAGS.ws:
	Add this file. Unlike the .in files, which processed by config.status
	based on the results of autoconfiguration, this one is processed to
	specify the location of the workspace being tested.

analysis/Mmakefile:
browser/Mmakefile:
compiler/Mmakefile:
deep_profiler/Mmakefile:
library/Mmakefile:
mdbcomp/Mmakefile:
profiler/Mmakefile:
tests/Mmakefile:
	Include the relevant directory's FLAGS file on the command line, to
	replace all the additions to MCFLAGS in ../Mmake.common and in
	../Mmake.workspace, and in some cases, the directory-specific Mmakefile
	itself.

	Build the directory's FLAGS file before executing the depend target,
	since most compiler options beyond --generate-dependencies come from
	there.

	Delete the FLAGS files generated by config.status when doing "make
	clean".

tests/Mmakefile:
	Allow the environment to define DIFF_OPTS.

runtime/Mmakefile:
	Use an option to tell config.status what to rebuild, not some
	environment variables.

tests/invalid/Mercury.options:
	For two test cases, reset an option that is set in tests/WS_FLAGS,
	to match the options the affected tests were compiled with before.

tests/invalid/*.err2:
	Update these expected files to account for the use of error_util
	in error messages by previous changes to the compiler. These expected
	output files are used only with --use-subdirs.

tests/warnings/Mmakefile:
	For all test cases, reset an option that is set in tests/WS_FLAGS,
	to match the options the tests were compiled with before.

scripts/prepare_tmp_dir_grade_part
	Copy the flags files when creating the subdirectories of tmp_dir.

scripts/mgnuc.in:
	Provide a mechanism, a per-directory .mgnuc_opts file, for specifying
	the options that are required for every C file in a directory. The
	intention is to use this for -I../library etc, but this is not done
	yet; one thing at a time.

tools/bootcheck:
	Copy the FLAGS files when creating stage2 and stage3.

	Don't specify the compiler options that are now in FLAGS files.

	Fill in the location of the workspace in tests/WS_FLAGS before running
	the tests.

	Provide a mechanism (a file ~/.bootcheck_diff_opts) to allow the user
	to specify what options to invoke diff with.

	Move the setting of MMAKE_USE_SUBDIRS and MMAKE_USE_MMC_MAKE after
	we have built stage1, and always copy the profilers if --use-subdirs
	is set. The old ways of doing things caused problems if bootcheck
	was given --use-subdirs but stage1 doesn't use subdirs: the bootcheck
	modified the stage1 slice, profiler and deep_profiler directories.
2005-05-06 08:42:37 +00:00
Zoltan Somogyi
69d84ff1bb Import only one module per line. Misc other updates to bring these
Estimated hours taken: 1
Branches: main

profiler/*.m:
deep_profiler/*.m:
	Import only one module per line. Misc other updates to bring these
	modules closer to being up to date with our current style guidelines.
2005-03-24 01:10:34 +00:00
Zoltan Somogyi
38cf98fb2f Allow users to ensure that tags files always exist in the relevant directories
Estimated hours taken: 1
Branches: main

Allow users to ensure that tags files always exist in the relevant directories
by setting the environment variable ALWAYS_MMAKE_TAGS_FILE.

runtime/Mmakefile:
trace/Mmakefile:
library/Mmakefile:
browser/Mmakefile:
compiler/Mmakefile:
profiler/Mmakefile:
deep_profiler/Mmakefile:
	If TAGS_FILE_EXISTS is set to tags_file_exists, then make the default
	action ensure the existence of the tags file. It would be too
	expensive to remake the tags file every time mmake is run, but
	just testing for its existence is cheap enough.

	Fix the formatting of some rules.

Mmake.common.in:
	Set TAGS_FILE_EXISTS to tags_file_exists if the environment variable
	ALWAYS_MMAKE_TAGS_FILE is set.

	Fix some documentation.
2005-01-14 05:53:47 +00:00
Julien Fischer
08923407e2 Update copyright years for 2005.
Estimated hours taken: 0.1
Branches: main

compiler/handle_options.m:
doc/reference_manual.texi:
doc/user_guide.texi:
profiler/mercury_profile.m:
trace/mercury_trace_internal.c:
	Update copyright years for 2005.
2005-01-05 05:09:35 +00:00
Julien Fischer
127a69f2fd Use .' in place of :' as the module qualifier in the
Estimated hours taken: 0.2
Branches: main

profiler/demangle.m:
	Use `.' in place of `:' as the module qualifier in the
	output from mprof.

	s/is/=/ in a spot.
2004-12-20 04:11:56 +00:00
Zoltan Somogyi
9c488dd2b3 A bunch of small improvements to the library.
Estimated hours taken: 4
Branches: main

A bunch of small improvements to the library.

library/getopt.m:
	Allow the determinism of the the option_defaults predicate
	passed by users to getopt__process_options to be multi as well as
	nondet. The natural determinism of such predicates is multi;
	the nondet determinism dates from before the time the compiler
	supported multi.

	Add a version of process_options that allows it to be run more
	than once (by allowing it to start with an option table returned
	by a previous invocation) and returns the set of options set by
	each invocation, so that the caller can tell which invocation
	(if any) has set any given option.

	Switch to 4-space indentation to reduce the number of bad line breaks.

library/svset.m:
	This new module svset makes it easier to work with sets in
	code that uses state variables. For every predicate in set.m that
	updates sets, svset.m contains a predicate doing the same thing
	with an argument order conducive to the use of state variables.

	This module is now used in getopt.m.

library/library.m:
	Mention the new module.

library/map.m:
library/tree234.m:
	Add new mode to map__map_foldl that I found I needed in elk.

library/map.m:
library/svmap.m:
	Apply type specialization to all the most frequently used predicates
	for updating maps.

NEWS:
	Mention the functionality in getopt.m, and the new module.

	Group all the items related to getopt.m.

browser/parse.m:
compiler/options.m:
profiler/mercury_profile.m:
deep_profiler/mdprof_cgi.m:
deep_profiler/mdprof_test.m:
	Conform to the new determinism in getopt.m.
2004-12-16 03:17:30 +00:00
Julien Fischer
9126f1b06a Clean up most of the profiler and bring it into line
Estimates hours taken: 5
Branches: main

Clean up most of the profiler and bring it into line
with out current coding standards.  There are no changes
to any algorithms.

This reduce the size of the code and also (hopefully)
makes things a little easier to maintain.

XXX The profiler is currently broken on those machines
that compile with intermodule optimization, e.g jupiter.

XXX I haven't cleaned up the demangler much yet either.

profiler/call_graph.m:
profiler/generate_output.m:
profiler/globals.m:
profiler/output.m:
profiler/mercury_profile.m:
profiler/process_file.m:
profiler/output_prof_info.m:
profiler/prof_debug.m:
profiler/prof_info.m:
profiler/propagate.m:
profiler/read.m:
	Bring these modules in line with our current
  	coding standards.

	Replace existing code with code that uses
	higher-order predicates, state variables and
	functions where appropriate.

profiler/demangler.m:
	Replace `is' with `='.
2004-12-02 08:01:11 +00:00
Julien Fischer
19da72d2fb Make cvs ignore .opt, .trans_opt and related files.
analysis/.cvsignore:
browser/.cvsignore:
compiler/.cvsignore:
profiler/.cvsignore:
	Make cvs ignore .opt, .trans_opt and related files.
2004-07-22 14:41:07 +00:00
Julien Fischer
f1f204e88c Deprecate the predicate int.to_float/2 in favour of float.float/1.
Estimated hours taken: 0.5
Branches: main

Deprecate the predicate int.to_float/2 in favour of float.float/1.
(There has been a comment describing this as obsolete for some time).

NEWS:
	Mention this change.

library/float.m:
	Add an implementation of float.float/1 rather than
	just calling int.to_float/2.

library/int.m:
	Add a pragma obsolete declaration to int.to_float/2.
	The implementation will have to stay until the predicate
	is deleted because importing the float module into this
	one results in type ambiguities.

library/term.m:
profiler/generate_output.m:
profiler/output.m:
profiler/propagate.m:
tests/hard_coded/agg.m:
tests/hard_coded/qual_strang.m:
tests/hard_coded/qual_strung.m:
	Change calls to int.to_float/2 to calls to float.float/1.
2004-07-08 06:00:50 +00:00
Zoltan Somogyi
88621408d6 Actually delete the offending mode.
Estimated hours taken: 0.1
Branches: main

profiler/globals.m:
	Actually delete the offending mode.
2004-05-19 01:56:39 +00:00
Zoltan Somogyi
9cf50bd691 Delete the semidet mode of globals__io_lookup_bool_option,
Estimated hours taken: 0.1
Branches: main

profiler/globals.m:
	Delete the semidet mode of globals__io_lookup_bool_option,
	which is now detected to be illegal due to its pair of I/O states.
2004-05-17 05:17:49 +00:00
Julien Fischer
0de782a385 I missed this one last time.
profiler/mercury_profile.m:
	Update the copyright date in long version of the usage message.
2004-01-21 01:27:32 +00:00
Julien Fischer
190d32b4dc Update copyright dates in the output messages.
Estimated hours taken: 0.2
Branches: main

compiler/handle_options.m:
profiler/mercury_profile.m:
trace/mercury_trace_internal.c:
	Update copyright dates in the output messages.
2004-01-20 09:13:23 +00:00
Simon Taylor
e18d74a90e Fix performance bugs in library/relation.m which caused
Estimated hours taken: 12
Branches: main

Fix performance bugs in library/relation.m which caused
`mmc --generate-dependencies' to choke on large programs
(e.g. the compiler).

`mmc --generate-dependencies top_level' now takes
about 8 seconds on jupiter, compared to over a minute
before.

library/relation.m:
	Use sparse_bitset for sets of relation_keys.

	Rewrite relation__compose to use the indexing
	in the relation structure, rather than just
	doing a naive nested loop join.

	Clean up and fix a bug in relation__is_dag.

	Rewrite algorithms to avoid using to_sorted_list
	on sparse_bitsets of relation keys; this is not
	a cheap operation as it is with set.sets.
	Use sparse_bitset.fold{l,r} instead where
	possible.

library/sparse_bitset.m:
	Add new functions to_set and from_set,
	which convert between sparse_bitsets
	and set.sets.

	Add predicate versions of foldl and foldr with
	the same modes as the list version.

compiler/modules.m:
	Use sparse_bitset.foldl rather than sparse_bitset.to_sorted_list
	followed by list.map.

profiler/propagate.m:
	relation__dfsrev now takes a sparse_bitset(relation_key),
	not set_bbbtree(relation_key).

library/map.m:
library/tree234.m:
	Type specialize map__det_update for term.var and int.

NEWS:
	Document new predicates and functions.

tests/hard_coded/relation_test.{m,exp}:
	Test relation__is_dag.
2003-12-22 11:21:49 +00:00
Fergus Henderson
8020bfed3c Some Mmakefile tweaks for grade java.
Estimated hours taken: 0.5
Branches: main

Some Mmakefile tweaks for grade java.

boehm_gc/Mmakefile:
browser/Mmakefile:
trace/Mmakefile:
	Don't try to build the boehm_gc, browser, or trace directories
	in grade java.

compiler/Mmakefile:
profiler/Mmakefile:
deep_profiler/Mmakefile:
	Avoid dependencies on *.$A files in grade java.
2003-12-09 14:57:57 +00:00
Simon Taylor
9d14ec50e5 Add *.mih.
Estimated hours taken: 0.1
Branches: main

*/.cvsignore:
	Add *.mih.
2003-05-21 15:31:21 +00:00
Fergus Henderson
e132bebac7 Add `ils' target, for use by tools/bootcheck.
Estimated hours taken: 1
Branches: main

analysis/Mmakefile:
compiler/Mmakefile:
browser/Mmakefile:
profiler/Mmakefile:
	Add `ils' target, for use by tools/bootcheck.

library/Mmakefile:
	Add a missing dependency to ensure that we build all of the
	`.int*' files for the `il' grade (it was forgetting to build
	`library.int3').
	Also, add a target to build the library as an executable,
	so that you can run PEverify on it (PEverify doesn't
	work properly on multi-file assemblies unless they
	are executables).
2003-02-19 06:31:22 +00:00
Fergus Henderson
a18332a294 Various fixes for the .NET back-end.
Estimated hours taken: 3
Branches: main

Various fixes for the .NET back-end.

compiler/Mmakefile:
	For IL grades, use editbin to set the stack size to 100M,
	since the default (1M) is too small.
	Also, don't try to build mlds_to_gcc in IL grades -- gcc.m won't
	compile, because the IL grades don't support the C interface.

library/Mmakefile:
	Add some missing dependencies.

profiler/Mmakefile:
deep_profiler/Mmakefile:
	Conditionalize some dependencies that were bogus for IL grades.

library/.cvsignore:
compiler/.cvsignore:
profiler/.cvsignore:
deep_profiler/.cvsignore:
analysis/.cvsignore:
browser/.cvsignore:
samples/.cvsignore:
	Various minor updates to ignore files produced when building in
	IL grades.
2003-02-15 23:59:41 +00:00
Simon Taylor
886d2ae474 Make it easier to use shared libraries on x86 with
Estimated hours taken: 20
Branches: main

Make it easier to use shared libraries on x86 with
`mmc --make'.

There is now a third kind of object file, `.lpic_o'.
These files are compiled with `--pic-reg' but not with
CFLAGS_FOR_PIC, so they can be linked with shared Mercury
libraries.

On x86, executables which are linked with shared Mercury
libraries now depend on $(main_module.lpic_os), not
$(main_module.os).

This doesn't work with Mmake because ml doesn't know
which libraries are Mercury libraries, so it can't
link with the static versions of those libraries if
MERCURY_LINKAGE is set to "static".

configure.in:
bindist/bindist.configure.in:
bindist/bindist.build_vars.in:
	Work out whether `.lpic_o' files are needed.

compiler/modules.m:
	Add `.lpic_o' to the list of grade or architecture
	dependent files.

NEWS:
README.Linux:
compiler/options.m:
doc/user_guide.texi:
	Document MERCURY_LINKAGE, LINKAGE, --linkage,
	--mercury-linkage and -R.

compiler/options_file.m:
compiler/make.program_target.m:
	Handle LINKAGE and MERCURY_LINKAGE variables.

	Allow LIBGRADES, LINKAGE and MERCURY_LINKAGE to be target-specific.

scripts/mmc.in:
	Set up the default linkage using the MERCURY_LINKAGE
	variable.

compiler/compile_target_code.m:
	Build `.lpic_o' files.

	Work out which type of object files to link with.

	When linking statically with Mercury libraries,
	find the absolute pathname for the `.a' file
	for each Mercury library, and pass that to ml,
	rather than just using `-lname'.

	Pass `-R' options to ml for each `-R' option to mmc.

compiler/make.module_target.m:
compiler/make.program_target.m:
compiler/mercury_compile.m:
	Specify which type of object files to build.

compiler/make.program_target.m:
compiler/make.module_target.m:
	Make sure all generated object files are cleaned up.

compiler/prog_io.m:
	Add a better message for files which can't be found.

compiler/make.util.m:
	Add `.lpic_o' to the list of extensions.

compiler/Mmakefile:
profiler/Mmakefile:
deep_profiler/Mmakefile:
	Pass `--linkage shared' to mmc (`--shared' is in MLFLAGS).

tests/Mmakefile:
tests/mmc_make/Mmakefile:
tests/mmc_make/Mercury.options:
tests/mmc_make/complex_test.{m,exp}:
tests/mmc_make/hello.{m,exp}:
	Test `mmc --make'.

tests/lib/complex*.m:
	The complex numbers library from the extras distribution,
	for use in the mmc_make tests.
2003-01-23 00:24:20 +00:00
Simon Taylor
4b14085c72 A first implementation of the inter-module analysis framwork.
Estimated hours taken: 80
Branches: main

A first implementation of the inter-module analysis framwork.
Currently only unused argument analysis is supported.

The current inter-module analysis scheme using `.trans_opt' files
has some major limitations. The compilation dependencies introduced
by `.trans_opt' files are too complicated for Mmake without major
limitations on which modules can use the contents of which `.trans_opt'
files. Also, the `.trans_opt' file system only computes greatest fixpoints,
which is often too weak to find opportunities for optimization.
A better solution is to provide a library which manually handles
the dependencies introduced by inter-module analysis, and can deal with
the complications introduced by cyclic module dependencies.

TODO:
- support other analyses, e.g. termination, type specialization
- dependency tracking and invalidation after source modifications
- garbage collection of unused versions
- least fixpoint analyses

analysis/Mmakefile:
analysis/mer_analysis.m:
analysis/analysis.m:
analysis/analysis.file.m:
	The analysis library.

analysis/README:
	Description and design documentation.

Mmake.workspace:
Mmakefile:
compiler/Mmakefile:
tools/bootcheck:
	Link the analysis library into mercury_compile.

compiler/hlds_module.m:
	Store analysis information in the module_info.

compiler/options.m:
doc/user_guide.texi:
	Add an option `--intermodule-analysis'.

compiler/mercury_compile.m:
	Call the analysis library to write the gathered
	information at the end of a compilation.

compiler/unused_args.m:
	Call the analysis library to retrieve information
	about imported procedures. This replaces code which
	used the `.opt' files.

	Change the names created for unused arguments procedures
	to include the arguments removed, rather than a sequence
	number. I think Zoltan is working on a change to name
	mangling, so I haven't updated the demangler.

compiler/prog_util.m:
	Generate the new predicate names for unused_args.m.

library/std_util.m:
	Add a polymorphic version of unit, which is useful
	for binding type variables.

compiler/modules.m:
scripts/Mmake.vars.in:
	Clean up files created by the analysis framework
	in `mmake realclean'.

util/mdemangle.c:
profiler/demangle.m:
	Document the change in the name mangling of procedures with
	unused arguments.

configure.in:
	Check for state variables and fixes for some typeclass bugs.

tests/warnings/Mmakefile:
tests/warnings/unused_args_analysis.{m,exp}:
	Test case.
2003-01-02 06:54:03 +00:00
Fergus Henderson
5c169aa367 Update copyright dates in output messages.
Estimated hours taken: 0.25
Branches: main

compiler/handle_options.m:
profiler/mercury_profile.m:
trace/mercury_trace_internal.c:
	Update copyright dates in output messages.
2002-09-08 10:23:27 +00:00
Fergus Henderson
672995c903 Add support for demangling code produced by the MLDS back-end.
Estimated hours taken: 16
Branches: main

util/mdemangle.c:
profiler/demangle.m:
	Add support for demangling code produced by the MLDS back-end.
	XXX util/mdemangle.c it doesn't handle internal labels yet

tests/misc_tests/Mmakefile:
tests/misc_tests/mdemangle_test_hl.inp:
tests/misc_tests/mdemangle_test_hl.exp:
	Add a test case.
	The test is not enabled, since we don't yet pass it;
	demangling works OK for many cases, but fails
	for cases involving internal labels.
2002-09-05 11:37:54 +00:00
Mark Brown
da7f3f340c Update.
Estimated hours taken: 0
Branches: main

profiler/.cvsignore:
	Update.
2002-08-29 04:42:14 +00:00
Fergus Henderson
69cd17b866 Delete an bogus call to io__told.
Estimated hours taken: 0.25
Branches: main

profiler/mercury_profile.m:
	Delete an bogus call to io__told.
	This was resulting an exception since stayl's 2002/07/02 change
	to library/io.m which trapped attempts to close stdout.
2002-08-22 07:58:34 +00:00
Simon Taylor
9406f99f9d Allow tools/bootcheck to be run using `mmake --use-mmc-make'.
Estimated hours taken: 5
Branches: main

Allow tools/bootcheck to be run using `mmake --use-mmc-make'.
The tests don't work yet.

compiler/make.m:
compiler/make.module_target.m:
	Handle targets such as `<module>.cs' and `<module>.ints',
	which are used when building stage 3.

Mmake.common.in:
*/Mmakefile:
*/Mercury.options:
	Add Mercury.options files to pass module-specific flags to
	`mmc --make'.

	Avoid triggering the .DEFAULT rule introduced with `--use-mmc-make'
	for optional files like Mmake.params.

compiler/modules.m:
	Build the interface files when building a library in IL grades,
	for consistency with C grades.

library/Mmakefile:
	Improve performance by removing the dependency on the interface
	files when building the library. The files are now always built
	by the libmer_std target.

	Pass the command to build libmer_std.init to `mmc --make'.

tools/bootcheck:
	Add an option `--use-mmc-make'.

	Copy the Mercury.options files into the stage2 and stage3 directories.

scripts/Mmake.rules:
	Don't include the rules for `.dep' files with `--use-mmc-make'.

	Include the rule for `--convert-to-mercury' even with `--use-mmc-make'.

compiler/Mmakefile:
tools/bootcheck:
tools/binary_step:
	`mmc --make' doesn't handle `<module>_init.c' targets, so
	don't make the `cs' target depend on `top_level_init.c'.
	As far as I can tell, that dependency is only present so
	that the stage2 and stage3 compilers have the same set of
	C files. bootcheck and binary_step now only compare `.c'
	files which are present in the stage3 directory.
2002-06-22 19:16:15 +00:00
Simon Taylor
5d693f5a1c Factor out the common Mmake code to set up the mmc, mgnuc
Estimated hours taken: 8
Branches: main

Factor out the common Mmake code to set up the mmc, mgnuc
and ml flags when building the Mercury compiler and libraries.
Use options, not environment variables. This will make it simpler
to use `mmc --make' to compile the compiler.

Mmake.workspace:
	Similar to tools/lmc. Sets up Mmake variables to
	use the library files in a workspace rather than
	an installed library.

configure.in:
	Check for the `--no-mercury-stdlib-dir' mmc option.
	Bootstrap CVS tag: bootstrap_20020429_stdlib_dir

Mmake.common.in:
*/Mmakefile:
	Move common code into Mmake.workspace.

browser/Mmakefile:
library/Mmakefile:
	Avoid invoking the linker explicitly when creating
	libraries of Mercury code. That won't work well
	with `mmc --make'.

tools/bootcheck:
tests/Mmake.common:
	Use Mmake.workspace instead of setting up environment
	variables in bootcheck.

scripts/Mmake.vars.in:
	mmc compiles split C files to object code itself,
	so pass `--cflags "$(ALL_CFLAGS)"' to mmc when
	compiling with `--split-c-files'.

browser/interactive_query.m:
	Use `mmc --make' when compiling the query. This is needed
	to make tests/debugger/interactive_query.m work when linking
	against a workspace using options rather than environment
	variables.  This also fixes a bug -- mmc options were being
	passed to ml.

	Clean up after the query.

tests/debugger/Mmakefile:
tests/debugger/interactive.inp:
tests/debugger/interactive.inp.subdirs:
tests/debugger/interactive.inp.nosubdirs:
tests/debugger/interactive.exp:
tests/debugger/interactive.exp2:
	Generate the input file to this test so that MCFLAGS
	and MC_MAKE_FLAGS (from Mmake.workspace) are used when
	compiling queries.

	tests/debugger/Mmakefile now sets SHELL to /usr/local/bash
	to allow the use of $(...) style command substitution
	(`...` style command substitution can't be nested).

tests/warnings/Mmakefile:
tests/dppd/Mmakefile:
	Include tests/Mmake.common.

tools/*:
scripts/c2init.in:
scripts/ml.in:
	Update the lists of files containing the library names.
2002-04-29 08:22:08 +00:00
Simon Taylor
5544aed7ff Change the list constructor from ./2' to [|]/2'. `./2' will
Estimated hours taken: 3
Branches: main

Change the list constructor from `./2' to `[|]/2'. `./2' will
eventually become the module qualification operator.

library/parser.m:
library/io.m:
library/sparse_bitset.m:
library/std_util.m:
library/term_io.m:
compiler/mercury_to_mercury.m:
compiler/prog_io_dcg.m:
compiler/prog_io_goal.m:
compiler/prog_io_pragma.m:
compiler/prog_io_typeclass.m:
compiler/prog_io_util.m:
browser/interactive_query.m:
extras/moose/grammar.m:
extras/moose/moose.m:
extras/morphine/source/generate_call_site_cov.m:
extras/xml/xml.encoding.m:
samples/muz/higher_order.m:
tests/debugger/declarative/app.m:
tests/dppd/transpose_impl.m:
tests/hard_coded/ground_dd.m:
tests/hard_coded/split_c_files.m:
	Change all references to `./2' to use `[|]/2' instead.

compiler/typecheck.m:
	Handle `./2' as a special case in `report_error_undef_cons'.

	Warn about module list not being imported if `[|]/2' is undefined.

compiler/llds_out.m:
util/mdemangle.c:
profiler/demangle.m:
	Add name conversions for `[|]' (f_cons) and `[]' (f_nil).

NEWS:
doc/reference_manual.texi:
w3/tutorial/lists-n-things.m4:
	Document the changes.

tests/debugger/{,declarative}/*.exp*:
	Update test case results. For some tests the output changed
	because they output lists in the non-pretty format. For others,
	the output changed because the alphabetical ordering of the
	constructors of type `list/1' changed, so the numbering of
	the switch branches in the goal paths changed.
2001-09-25 09:37:12 +00:00
Peter Ross
c4c099109a Update .cvsignore files.
Estimated hours taken: 0.1
Branches: main

Update .cvsignore files.
2001-07-18 08:26:23 +00:00
Peter Ross
8c013f2dc2 Add .nocopyright file.
Estimated hours taken: 0.1
Branches: main

Add .nocopyright file.
2001-07-18 08:26:00 +00:00
Simon Taylor
aa9ae32225 Improvements for higher-order specialization.
Estimated hours taken: 25
Branches: main

Improvements for higher-order specialization.

WARNING: This changes the order and number of extra arguments
added to specialized versions, including the type-specialized
procedures in the library. Recompile everything.

compiler/higher_order.m:
	Improve the termination check on specialization of recursive
	calls to allow parser combinator programs such as extras/xml
	to be specialized fully. The old check just stopped on any
	recursive specialization.

	Construct constant higher-order and type-info arguments in the goal
	for the specialized version, and remove them from the argument list.
	This increases the chance that terms in the specialized version
	which contain the constant terms will also be constant.

	Attempt to match specialized versions occurring in higher-order
	predicate constants.

	Use record syntax throughout the code.

	Add a version number to the names for type specialized versions
	so that instead of segmentation faults or other program errors
	users get link errors when the argument convention for specialized
	versions changes.

compiler/options.m:
	Add an option `--higher-order-arg-limit' (default 10)
	to control the size of the higher-order arguments for
	which specialization is allowed. Without this,
	extras/xml/xml.parse.chars.m takes too much time
	and memory to compile.

doc/user_guide.texi:
	Document the new option.

tests/hard_coded/Mmakefile:
tests/hard_coded/type_spec_ho_term.m:
tests/hard_coded/type_spec_ho_term.exp:
	Test case.

profiler/demangle.m:
util/mdemangle.c:
tests/misc_tests/mdemangle_test.{inp,exp}:
	Update the documentation and test cases for the symbols
	produced by type specialization.
2001-07-06 14:14:12 +00:00
Fergus Henderson
676d2f260f Fix a bug that broke profiling at `-O5':
Estimated hours taken: 2
Branches: main

profiler/demangle.m:
util/mdemangle.c:
	Fix a bug that broke profiling at `-O5':
	include the __ho<n> sequence number or the __ua<n> mode number
	when demangling procedures created by higher-order specialization
	or unused argument elimination (respectively).
	This avoids a problem where we were demangling distinct symbols
	onto the same mangled name.

tests/misc_tests/mdemangle_test.inp:
tests/misc_tests/mdemangle_test.exp:
	Update to reflect the new demangling algorithm.
2001-06-25 00:58:57 +00:00
Zoltan Somogyi
04e614485d Implement deep profiling; merge the changes on the deep2 branch back
Estimated hours taken: 500
Branches: main

Implement deep profiling; merge the changes on the deep2 branch back
onto the trunk.

The main documentation on the general architecture of the deep profiler
is the deep profiling paper.

doc/user_guide.texi:
	Document how to use the deep profiler.

deep_profiler:
deep_profiler/Mmakefile:
	A new directory holding the deep profiler and its mmakefile.

Mmakefile:
	Add targets for the new directory.

	Add support for removing inappropriate files from directories.

deep_profiler/interface.m:
	The deep profiler consists of two programs: mdprof_cgi.m, which acts
	as a CGI "script", and mdprof_server.m, which implements the server
	process that the CGI script talks to. Interface.m defines the
	interface between them.

script/mdprof.in:
	A shell script template. ../configure uses it to generate mdprof,
	which is a wrapper around mdprof_cgi that tells it how to find
	mdprof_server.

deep_profiler/mdprof_cgi.m:
	The CGI "script" program.

deep_profiler/mdprof_server.m:
	The top level predicates of the server.

deep_profiler/profile.m:
	The main data structures of the server and their operations.

deep_profiler/read_profile.m:
	Code for reading in profiling data files.

deep_profiler/startup.m:
	Code for post-processing the information in profiling data files,
	propagating costs from procedures to their ancestors and performing
	various kinds of summaries.

deep_profiler/server.m:
	Code for responding to requests from the CGI script.

deep_profiler/cliques.m:
	Code to find cliques in graphs.

deep_profiler/array_util.m:
deep_profiler/util.m:
	Utility predicates.

deep_profiler/dense_bitset.m:
	An implementation of (part of) the set ADT with dense bit vectors.

deep_profiler/measurements.m:
	Operations on profiling measurements.

deep_profiler/timeout.m:
	An implementation of a timeout facility.

deep_profiler/conf.m:
	Functions that depend on autoconfigured settings.

configure.in:
	Find out what command to use to find the name of the local host.

	Install deep profiling versions of the standard library along with the
	other profiling versions.

runtime/mercury_conf.h.in:
	Add some macros for deep_profiler/conf.m to use.

library/profiling_builtin.m:
runtime/mercury_deep_call_port_body.h:
runtime/mercury_deep_leave_port_body.h:
runtime/mercury_deep_redo_port_body.h:
	A new library module that implements deep profiling primitives.
	Some of these primitives have many versions, whose common code is
	factor is factored out in three new include files in the runtime.

compiler/deep_profiling.m:
	New module to perform the program transformations described in the
	paper.

compiler/notes/compiler_design.html:
	Document the new compiler module.

compiler/mercury_compiler.m:
	Invoke the new module in deep profiling grades. Allow global static
	data to be generated by deep_profiling.m.

compiler/options.m:
	Add options to turn on deep profiling and (for benchmarking purposes)
	control its implementation.

	Add an optiooption disable tailcall optimization in the LLDS backend,
	to help benchmarking deep profiling.

compiler/jumpopt.m:
compiler/optimize.m:
	Obey the option to disable tailcalls.

compiler/handle_options.m:
	Handle the implications of deep profiling.

compiler/modules.m:
	In deep profiling grades, automatically import profiling_builtin.m.

compiler/prog_util.m:
doc/Makefile:
library/library.m:
	Handle the new builtin module.

compiler/export.m:
	In deep profiling grades, wrap deep profiling code around exported
	procedures to handle the "unscheduled call" aspects of callbacks to
	Mercury from the foreign language.

compiler/higher_order.m:
profiler/demangle.m:
util/demangle.c:
	When creating a name for a higher-order-specialized predicate, include
	the mode number in the name.

compiler/add_trail_ops.m:
compiler/type_util.m:
	Move c_pointer_type from add_trail_ops to type_util, so it can also be
	used by deep_profiling.m.

compiler/hlds_goal.m:
	Add a new goal feature that marks a tail call, for use by
	deep_profiling.m.

compiler/hlds_pred.m:
	Add a new field to proc_info structures for use by deep_profiling.m.

	Add a mechanism for getting proc_ids for procedure clones.

	Remove next_proc_id, an obsolete and unused predicate.

compiler/hlds_data.m:
	Add a new cons_id to refer to the proc_static structure of a procedure.

compiler/bytecode_gen.m:
compiler/code_util.m:
compiler/dependency_graph.m:
compiler/hlds_out.m:
compiler/mercury_to_mercury.m:
compiler/ml_unify_gen.m:
compiler/opt_debug.m:
compiler/prog_rep.m:
compiler/rl_exprn.m:
compiler/switch_util.m:
compiler/unify_gen.m:
	Trivial changes to handle the new cons_id, goal feature and/or
	proc_info argument.

compiler/rtti.m:
	Add a utility predicate for extracting pred_id and proc_id from an
	rtti_proc_label, for use by hlds_out.m

compiler/layout.m:
compiler/layout_out.m:
compiler/llds.m:
compiler/llds_common.m:
	Add support for proc_static and call_site_static structures.

compiler/layout_out.m:
compiler/llds_out.m:
	Add code for the output of proc_static structures.

compiler/code_util.m:
	Make code_util__make_proc_label_from_rtti a function, and export it.

util/mkinit.c:
compiler/llds_out.m:
compiler/layout.m:
compiler/modules.m:
	Add support for a fourth per-module C function, for writing out
	proc_static structures (and the call_site_static structures they
	contains).

	Since proc_static structures can be referred to from LLDS code (and not
	just from other static structures and compiler-generated C code),
	reorganize the declarations of static structures slightly.

	Change the schema for the name of the first per-module C function
	slightly, to make it the addition of the fourth function easier.
	The scheme now is:

		mercury__<modulename>__init
		mercury__<modulename>__init_type_tables
		mercury__<modulename>__init_debugger
		mercury__<modulename>__write_out_proc_statics

	Improve formatting of the generated C code.

library/*.m:
runtime/mercury.c:
runtime/mercury_context.c:
runtime/mercury_engine.c:
runtime/mercury_ho_call.c:
runtime/mercury_tabling.c:
runtime/mercury_trace_base.c:
runtime/mercury_wrapper.c:
trace/mercrury_trace.[ch]:
trace/mercrury_trace_declarative.c:
trace/mercrury_trace_external.c:
trace/mercrury_trace_internal.c:
	Conform to the new scheme for initialization functions for hand-written
	modules.

compiler/mercury_compile.m:
library/benchmarking.m:
runtime/mercury_conf_param.h:
runtime/mercury.h:
runtime/mercury_engine.c:
runtime/mercury_goto.c:
runtime/mercury_grade.h:
runtime/mercury_ho_call.c:
runtime/mercury_label.[ch]:
runtime/mercury_prof.[ch]:
	Add an MR_MPROF_ prefix in front of the C macros used to control the
	old profiler.

compiler/handle_options.m:
runtime/mercury_grade.h:
scripts/canonical_grade.sh-subr:
scripts/init_grade_options.sh-subr:
scripts/parse_grade_options.sh-subr:
	Make deep profiling completely separate from the old profiling system,
	by making the deep profiling grade independent of MR_MPROF_PROFILE_TIME
	and the compiler option --profile-time.

library/array.m:
library/builtin.m:
library/std_util.m:
runtime/mercury_hand_unify_body.h:
runtime/mercury_hand_compare_body.h:
	In deep profiling grades, wrap the deep profiling call, exit, fail
	and redo codes around the bodies of hand-written unification
	and comparison procedures.

	Make the reporting of array bounds violations switchable between
	making them fatal errors, as we currently, and reporting them by
	throwing an exception. Throwing an exception makes debugging code
	using arrays easier, but since exceptions aren't (yet) propagated
	across engine boundaries, we keep the old behaviour as the default;
	the new behaviour is for implementors.

runtime/mercury_deep_profiling_hand.h:
	New file that defines macros for use in Mercury predicates whose
	definition is in hand-written C code.

library/exception.m:
runtime/mercury_exception_catch_body.h:
runtime/mercury_stacks.h:
	In deep profiling grades, wrap the deep profiling call, exit, fail
	and redo codes around the bodies of the various modes of builtin_catch.

	Provide a function that C code can use to throw exceptions.

library/benchmarking.m:
library/exception.m:
library/gc.m:
library/std_util.m:
runtime/mercury_context.[ch]:
runtime/mercury_engine.[ch]:
runtime/mercury_debug.c:
runtime/mercury_deep_copy.c:
runtime/mercury_overflow.h:
runtime/mercury_regs.h:
runtime/mercury_stacks.h:
runtime/mercury_thread.c:
runtime/mercury_wrapper.c:
	Add prefixes to the names of the fields in the engine and context
	structures, to make code using them easier to understand and modify.

runtime/mercury_deep_profiling.[ch]:
	New module containing support functions for deep profiling and
	functions for writing out a deep profiling data file at the end of
	execution.

runtime/mercury_debug.[ch]:
	Add support for debugging deep profiling.

	Add support for watching the value at a given address.

	Make the buffered/unbuffered nature of debugging output controllable
	via the -du option.

	Print register contents only if -dr is specified.

runtime/mercury_goto.h:
runtime/mercury_std.h:
	Use the macros in mercury_std.h instead of defining local variants.

runtime/mercury_goto.h:
runtime/mercury_stack_layout.h:
runtime/mercury_stack_trace.c:
runtime/mercury_tabling.c:
trace/mercury_trace.c:
trace/mercury_trace_declarative.c:
trace/mercury_trace_external.c:
trace/mercury_trace_vars.c:
	Standardize some of the macro names with those used in the debugger
	paper.

runtime/mercury_heap.h:
	Add support for memory profiling with the deep profiler.

runtime/mercury_prof.[ch]:
runtime/mercury_prof_time.[ch]:
	Move the functionality that both the old profiler and the deep profiler
	need into the new module mercury_prof_time. Leave mercury_prof
	containing stuff that is only relevant to the old profiler.

runtime/mercury_prof.[ch]:
runtime/mercury_strerror.[ch]:
	Move the definition of strerror from mercury_prof to its own file.

runtime/mercury_wrapper.[ch]:
	Add support for deep profiling.

	Add suppory for controlling whether debugging output is buffered or
	not.

	Add support for watching the value at a given address.

runtime/Mmakefile:
	Mention all the added files.

scripts/mgnuc.in:
	Add an option for turning on deep profiling.

	Add options for controlling the details of deep profiling. These
	are not documented because they are intended only for benchmarking
	the deep profiler itself, for the paper; they are not for general use.

tools/bootcheck:
	Compile the deep_profiler directory as well as the other directories
	containing Mercury code.

	Turn off the creation of deep profiling data files during bootcheck,
	since all but one of these in each directory will be overwritten
	anyway.

	Add support for turning on --keep-objs by default in a workspace.

tools/speedtest:
	Preserve any deep profiling data files created by the tests.

trace/mercury_trace.c:
	Trap attempts to perform retries in deep profiling grades, since they
	would lead to core dumps otherwise.

util/Mmakefile:
	Avoid compile-time warnings when compiling getopt.

tests/*/Mmakefile:
tests/*/*/Mmakefile:
	In deep profiling grades, switch off the tests that test features
	that don't work with deep profiling, either by design or because
	the combination hasn't been implemented yet.
2001-05-31 06:00:27 +00:00
Fergus Henderson
29850ce29c Fix a bug that showed up with the new compiler:
Estimated hours taken: 0.1

profiler/globals.m:
	Fix a bug that showed up with the new compiler:
	import `io' in the interface section.
2001-03-01 16:55:19 +00:00
Fergus Henderson
cf99344e4a Fix SourceForge bug report #129892, "profiler map__lookup failed
Estimated hours taken: 3

Fix SourceForge bug report #129892, "profiler map__lookup failed
in grade hlc.gc.memprof".

The remaining problem that was still causing failures for this
test case was that demangling isn't implemented for the MLDS
back-end.  When symbols that the MLDS back end generates are
fed through the demangler, it demangles some distinct symbols
to the same name.  This causes the profiler to abort, because
it assumes that each distinct symbol demangles to a different
name.

The fix is to turn off demangling when profiling programs
built in MLDS grades.

NEWS:
	Mention that we haven't implemented symbol demangling
	in the profiler for the MLDS back-end yet.

doc/user_guide.texi:
	Document that for profiling of programs built with
	`--high-level-code' you need to use the `--no-demangle'
	option.

tools/test_mercury:
	When testing the profiler in hl* grades,
	pass `--no-demangle' to mprof, and compare with
	*.mprof-exp2 rather than *.mprof-exp.

tests/benchmarks/poly.mprof-exp2:
	New file.  Contains alternative expected output for this test
	case, to match what is output for grade hlc.gc.memprof (at -O2).

profiler/options.m:
	The `--(no-)demangle' option is not a filename option,
	so document it under the "Profiler options" section,
	rather than the "Filename options" section.
	Also fix a typo (s/Ouput/Output/) and a thinko
	(s/unmangled/mangled/) in the description of that option.
2001-02-06 07:11:48 +00:00