Commit Graph

74 Commits

Author SHA1 Message Date
Zoltan Somogyi
09141817ba Fergus's recent change to the handling of some builtins broke the tracing
Estimated hours taken: 20

Fergus's recent change to the handling of some builtins broke the tracing
of those builtins. The following changes are a fix for this.

compiler/polymorphism.m:
	Export the predicate that checks whether a predicate is a builtin
	that lacks the usually necessary typeinfos.

	Comment out a misleading and in any case not very useful progress
	message.

compiler/liveness.m:
	Turn off type_info liveness for builtins without typeinfos.
	Since these builtins establish no gc points and shouldn't be
	execution traced, this is OK.

	Make type_info liveness part of live_info, since it can now be
	incorrect to look up the value of the option. (This may yield
	a speedup.)

compiler/live_vars.m:
compiler/store_alloc.m:
	Pass the pred_id to initial_liveness to liveness.m can do the test.

compiler/passes_aux.m:
	Add a new traversal type that passes along the pred_id.

compiler/mercury_compile.m:
	Turn off execution tracing for the modules builtin.m and
	private_builtin.m. The latter contains the interface predicates
	for the builtins without typeinfos. Since the interface predicates
	also lack the typeinfos, the compiler would get an internal abort
	if we left execution tracing on.

	In any case, these two modules contain stuff that users should
	consider language builtins, which means they should not be execution
	traced (they can still be stack traced in the right grade).

	Use the new traversal type for the modules that now need the pred_id.

compiler/globals.m:
	Allow the trace level to be set from outside, in this case
	mercury_compile.m.

The next batch of changes have to do with adding a stack dump command
to the debugger. Since debugging is possible even in non-debug grades,
this in turn requires allowing stack tracing to work in non-debug grades,
on programs in which only some modules are compiled with execution
(and hence stack) tracing.

compiler/llds_out.m:
compiler/mercury_compile.m:
runtime/mercury_conf_param.h:
	Llds_out used to output "#include <mercury_imp.h>" as the first
	substantive thing in the generated C file. The set of #define
	parameters in effect when mercury_imp.h is processed determines
	whether the macros that optionally register stack layouts for label
	actually do so or not. The values of these parameters are derived
	from the grade, which means that with this setup it is not possible
	for a non-debug grade program to register its stack layouts in the
	label table.

	The new version of llds_out looks up the option that says whether
	this module is compiled with execution tracing or not, and if it is,
	it generates a #define MR_STACK_TRACE_THIS_MODULE *before* the #include
	of mercury_imp.h. This causes mercury_conf_param.h, included from
	mercury_imp.h, to define the macros MR_USE_STACK_LAYOUTS and
	and MR_INSERT_LABELS, which in turn cause stack layouts for labels
	in this module to be generated and to be inserted into the label
	table, *without* changing the grade string (this last part is why
	we do not simply define MR_STACK_TRACE).

	Use the same mechanism to #include mercury_trace.h when doing
	execution tracing, since it is simpler than the mechanism we
	used to use (mercury_compile.m including the #include in a list
	of C header file fragments).

compiler/mercury_compile.m:
runtime/mercury_conf_param.h:
	Split the MR_NEED_INITIALIZATION_CODE macro into two parts.
	The first, MR_MAY_NEED_INITIALIZATION, now controls whether
	initialization code makes it into the object file of a module.
	The second, MR_NEED_INITIALIZATION_AT_START, determines whether
	the initialization code is called before main/2.

	When a module is compiled with execution tracing, the macro
	MR_INSERT_LABELS turns on MR_MAY_NEED_INITIALIZATION but not
	MR_NEED_INITIALIZATION_AT_START. The debugger will make sure
	that the initialization code has been called before it tries
	to do a stack dump (which needs the initialization code to have
	been executed, because it needs labels to have been put into the label
	table so that from a return address it can find the layout of the
	proc to which it belongs).

	Define MR_NEED_INITIALIZATION_AT_START if PROFILE_TIME is defined,
	since if PROFILE_TIME is defined mercury_wrapper.c calls init_modules.
	The fact that MR_NEED_INITIALIZATION_CODE didn't used to be defined
	when PROFILE_TIME was defined was, I believe, a bug, which was
	not detected because we do not turn on PROFILE_TIME without also
	turning on PROFILE_CALLS.

runtime/mercury_stack_trace.[ch]:
	Change the way stack dumps are done, to make it possible to
	print stack dumps from the debugger and to use trivial run-length
	encoding on the output (so that 100 consecutive calls to p
	yield the line "p * 100", rather than 100 lines of "p").

	The stack routine now returns an indication of whether the stack dump
	was fully successful, and if not, a description of the reason why not.
	This requires knowing when we have found the end of the stack dump,
	so we provide a global variable, MR_stack_trace_bottom, which
	mercury_wrapper.c will set to global_success, the address main/2
	goes to on success.

	s/multidet/multi/

runtime/mercury_wrapper.c:
	Set MR_stack_trace_bottom to the address of globals_success.
	Use MR_NEED_INITIALIZATION_AT_START to decide whether to call
	do_init_modules.

runtime/mercury_stacks.h:
	Provide variants of detstackvar(n) and framevar(n) that look up sp and
	curfr in an array of saved regs, for use by the debugger.

runtime/mercury_trace_util.c:
	Use the new variants of detstackvar(n) and framevar(n). This fixes
	an old bug on SPARCs.

runtime/mercury_trace_internal.c:
	Completely reorganize the way debugger commands are handled.
	Centralize reading in command lines, and the breaking up of command
	lines into words. The command names are the same as they were,
	but command syntax is now much easier to change.

	Add a new command "d" to dump as much of the stack as the available
	information will allow.

runtime/mercury_goto.h:
	Cosmetic changes to avoid the use of two different conditional
	compilation layout styles.

util/mkinit.c:
	Since we cannot know when we generate the _init.c file whether any
	modules will be compiled with execution tracing and will thus need
	stack tracing, we must now include in the generated _init.c file the
	code to call the initialization functions in all the modules, even if
	MR_NEED_INITIALIZATION_AT_START is not set, since init_modules
	can be called later, from the debugger. (We should be able to
	use the same approach with the accurate collector.)
1998-06-08 08:29:17 +00:00
Fergus Henderson
40cb95e75a Fix a small mistake in my previous change which resulted in some
Estimated hours taken: 0.1

util/mkinit.c:
	Fix a small mistake in my previous change which resulted in some
	compiler warnings.
1998-06-04 11:50:11 +00:00
Fergus Henderson
38ae5fe0c5 Fix a bug which caused link errors in some grades for some test cases
Estimated hours taken: 1

Fix a bug which caused link errors in some grades for some test cases
where the module name wasn't the same as the file name, and which
probably would have caused runtime errors in some grades for test
cases using nested modules.

compiler/modules.m:
	Call $(C2INIT) with $(foo.cs) instead of $(foo.ms).
	This is necessary now that a single .m file can get compiled
	to multiple .c files, if it contains nested modules,
	or to a .c file whose name reflects the module name rather
	than the source file name.

util/mkinit.c:
scripts/c2init.in:
	For efficiency, change c2init and mkinit so that when c2init's
	arguments are `.c' files, it computes the init function based
	on the filename (like it used to do with `.m' files), rather
	than by reading the file contents and searching for "** INIT"
	comments.  Add a new option `-x' (`--extra-inits') which keeps
	the old behaviour.

compiler/modules.m:
scripts/Mmake.rules:
	Instead of deleting the `_init.c' file every time we recreate
	the `.dep' file, just tell make that the `_init.c' file depends on
	the `.dep' file, so that make will remake it if the `.dep' file
	changes.  (I don't know why I didn't do it that way in the
	first place.)
1998-05-30 13:34:17 +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
67d8308260 Same as previous message. 1998-04-08 11:36:13 +00:00
Fergus Henderson
a16424f6a1 Add support to the Mercury tracer for interacting with an external
Estimated hours taken: 24

Add support to the Mercury tracer for interacting with an external
Opium-style debugger via a socket.

TODO: currently there is no way for the debugger to specify
constraints on the arguments for a `forward_move' query.
The current code for doing that doesn't work.
(However, the reporting of arguments to the debugger
for an `output_current' query works fine.)

runtime/mercury_trace.c:
	Add code to MR_trace() to open a socket connection to
	an external debugger, and to process requests from that
	debugger, and send responses back.

runtime/mercury_trace.h:
runtime/mercury_wrapper.c:
	Call MR_trace_end() from mercury_runtime_terminate() so that
	the external debugger gets notified when the program does
	a (normal) exit.

runtime/mercury_stack_layout.h:
	Fix a bug where the structures here did not match
	the output produced by compiler/stack_layout.m.

library/debugger_interface.m:
	New file.  Declares the Mercury types used for the debugger
	socket interface and defines support routines used by
	runtime/mercury_trace.c.

library/io.m:
runtime/mercury_types.h:
	Move the definition of MercuryFile from library/io.m to
	runtime/mercury_types.h, for use by runtime/mercury_trace.c.

library/io.m:
	When printing out values of type `c_pointer', print out
	the "<<c_pointer>>" string in single quotes, to ensure
	that it has valid syntax for a Prolog or Mercury term.
	This is necessary because otherwise c_pointers in procedure
	arguments could lead to the Mercury process sending a
	syntactically invalid term down the socket to the debugger,
	which would then be unable to parse it.

library/library.m:
	Add reference to debugger_interface.m, so that it gets
	include in libmercury.a.

doc/Mmakefile:
	Make sure that the library/debugger_interface.m does *not*
	get included in the Mercury library reference manual.

runtime/mercury_wrapper.h:
runtime/mercury_wrapper.c:
runtime/mercury_init.h:
util/mkinit.c:
	Declare, define, and initialize pointers to the C functions
	exported by library/debugger_interface.m.
	(This is to avoid having a circular dependency where the
	runtime depends on the library.)

compiler/notes/authors.html:
	Add Erwan Jahier.
1998-03-11 22:07:38 +00:00
Tyson Dowd
f58ee880df Add support for stack dumps, do a stack dump from error/1.
Estimated hours taken: 12

Add support for stack dumps, do a stack dump from error/1.


compiler/Mmakefile:
library/Mmakefile:
profiler/Mmakefile:
runtime/Mmakefile:
	Insert EXTRA_MGNUCFLAGS before CFLAGS or EXTRA_CFLAGS
	becasue mgnuc stops processing its options when it
	encounters a non-mgnuc option.

library/require.m:
	Call MR_dump_stack if error is called.

runtime/Mmakefile:
runtime/mercury_imp.h:
	Add #includes of new files.

runtime/mercury_type_info.h:
	Remove conditional definition of MR_STATIC_CODE_ADDRESSES
	(moved into mercury_conf.h.in).

runtime/mercury_accurate_gc.h:
	Remove stack_layout stuff, leave this file for accurate
	GC specific definitions.

runtime/mercury_conf.h.in:
	Add conditional definitions of MR_INSERT_LABELS,
	MR_USE_STACK_LAYOUTS, MR_NEED_INITIALIZATION_CODE and
	MR_STATIC_CODE_ADDRESSES, depending on various other options.

runtime/mercury_goto.h:
	Insert labels into label table if MR_INSERT_LABELS is defined,
	rather than NATIVE_GC.

util/mkinit.c:
	Initialize if MR_NEED_INITIALIZATION_CODE is defined, rather than
	NATIVE_GC.

runtime/mercury_stack_layout.h:
	All the old stack layout definitions from mercury_accurate_gc.h.
	Add code for MR_DETISM_DET_CODE_MODEL.

runtime/mercury_stack_trace.c:
runtime/mercury_stack_trace.h:
	Implement MR_dump_stack which just provides a dump of the stack
	as far as possible.
	Set MR_INSERT_LABELS and MR_USE_STACK_LAYOUTS if MR_STACK_TRACE
	is set.

runtime/mercury_grade.h:
	Add _strce if stack tracing is enabled in the grade.  This
	might not be a permanent change.

runtime/mercury_ho_call.c:
	Remove unused label declarations.

scripts/mgnuc.in:
	Add --stack-trace and --no-stack-trace options.
	Consolidate some duplicate code.
1998-03-11 06:01:17 +00:00
Fergus Henderson
f8fa34d198 Fix a bug where `mkinit' was not mangling nested module names properly.
Estimated hours taken: 1

Fix a bug where `mkinit' was not mangling nested module names properly.
(This bug meant that nested modules didn't work in grades which required
initialization functions, e.g. the profiling grades.)

compiler/llds_out.m:
	Use the mangled module name rather than the mangled file name
	to compute the init function names, because nested module
	names get mangled with the module names separated by `__',
	whereas mangled file names use the ugly `f_<numbers>' ASCII escapes
	to encode names containing `.'.

util/mkinit.c:
	Handle nested module names: convert `.' to `__' when computing
	the init function name from the file name.
	(Note: it is still not using the full name mangling algorithm
	here, so this will still fail if the module name contains special
	characters.)

	Also change the layout of curly braces in a few places,
	to match our C coding guidelines.
1998-03-06 02:30:19 +00:00
Fergus Henderson
11d8161692 Add support for nested modules.
Estimated hours taken: 50

Add support for nested modules.

- module names may themselves be module-qualified
- modules may contain `:- include_module' declarations
  which name sub-modules
- a sub-module has access to all the declarations in the
  parent module (including its implementation section).

This support is not yet complete; see the BUGS and LIMITATIONS below.

LIMITATIONS
- source file names must match module names
	(just as they did previously)
- mmc doesn't allow path names on the command line any more
	(e.g. `mmc --make-int ../library/foo.m').
- import_module declarations must use the fully-qualified module name
- module qualifiers must use the fully-qualified module name
- no support for root-qualified module names
	(e.g. `:parent:child' instead of `parent:child').
- modules may not be physically nested (only logical nesting, via
  `include_module').

BUGS
- doesn't check that the parent module is imported/used before allowing
	import/use of its sub-modules.
- doesn't check that there is an include_module declaration in the
	parent for each module claiming to be a child of that parent
- privacy of private modules is not enforced

-------------------

NEWS:
	Mention that we support nested modules.

library/ops.m:
library/nc_builtin.nl:
library/sp_builtin.nl:
compiler/mercury_to_mercury.m:
	Add `include_module' as a new prefix operator.
	Change the associativity of `:' from xfy to yfx
	(since this made parsing module qualifiers slightly easier).

compiler/prog_data.m:
	Add new `include_module' declaration.
	Change the `module_name' and `module_specifier' types
	from strings to sym_names, so that module names can
	themselves be module qualified.

compiler/modules.m:
	Add predicates module_name_to_file_name/2 and
	file_name_to_module_name/2.
	Lots of changes to handle parent module dependencies,
	to create parent interface (`.int0') files, to read them in,
	to output correct dependencies information for them to the
	`.d' and `.dep' files, etc.
	Rewrite a lot of the code to improve the readability
	(add comments, use subroutines, better variable names).
	Also fix a couple of bugs:
	- generate_dependencies was using the transitive implementation
	  dependencies rather than the transitive interface dependencies
	  to compute the `.int3' dependencies when writing `.d' files
	  (this bug was introduced during crs's changes to support
	  `.trans_opt' files)
	- when creating the `.int' file, it was reading in the
	  interfaces for modules imported in the implementation section,
	  not just those in the interface section.
	  This meant that the compiler missed a lot of errors.

library/graph.m:
library/lexer.m:
library/term.m:
library/term_io.m:
library/varset.m:
compiler/*.m:
	Add `:- import_module' declarations to the interface needed
	by declarations in the interface.  (The previous version
	of the compiler did not detect these missing interface imports,
	due to the above-mentioned bug in modules.m.)

compiler/mercury_compile.m:
compiler/intermod.m:
	Change mercury_compile__maybe_grab_optfiles and
	intermod__grab_optfiles so that they grab the opt files for
	parent modules as well as the ones for imported modules.

compiler/mercury_compile.m:
	Minor changes to handle parent module dependencies.
	(Also improve the wording of the warning about trans-opt
	dependencies.)

compiler/make_hlds.m:
compiler/module_qual.m:
	Ignore `:- include_module' declarations.

compiler/module_qual.m:
	A couple of small changes to handle nested module names.

compiler/prog_out.m:
compiler/prog_util.m:
	Add new predicates string_to_sym_name/3 (prog_util.m) and
	sym_name_to_string/{2,3} (prog_out.m).

compiler/*.m:
	Replace many occurrences of `string' with `module_name'.
	Change code that prints out module names or converts
	them to strings or filenames to handle the fact that
	module names are now sym_names intead of strings.
	Also change a few places (e.g. in intermod.m, hlds_module.m)
	where the code assumed that any qualified symbol was
	fully-qualified.

compiler/prog_io.m:
compiler/prog_io_goal.m:
	Move sym_name_and_args/3, parse_qualified_term/4 and
	parse_qualified_term/5 preds from prog_io_goal.m to prog_io.m,
	since they are very similar to the parse_symbol_name/2 predicate
	already in prog_io.m.  Rewrite these predicates, both
	to improve maintainability, and to handle the newly
	allowed syntax (module-qualified module names).
	Rename parse_qualified_term/5 as `parse_implicit_qualified_term'.

compiler/prog_io.m:
	Rewrite the handling of `:- module' and `:- end_module'
	declarations, so that it can handle nested modules.
	Add code to parse `include_module' declarations.

compiler/prog_util.m:
compiler/*.m:
	Add new predicates mercury_public_builtin_module/1 and
	mercury_private_builtin_module/1 in prog_util.m.
	Change most of the hard-coded occurrences of "mercury_builtin"
	to call mercury_private_builtin_module/1 or
	mercury_public_builtin_module/1 or both.

compiler/llds_out.m:
	Add llds_out__sym_name_mangle/2, for mangling module names.

compiler/special_pred.m:
compiler/mode_util.m:
compiler/clause_to_proc.m:
compiler/prog_io_goal.m:
compiler/lambda.m:
compiler/polymorphism.m:
	Move the predicates in_mode/1, out_mode/1, and uo_mode/1
	from special_pred.m to mode_util.m, and change various
	hard-coded definitions to instead call these predicates.

compiler/polymorphism.m:
	Ensure that the type names `type_info' and `typeclass_info' are
	module-qualified in the generated code.  This avoids a problem
	where the code generated by polymorphism.m was not considered
	type-correct, due to the type `type_info' not matching
	`mercury_builtin:type_info'.

compiler/check_typeclass.m:
	Simplify the code for check_instance_pred and
	get_matching_instance_pred_ids.

compiler/mercury_compile.m:
compiler/modules.m:
	Disallow directory names in command-line arguments.

compiler/options.m:
compiler/handle_options.m:
compiler/mercury_compile.m:
compiler/modules.m:
	Add a `--make-private-interface' option.
	The private interface file `<module>.int0' contains
	all the declarations in the module; it is used for
	compiling sub-modules.

scripts/Mmake.rules:
scripts/Mmake.vars.in:
	Add support for creating `.int0' and `.date0' files
	by invoking mmc with `--make-private-interface'.

doc/user_guide.texi:
	Document `--make-private-interface' and the `.int0'
	and `.date0' file extensions.

doc/reference_manual.texi:
	Document nested modules.

util/mdemangle.c:
profiler/demangle.m:
	Demangle names with multiple module qualifiers.

tests/general/Mmakefile:
tests/general/string_format_test.m:
tests/general/string_format_test.exp:
tests/general/string__format_test.m:
tests/general/string__format_test.exp:
tests/general/.cvsignore:
	Change the `:- module string__format_test' declaration in
	`string__format_test.m' to `:- module string_format_test',
	because with the original declaration the `__' was taken
	as a module qualifier, which lead to an error message.
	Hence rename the file accordingly, to avoid the warning
	about file name not matching module name.

tests/invalid/Mmakefile:
tests/invalid/missing_interface_import.m:
tests/invalid/missing_interface_import.err_exp:
	Regression test to check that the compiler reports
	errors for missing `import_module' in the interface section.

tests/invalid/*.err_exp:
tests/warnings/unused_args_test.exp:
tests/warnings/unused_import.exp:
	Update the expected diagnostics output for the test cases to
	reflect a few minor changes to the warning messages.

tests/hard_coded/Mmakefile:
tests/hard_coded/parent.m:
tests/hard_coded/parent.child.m:
tests/hard_coded/parent.exp:
tests/hard_coded/parent2.m:
tests/hard_coded/parent2.child.m:
tests/hard_coded/parent2.exp:
	Two simple tests case for the use of nested modules with
	separate compilation.
1998-03-03 17:48:14 +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
Tyson Dowd
13fee2b1f8 Add library and runtime support for stack layouts.
Estimated hours taken: 30

Add library and runtime support for stack layouts.

library/array.m:
library/benchmarking.m:
library/mercury_builtin.m:
library/std_util.m:
library/string.m:
runtime/mercury_engine.c:
runtime/mercury_ho_call.c:
runtime/mercury_type_info.c:
	Add MR_MAKE_STACK_LAYOUT_* macros to add basic stack layouts for
	handwritten C code.

runtime/mercury_type_info.c:
	Remove some duplicate label declarations.

runtime/mercury_calls.h:
	Don't use ASM_FIXUP_REGS in calls with NATIVE_GC - we don't
	want (or need) to use it. We define all labels as entry labels
	anyway, so an ASM_FIXUP_REGS is done at each label.

runtime/mercury_label.c:
runtime/mercury_label.h:
runtime/mercury_goto.h:
	Insert references to stack layouts into the label table.
	Use the label table when NATIVE_GC is defined.
	Modify the way labels are declared so they have the necessary
	scope.

runtime/mercury_imp.h:
	Include mercury_accurate_gc.h

runtime/mercury_accurate_gc.h:
	Add some macros to define stack layouts for handwritten
	code, and access various fields of the stack layouts.

util/mkinit.c:
	Add NATIVE_GC to the #ifdef .... that controls the running of
	the initialization code for each module. NATIVE_GC requires the
	label table to be initialized.
	Fix this code so the two instances of this list of #defines are
	replaced by a single string constant. I've been bitten _twice_
	by this double definition, and I refuse to be bitten again.

compiler/stack_layout.m:
	Rename MR_LIVE_LVAL to Mr_Live_Lval in the documentation.
1997-12-03 07:28:15 +00:00
Fergus Henderson
f1510fc5c2 Fix another file renaming induced problem:
Estimated hours taken: 0.25

util/mkinit.c:
util/Mmakefile:
	Fix another file renaming induced problem:
	s/getopt.h/mercury_getopt.h/g
1997-11-24 14:55:44 +00:00
Fergus Henderson
9d12771dfc s/init.h/mercury_init.h/
Estimated hours taken: 0.25

util/mkinit.c:
	s/init.h/mercury_init.h/
1997-11-23 09:23:40 +00:00
Tyson Dowd
f5dad93eec Fix the #includes to use mercury_std.h, not std.h.
Estimated hours taken: 0.02

util/mdemangle.c:
util/mkinit.c:
	Fix the #includes to use mercury_std.h, not std.h.
1997-11-23 07:47:21 +00:00
Tyson Dowd
7ce7d489a2 Cleaned up runtime directory.
Estimated hours taken: 2

Cleaned up runtime directory.

runtime/*.c:
	- Renamed all .c files as mercury_*.c
	  Some have been renamed to make their purpose clearer.
	  	call.mod -> mercury_ho_call.c

runtime/*.h:
	- Moved contents of .h files to mercury_*.h
	- *.h now contain #include mercury_*.h. They be removed later.
	- Updated references to conf.h -> mercury_conf.h

runtime/conf.h.in:
	- Renamed conf.h.in as mercury_conf.h.in.
	  Didn't leave a forwarding header for this one, as conf.h was
	  never part of the repository anyway.

runtime/Mmakefile:
	- Convert lists to one-per-line lists.
	- Add mercury_accurate_gc.h to HDRS.
	- Remove all .mod files
	- Make sure runtime.init uses the ORIG_CS not MOD_CS.
	- Fix the rules for "clean_o" and "clean_mod_c", which used
	  wildcards like "*.o" to remove files.  The one that removed
	  all .c files corresponding with *.mod, instead of using MOD_CS
	  was particularly vicious.
	- Cope with the file renamings.

configure.in:
	- Cope with the file renamings.
1997-11-20 02:04:40 +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
1ee752500e Check whether the system has memmove(). (SunOS 4.x doesn't.)
Estimated hours taken: 0.5

configure.in:
runtime/conf.h.in:
util/mdemangle.c:
	Check whether the system has memmove().  (SunOS 4.x doesn't.)
	If not, use memcpy().
1997-10-02 02:46:10 +00:00
Fergus Henderson
87788d9f14 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 17:56:36 +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
c084bfcc20 Fix some warnings about possibly uninitialized variables.
Estimated hours taken: 0.25

util/mdemangle.c:
	Fix some warnings about possibly uninitialized variables.
1997-09-06 12:53:33 +00:00
Fergus Henderson
d1cc2ddee4 Split up the startup interface so that there are seperate
Estimated hours taken: 8

Split up the startup interface so that there are seperate
initialization and termination functions, rather than just a single
mercury_runtime_main() function which does everything.
Also change things so that the io__state data is stored in global
variables.

runtime/init.h:
util/mkinit.c:
runtime/wrapper.h:
runtime/wrapper.mod:
	Move declarations for stuff defined in wrapper.mod from init.h
	to wrapper.h.  Clean up the remainder of init.h so that it
	is clear which parts are interface and which are just there
	for use by *_init.c.

	Change the automatically-generated *_init.c files
	so that they call mercury_runtime_init(),
	mercury_runtime_main(), and mercury_runtime_terminate(),
	rather than just mercury_runtime_main().
	Define these new two functions in wrapper.mod.

	Delete the library_entry_point; change do_interpreter
	to call program_entry_point directly, rather than via
	library_entry_point.

runtime/engine.h:
runtime/engine.mod:
	Add new function terminate_engine().
	Delete the function start_mercury_engine();
	move the code that used to be there to the end
	of init_engine().

runtime/context.h:
runtime/context.mod:
	Add new function shutdown_processes().
	(The current implementation is just a stub.)
	Add a call to debug_memory() in init_process_context().

runtime/memory.h:
runtime/memory.c:
	Export the debug_memory() function, for use by context.c.

library/io.m:
library/io.nu.nl:
	Change things so that the io__state data is stored in C global
	variables (or, for Prolog, using assert/retract), rather than
	passing around a data structure.  (Actually we still pass the
	data structure around, but it is just a dummy Word that never
	gets used.)

	Delete the old hand-coded io__run predicate, which was
	the library entry point; instead export C functions
	ML_io_init_state() and ML_io_finalize_state().	Move the
	code for handling profiling from io__run to do_interpreter
	in runtime/wrapper.mod.

scripts/c2init.in:
	Change the default entry point from io__run_0_0 to main_2_0
1997-09-05 22:38:58 +00:00
Fergus Henderson
f2df787842 Fix a few things in my recent changes for DLL support.
configure.in:
runtime/conf.h.in:
	Define USE_DLLS in conf.h.

runtime/imp.h:
runtime/init.h:
runtime/memory.c:
runtime/table.c:
util/mkinit.c:
boehm_gc/gc.h:
	Conditionalize things on `#ifdef(USE_DLLS)' rather than on
	`#ifdef(__CYGWIN32__)'.  Testing for specific systems tends
	to lead to code that is difficult to maintain.

util/mkinit.c:
	Fix a bug: it was checking `#if defined(libmer_USE_DLL)', but it
	should have been checking `#if !defined(libmer_DEFINE_DLL)'.
1997-08-28 18:21:48 +00:00
Fergus Henderson
c6af510323 Implement support for DLLs on Windows.
Estimated hours taken: 24

Implement support for DLLs on Windows.
The changes consisted of

1.  Adding `Makefile.DLLs', which is a file I wrote contains
    GNU Make rules for building DLLs.  Making sure that
    the various Mmakefiles include that one.

2.  Making sure we #include the "libfoo_dll.h" header file
    generated by `Makefile.DLLs' before every place that
    references a global variable.

3.  Making sure that code which defines the DLLs is
    compiled with -Dlibfoo_DEFINE_DLL.

5.  Changing various places to explicitly register the data
    segment as a root set with the conservative garbage collector.
    This was necessary to get GC working with DLLs under Windows
    (there doesn't seem to be any way of automatically finding
    the data segments of DLLs under win32).

6.  Changing the way names are mangled to ensure that the assembler
    names always contain a leading underscore, since `dlltool'
    on gnu-win32 requires this.

TODO:
- Document how users can create their own DLLs.
- Add support for that to Mmake.

configure.in:
Mmake.common.in:
	Add USE_DLLS variable.  (Most of the Makefile changes below are
	conditionalized on this variable.)

boehm_gc/Makefile:
	Add dependency $(OBJS) : libgc_dll.h.
	Add `-DGC_DEFINE_DLL' to CFLAGS.
	Include Mmakefile.DLLs.
	Add new targets `dll' and `test_dll'.

boehm_gc/Mmakefile:
	Add stuff to install libgc_dll.h and libgc_globals.h.

boehm_gc/gc.h:
	For __CYGWIN32__, #include "libgc_dll.h".
	This is necessary to handle global variables in DLLs on Windows.
	For __CYGWIN32__, define GC_INIT() to add the
	data segment of the current DLL or executable as
	a new root set.

library/Mmakefile:
	Add stuff needed for building DLLs.

runtime/wrapper.mod:
library/io.m:
	Add call to GC_INIT() to register the root set for
	libmer.dll and libmercury.dll respectively.
	In wrapper.mod, move the call to GC_is_visible
	_after_ the calls to GC_INIT().

runtime/Mmakefile:
	Add stuff needed for building DLLs.

runtime/init.h:
runtime/imp.h:
runtime/dummy.c:
runtime/label.c:
runtime/memory.c:
runtime/table.c:
	For __CYGWIN32__, make sure we #include "libmer_dll.h".
	before defining global variables.
	This is necessary to handle global variables in DLLs
	on Windows.

runtime/goto.h:
util/mdemangle.c:
prof/demangle.m:
	Change the way names are mangled to ensure that the assembler
	names always contain a leading underscore, since `dlltool'
	on gnu-win32 requires this.

util/mkinit.c:
	For __CYGIN32__, when using DLLs, make sure we initialize the
	_impure_ptr of the DLLs that we're using.

library/Mmake:
runtime/Mmake:
	Compile with -Dlibfoo_USE_DLL options.
	Add code to install libfoo_dll.h and libfoo_globals.h.
	Include Mmakefile.DLLs.
1997-08-28 17:52:54 +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
Thomas Conway
2980b59474 Profiling code with lots of lambda goals was painful, because the names
Estimated hours taken: 1.5

Profiling code with lots of lambda goals was painful, because the names
of the predicates contained no information about which piece of the source
they correspond to. This change corrects this problem by enabling the
profiler to produce output such as:

... 0.00     0.00 <pred/func goal from lp:'pivot', line 362> [10]
... 0.00     0.00 <pred/func goal from lp:'pivot', line 356> [11]
... 0.00     0.00 <pred/func goal from lp:'simplex', line 262> [12]

compiler/lambda.m:
compiler/polymorphism.m:
	construct more meaningful predicate names for lambda predicates.
	this required adding the name of the predicate that contained the
	lambda goal to the info structures that gets threaded through
	these modules.

profiler/demangle.m:
util/mdemangle.c:
	demangle the names for lambda goals.
1997-08-27 03:36:04 +00:00
Tyson Dowd
9f60f85e1c MGNUC = MERCURY_C_INCL_DIR=$(RUNTIME_DIR) $(SCRIPTS_DIR)/mgnuc
Estimated hours taken: 0.3


MGNUC   = MERCURY_C_INCL_DIR=$(RUNTIME_DIR) $(SCRIPTS_DIR)/mgnuc


util/Mmake:
	Set MERCURY_C_INCL_DIR when running mgnuc, as the installed
	runtime directory might not have compatible header files.
1997-08-01 06:48:36 +00:00
Fergus Henderson
04b720630b Update the copyright messages so that (a) they contain the correct years
and (b) they say "Copyright (C) ... _The_ University of Melbourne".
1997-07-27 15:09:59 +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
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
7ff47715e6 Fix some bugs that caused it to get a segmentation violation
Estimated hours taken: 1

util/mdemangle.c:
	Fix some bugs that caused it to get a segmentation violation
	when trying to demangling certain symbols.
1997-05-14 11:48:58 +00:00
Fergus Henderson
fbda1cc1ee Fix a typo: the index' predicates are index/2', not `index/3'.
Estimated hours taken: 0.1

util/mdemangle.c:
	Fix a typo: the `index' predicates are `index/2', not `index/3'.
1997-03-13 18:23:23 +00:00
Bert Thompson
af9bf57a9f Modified C code to make it conform to the C coding standards.
Estimated hours taken: 5

Modified C code to make it conform to the C coding standards.

runtime/
	Mmake call.mod calls.h context.h context.mod debug.h
	deep_copy.c deep_copy.h dlist.c dlist.h dummy.c engine.h
	engine.mod getopt.h goto.h heap.h imp.h init.h label.c label.h
	memory.c memory.h mercury_float.h mercury_solver_backtrack.h
	mercury_string.h mercury_types.h misc.c misc.h overflow.h
	prof.c prof.h prof_mem.c prof_mem.h regorder.h regs.h
	spinlock.c spinlock.h stacks.h std.h table.c table.h tags.h
	timing.c timing.h type_info.h wrapper.h wrapper.mod
runtime/machdeps/
	alpha_regs.h i386_regs.h mips_regs.h no_regs.h pa_regs.h
	regtest.c rs6000_regs.h sparc_regs.h
util/
	mdemangle.c mkinit.c
1997-02-12 02:19:13 +00:00
Fergus Henderson
9c363e259f Implement a new `-l' ("library") option.
Estimated hours taken: 1

util/mkinit.c:
	Implement a new `-l' ("library") option.
	If this option is enabled, we don't emit a main(),
	but instead we emit a mercury_main(argc, argv, stack_bottom)
	function that can be called from C.
1997-02-01 00:09:20 +00:00
Fergus Henderson
38c0925802 Delete a couple of lines of unnecessary code.
Estimated hours taken: 0.5

util/mdemangle.c:
	Delete a couple of lines of unnecessary code.
	Various other minor stylistic changes.
1997-01-29 13:50:00 +00:00
Simon Taylor
09d790a4f9 Reordered some code so that mangled predicate names with
Estimated hours taken: 1

util/mdemangle.c
	Reordered some code so that mangled predicate names with
	unused arguments are demangled correctly.
	Fix an off-by-one error that caused single character predicate names
	with unused arguments to be incorrectly demangled (not that Mercury
	programmers ever use single character predicate names :-).
	Clarified the code to check for optimization suffixes.
1997-01-29 06:53:40 +00:00
Tyson Dowd
6dd3f3e767 Clean up symbol demangling, and add demangling of mercury_data symbols.
Estimated hours taken: 5

Clean up symbol demangling, and add demangling of mercury_data symbols.

util/mdemangle.c:
	Add code to decode mercury_data items, including common
	blocks, base_type_infos and base_type_layouts.
	Fix demangling of f_cut and other builitins, so that at least
	something is output.
	Move duplicated code into functions.
	(This code might now pass first year).
1997-01-24 04:04:35 +00:00
Simon Taylor
b40cf32bc6 Undo an accidental change.
Estimated hours taken: 0.01

util/Mmake:
	Undo an accidental change.
1997-01-20 03:36:40 +00:00
Simon Taylor
e93f6961ab Handle a new name suffix introduced by unused_args.m
Estimated hours taken: 0.25

util/mdemangle.c
	Handle a new name suffix introduced by unused_args.m
1997-01-20 03:34:21 +00:00
Fergus Henderson
c9dd3e9f8b Cast the arguments to isdigit() to `unsigned char', since
Estimated hours taken: 0.5

util/mdemangle.c:
	Cast the arguments to isdigit() to `unsigned char', since
	isdigit() requires that.  (This fixes a potential portability
	problem porting to C compilers for which `char' is signed.)
1997-01-17 07:47:10 +00:00
Fergus Henderson
c046ccc5b7 Fix a missing `const' warning.
Estimated hours taken: 0.25

util/mdemangle.c:
	Fix a missing `const' warning.
1996-12-20 10:11:58 +00:00
Fergus Henderson
97f1881146 Mangle function names differently, so that we don't get
Estimated hours taken: 0.5

Mangle function names differently, so that we don't get
symbol name clashes between a function of arity N and
a predicate of arity N+1.  (This fixes a bug which resulted
in error messages from the assembler.)

util/mdemangle.c:
	Add code to demangle the new encoding of function symbols.
1996-10-24 06:02:57 +00:00
Simon Taylor
33f3fcb51c Module qualification of types, insts and modes.
Estimated hours taken: 0.25

Module qualification of types, insts and modes.

util/mdemangle.c
Parse module qualified type names for __Unify__ etc.
1996-06-11 06:33:58 +00:00
Fergus Henderson
586fa88288 In the code generated for main(), explicitly register the stack
Estimated hours taken: 0.5

util/mkinit.c:
	In the code generated for main(), explicitly register the stack
	bottom by setting `GC_stackbottom' to the address of a dummy local
	variable.  This is necessary for the Boehm collector to work
	on AIX 4.1.
1996-05-02 14:27:29 +00:00
Fergus Henderson
97ca90df2d Change -I $(RUNTIME_DIR)' to -I$(RUNTIME_DIR)', since some
Estimated hours taken: 0.1

util/Mmake:
	Change `-I $(RUNTIME_DIR)' to `-I$(RUNTIME_DIR)', since some
	C compilers don't allow a space after `-I'.
1996-03-29 16:31:19 +00:00
Fergus Henderson
8ffe74274b Fix things so that there are no circular dependencies amoungst the
Estimated hours taken: 0.25

Fix things so that there are no circular dependencies amoungst the
libraries, so that shared libraries work better (e.g. they can
use QuickStart on Irix 5).  The dependencies are linear again:
program -> library -> runtime -> boehm_gc.

util/mkinit.c:
	Change the set of address variables initialized in the
	generated code for main().
1996-03-04 00:17:28 +00:00
Simon Taylor
11509573a6 Fixed to handle the __ua<n> and __ho<n> added to the end of the
Estimated hours taken: 1

util/mdemangle.c
	Fixed to handle the __ua<n> and __ho<n> added to the end of the
	predicate name by unused_args.m and higher_order.m.
1996-02-16 05:43:59 +00:00
Fergus Henderson
95448bea43 Fix bug in `fast.gc' grade reported by Eero Pajarre.
Estimated hours taken: 1

Fix bug in `fast.gc' grade reported by Eero Pajarre.
(The symptom was "Mercury runtime: no entry point supplied".)

util/mkinit.c:
	If we are in `fast' or `fast.gc' grade, make sure we invoke
	`do_init_modules()' to initialize the entry point variables
	before we use them.
1996-01-08 03:09:07 +00:00
Fergus Henderson
9b4cc7e233 Add default implementation of strerror() for non-ANSI systems
Estimated hours taken: 0.5

util/mkinit.c:
	Add default implementation of strerror() for non-ANSI systems
	like old versions of SunOS.
1995-12-28 05:01:20 +00:00
Fergus Henderson
62d099d155 Make sure that there are no undefined external references
util/mkinit.c:
	Make sure that there are no undefined external references
	when building the shared libraries, so that we can use
	`ld -no_unresolved' on Irix 5.  This means the shared libraries
	can be Quickstarted, which improves startup time.
	The way it was done was by changing all calls to external
	references to instead call indirectly via global variables.
	mkinit.c now generates a main() which initializes various
	global variables and then calls mercury_main().
1995-10-24 07:13:50 +00:00
Fergus Henderson
934553c5a5 Change the uninstall' rule so that rather than using rm -f',
Mmake:
	Change the `uninstall' rule so that rather than using `rm -f',
	it uses plain `rm' but then ignores the exit status.  If we
	encounter permission errors when doing a `mmake uninstall', the
	user should know about them.
1995-10-07 15:43:32 +00:00