Commit Graph

178 Commits

Author SHA1 Message Date
Zoltan Somogyi
26caad3050 Remove type_ctor_layouts and type_ctor_functors where not needed.
Estimated hours taken: 8, plus about 12 hours by Tyson.

Remove type_ctor_layouts and type_ctor_functors where not needed.
Simplify type_ctor_layouts by removing code that generates (and
documentations for) particularly representations that are no longer used
now that we use type_ctor_reps.

Several files also had miscellaneous cleanups and documentation fixes,
the most important being the move of the type_ctor_info structures
for preds/funcs from runtime/mercury_type_info.c to library/builtin.m.

compiler/base_type_layout.m:
        Simplify documentation.

        Remove references to representations in type_ctor_layouts that
        are no longer used.compiler/base_type_layout.m:

compiler/base_type_info.m:
	Keep base_type_info__type_ctor_rep_to_int in sync with
	MR_TypeCtorRepresentation.

runtime/mercury_grade.h:
runtime/mercury_cpp.h:
	Move the definitions of MR_STRINGIFY and MR_PASTEn to the new file
	mercury_cpp.h. Add MR_PASTEn for several new values of n, for use by
	mercury_type_info.h.

runtime/mercury_type_info.h:
	Define macros for creating type_ctor_info structures for builtin types.
	These have NULL layout and functor fields.

	Remove several obsolete macros.

runtime/mercury_layout_util.c:
	Use the new macros for defining a dummy type_ctor_info.

runtime/mercury_deep_copy_body.h:
runtime/mercury_tabling.c:
	Modify the implementation of some RTTI functions to use the layout
	and functors structures only if they are defined.

runtime/mercury_type_info.c:
	Modify MR_collapse_equivalences to use the type_ctor_rep, not the
	functors indicator, to check for equivalence, since the latter is
	not guaranteed to be present.

	Move the type_ctor_info structure for preds/funcs to builtin.m.

library/array.m:
	Use these macros to define the type_ctor_info structure for array.

library/builtin.m:
	Use these macros to define the type_ctor_info structure for int,
	float, character, string, saved succip etc values, and for preds
	and funcs.

library/private_builtin.m:
	Use these macros to define the type_ctor_info structure for type_infos,
	type_ctor_infos, typeclass_infos and base_typeclass_infos.

	Move a c_header_code to the section that needs it.

library/std_util.m:
	Use the new macros to define the type_ctor_info structure for univ
	and for std_util's own type_info type.

	Modify the implementations of some RTTI predicates to use the
	layout and functors structures only if they are defined.
2000-01-19 09:45:23 +00:00
Fergus Henderson
14078f1aa9 Delete old bootstrapping code.
Estimated hours taken: 1

Delete old bootstrapping code.

runtime/mercury_ho_call.c:
	Delete code to handle old closure representations.

runtime/mercury_type_info.h:
runtime/mercury_type_info.c:
runtime/mercury_deep_copy_body.h:
runtime/mercury_tabling.c:
library/std_util.m:
	Delete code to handle old RTTI representations.

runtime/mercury_grade.h:
	Increment the binary compatibility version number.
	This is needed to ensure that any code compiled
	with the old closure or RTTI representations will
	get a link error.

compiler/notes/release_checklist.html:
	Delete the item about deleting code to handle old closure
	representations, since it has been done now.
	(Also delete the item about muz, since that has been
	done now too.)
1999-12-11 15:41:06 +00:00
David Jeffery
93b1c221fe Implement RTTI for functors with existentially typed arguments.
Estimated hours taken: 160

Implement RTTI for functors with existentially typed arguments. This allows
these functors to be deconstructed (and therefore io__write works for them)
and deep_copied.

compiler/base_type_layout.m:
	Generate extra information in the stack layout: the RTTI needs to
	include the number of extra arguments added for type infos and
	typeclass infos for each functor, as well as the locations of the
	type infos for each type.

compiler/stack_layout.m:
	Pass some extra arguments indicating that the pseudo type infos being
	handled are not existentially quantified.

compiler/std_util.m:
	Change ML_expand so that it includes information about existentially
	quantified arguments in the expand info.

compiler/base_typeclass_info.m:
	Extend the typeclass info structure to include enough information to
	copy it at runtime.

runtime/mercury_type_info.c:
	Use the new information in the RTTI to look up the type info packed
	inside a constructor if the pseudo type-info in question is
	existentially quantified. This may involve looking inside a typeclass
	info or just taking the type info directly.

runtime/mercury_deep_copy_body.h:
	Use the new RTTI to lookup up type so existentially quantified
	variables when doing a deep copy.

	Implement a function to deep copy typeclass infos.

runtime/mercury_deep_copy.c:
	#define the appropriate things to make copy_typeclass_info work for
	the different ways of allocating memory.

runtime/mercury_type_info.h:
	Change some prototypes and add macros to access the new information in
	the functor descriptor.

	Change the macros which access typeclass infos to reflect the new
	structure.

tests/hard_coded/existential_rtti.{m,exp}:
	A bunch of test cases for this change.

tests/hard_coded/Mmakefile:
	Turn this test case on.
1999-12-09 04:42:39 +00:00
Zoltan Somogyi
0b660d7ffe Put MR_ prefixes on a couple of uses of string_const() that were missed
Estimated hours taken: 0.1

library/std_util.m:
	Put MR_ prefixes on a couple of uses of string_const() that were missed
	earlier, in order to allow bootstrap with -DMR_NO_BACKWARDS_COMPAT.
1999-12-09 03:38:15 +00:00
Peter Ross
f87f9d2120 Ensure that the none.gc and none grades compile using a compiler
Estimated hours taken: 24

Ensure that the none.gc and none grades compile using a compiler
other than gcc.  This is not completely tested as lcc on linux can't
generate code for boehm_gc, and 'cc -std1' on the alpha runs out of
memory while trying to link the compiler.  However the compiler does
bootstrap using just gcc and also with lcc with boehm_gc compiled by
gcc.

configure.in:
    -Wl,opt1,opt2 syntax is not supported by lcc instead use -Wlopt1
    -Wopt2.

compiler/export.m:
    Only output a label declaration if that label is exported, as the
    static label declarations are not legal C.

library/io.m:
compiler/stack_layout.m:
    Replace escape sequence \x with \\x in pragma c code.

library/array.m:
library/std_util.m:
    Define what the struct is before using it, so the correct size for the
    struct can be calculated.

library/private_builtin.m:
    Replace escape sequence \x with \\x in pragma c code.
    Ensure that there is at least one local variable so that the
    structure definition for holding the local vars contains something.

runtime/mercury_faultaddr.h:
    Remove an unnecessary cast.

runtime/mercury_reg_workarounds.h:
    #include sys/time.h for FD_ZERO().

runtime/mercury_stack_trace.h:
    Remove an extraneous ',' which was causing warnings.
1999-11-25 09:09:46 +00:00
Fergus Henderson
8f2a2976a8 Fix some bugs in the definition of the type_ctor_info for
Estimated hours taken: 0.5

library/std_util.m:
	Fix some bugs in the definition of the type_ctor_info for
	type_info/0 that Tyson recently added.  These bugs meant
	that it didn't compile in some grades.

	Also delete some long obsolete stuff inside `#ifdef COMPACT_ARGS'.
1999-11-16 12:18:19 +00:00
Zoltan Somogyi
e475da1d2c Put MR_ prefixes on uses of string_const(), make_aligned_string()
Estimated hours taken: 0.2

library/*.m:
	Put MR_ prefixes on uses of string_const(), make_aligned_string()
	variants, and COMPARE_EQUAL and friends, in order to allow bootstrap
	with -DMR_NO_BACKWARDS_COMPAT.
1999-11-15 10:12:19 +00:00
Tyson Dowd
7609c18a0a Remove code from mercury_bootstrap.c.
Estimated hours taken: 1

Remove code from mercury_bootstrap.c.

library/std_util.m:
        Add type_ctor_info for type_info/0.

runtime/mercury_bootstrap.c:
	Remove type_ctor_info for type_info/0 (and other supporting
	bootstrapping stuff).
1999-11-15 05:12:29 +00:00
Fergus Henderson
1249efcde0 Fix gcc 2.95 warnings about "non-static declaration follows static".
Estimated hours taken: 0.5

library/array.m:
library/builtin.m:
library/private_builtin.m:
library/std_util.m:
runtime/mercury_bootstrap.c:
runtime/mercury_memory_zones.c:
	Fix gcc 2.95 warnings about "non-static declaration follows static".
1999-11-14 23:23:19 +00:00
Tyson Dowd
326eadc13b Add support for distinguishing types with user defined equality from
Estimated hours taken: 5

Add support for distinguishing types with user defined equality from
system defined equality.  This information is encoded in the
type_ctor_rep.

It is intended to be used for implementing RTTI driven compare and unify
procedures.

This change uses the version number in the type_ctor_info to allow
Easy Bootstrapping(TM).

compiler/base_type_info.m:
	Add new alternatives for user defined equality types.
	Update RTTI version number.
	Change `type_ctor_info_version' to `type_ctor_info_rtti_version'.

runtime/mercury_type_info.c:
	Define MR_get_new_type_ctor_rep which gets the type_ctor_rep,
	automatically converting older versions.
	(this change is just for bootstrapping).

runtime/mercury_grade.h:
	Note that MR_get_new_type_ctor_rep should be removed when binary
	compatibility number is increased.
	Also suggest inspecting code for RTTI version number checks in
	general.

runtime/mercury_type_info.h:
	Add a macro for checking sane values for RTTI version.

library/std_util.m:
runtime/mercury_deep_copy_body.h:
runtime/mercury_tabling.c:
runtime/mercury_wrapper.c:
	Use MR_get_new_type_ctor_rep to get the type_ctor_rep.
	(this change is just for bootstrapping).

	Add new alternatives to code that uses type_ctor_rep (at the
	moment they just fall through).

runtime/mercury_ho_call.c:
	Use MR_get_new_type_ctor_rep and also fix a bug Zoltan
	introduced when specializing the unification code.  Handle
	enums with user defined equality differently to normal enums.
1999-10-28 06:23:02 +00:00
Tyson Dowd
581a89622e Add version information to type_ctor_infos.
Estimated hours taken: 1.5

Add version information to type_ctor_infos.  This way bootstrapping is
easier and binary compatibility can be broken more slowly.

RTTI code can check version numbers before performing operations on
data structures that have recently changed their representation.
At the least they can abort cleanly and let you know that it's time
to re-compile, at best they can handle both forms of the data structure.
It is a bootstrapping problem that currently there is no version number
information in the appropriate slot in pre-built systems.

The version numbers start at 2 simply because 2 "occurs naturally"
much less often than 1 or 0.  And 42 was becoming trite.

compiler/base_type_info.m:
	Generate RTTI version numbers in compiler-generated
	type_ctor_infos.

library/builtin.m:
library/private_builtin.m:
library/std_util.m:
runtime/mercury_bootstrap.c:
runtime/mercury_type_info.c:
	Add RTTI version numbers for handwritten type_ctor_infos.

runtime/mercury_type_info.h:
	Add MR_RTTI_VERSION to define the current version of the RTTI
	info and the first version: MR_RTTI_VERSION_INITIAL which
	happens to have the value of 2.
1999-10-20 07:03:23 +00:00
Fergus Henderson
df867b10b7 Implement `do_while/4'.
Estimated hours taken: 2

library/std_util.m:
	Implement `do_while/4'.

samples/README:
samples/all_solutions.m:
samples/committed_choice.m:
samples/solutions/all_solutions.m:
samples/solutions/one_solution.m:
samples/solutions/some_solutions.m:
	Move the all_solutions.m and committed_choice.m samples
	into a new subdirectory `solutions', renaming committed_choice.m
	as `one_solution.m', and add a new file `some_solutions.m'
	illustrating the use of `do_while/4'.
	(Also fix some documentation rot in samples/README.)

NEWS:
	Mention the new predicate std_util__do_while/4.

tests/general/Mmakefile:
tests/general/do_while.m:
tests/general/do_while.exp:
	A test case for the new feature.
1999-10-20 03:14:35 +00:00
Fergus Henderson
a512184c16 Implement `builtin_aggregate' using impure Mercury
Estimated hours taken: 4

library/std_util.m:
	Implement `builtin_aggregate' using impure Mercury
	and some `pragma c_code' fragments, rather than
	using completely hand-coded low-level C code.

	This has several benefits:
		- it should allow the accurate garbage collector
		  to trace code using solutions/2, without
		  needing to hand-code the liveness information
		- the compiler can specialize the higher-order
		  calls in builtin_aggregate
		- the code is simpler and much more high-level,
		  and thus should be easier to maintain.
1999-10-19 04:45:09 +00:00
Fergus Henderson
88a513b580 Reorganize the routines for allocating and deallocating memory:
Estimated hours taken: 8

Reorganize the routines for allocating and deallocating memory:

runtime/mercury_std.h:
runtime/mercury_misc.c:
runtime/mercury_memory.h:
runtime/mercury_memory.c:
	- Put the routines in the proper place.
		Previously the declarations and definitions of the memory
		allocation/deallocation routines were spread amoungst
		all four of these files; I moved the ones in mercury_std.h
		and mercury_misc.c so that they are now all defined
		in mercury_memory.{h,c}
	- Avoid unnecessary duplication
		The following routines did exactly the same thing,
		modulo bugs(!):
			allocate_bytes()	and newmem()
			deallocate_bytes()	and oldmem()
			make()			and allocate_object()
			make_many()		and allocate_array()
	- Use appropriate names.
		I added `MR_' prefixes, and ensured that macros that are not
		function-like macros use all uppercase.  I also used a more
		consistent naming scheme.
		Previously the names used were
			(1) checked_malloc, checked_realloc
			(2a) allocate_bytes, deallocate_bytes, reallocate_bytes,
				allocate_object, allocate_array, resize_array
			(2b) newmem, oldmem, resizemem,
				make, make_many, resize_many
		The new names are
			(1) MR_malloc, MR_free, MR_realloc,
				MR_NEW, MR_NEW_ARRAY, MR_RESIZE_ARRAY
			(2) MR_GC_malloc, MR_GC_free, MR_GC_realloc,
				MR_GC_NEW, MR_GC_NEW_ARRAY, MR_GC_RESIZE_ARRAY

runtime/*.[ch]:
trace/*.[ch]:
library/array.m:
library/benchmarking.m:
library/io.m:
library/std_util.m:
extras/odbc/odbc.m:
extras/aditi/aditi.m:
	Use the new names.
1999-10-18 15:47:39 +00:00
Fergus Henderson
73c1c6c566 Delete some old bootstrapping code.
Estimated hours taken: 0.25

library/term.m:
library/std_util.m:
	Delete some old bootstrapping code.
1999-10-18 11:13:42 +00:00
Fergus Henderson
c958d29f8e Delete some obsolete comments (mostly ones about Prolog
Estimated hours taken: 0.25

library/string.m:
library/math.m:
library/std_util.m:
	Delete some obsolete comments (mostly ones about Prolog
	compatibility, which is no longer important).
1999-10-15 21:13:42 +00:00
Fergus Henderson
1f01db85bc Fix problems that broke the jump' and fast' grades.
Estimated hours taken: 3

Fix problems that broke the `jump' and `fast' grades.

library/builtin.m:
library/private_builtin.m:
library/array.m:
library/std_util.m:
	Use MR_MAYBE_STATIC_CODE() in initializers for type_ctor_infos,
	to avoid a compilation error when code addresses are not valid
	initializers.  Call MR_INIT_TYPE_CTOR_INFO() to ensure that the
	type_ctor_infos for c_pointer, type_info, type_ctor_info,
	typeclass_info, base_typeclass_info, array, and univ are
	initialized at runtime if they can't be initialized statically.
1999-10-13 07:01:29 +00:00
Zoltan Somogyi
466c844964 Make the retry command work in trailing grades (e.g. for HAL).
Estimated hours taken: 18

Make the retry command work in trailing grades (e.g. for HAL).

compiler/trace.m:
	In trailing grades, reserve two stack slots to hold (a) the trail
	pointer on entry, and (b) a new ticket obtained on entry. Arrange to
	put the numbers of these stack slots in the proc layout.

compiler/stack_layout.m:
	Put the number of the first of these stack slots in the proc layout.

compiler/code_info.m:
	Arrange the default: there are no such slots if debugging is not
	enabled.

compiler/code_gen.m:
	Insert code to discard the allocated ticket, in the success epilog
	of model_det procedures, the success and failure epilogs of model_semi
	procedures, and the failure epilogs of model_non procedures.
	(Model_det procedures don't have failure epilogs, and discarding
	the ticket in the success epilog of a model_non procedure would be
	premature.)

compiler/llds.m:
	Add two new alternatives to the type describing stack slots:
	a stack slot may contain a trail pointer or a ticket.

	Add a new reason for resetting the trail: a retry in the debugger.

compiler/llds_out.m:
	Minor changes to conform to llds.m, and to make diagnostic output
	less misleading.

library/builtin.m:
	Add the type_ctor_info for the new "types" describing stored trail
	pointers and tickets.

	Bring up to date the type_ctor_infos of other "types" used only
	for describing stack slots.

library/std_util.m:
	Add the missing code to handle the type_ctor_infos of trail pointers,
	tickets and other "types" used only for describing stack slots.

runtime/mercury_type_info.h:
	Add a new type_ctor representation value for stored trail pointers,
	tickets, and for other "types" used only for describing stack slots.

runtime/mercury_deep_copy_body.h:
runtime/mercury_tabling.c:
	Add the missing code to handle the type_ctor_infos of trail pointers,
	tickets and other "types" used only for describing stack slots.

runtime/mercury_stack_layout.h:
	Add a field to proc layouts to hold either the number of the first
	of the two stack slots holding trail info, or -1.

runtime/mercury_trail.h:
	Add the new reason why the trail may be reset.

trace/mercury_trace.c:
	In trailing grades, reset the trail, with the reason being given
	as retry, when the debugger's retry command is executed.

extras/references/scoped_update.m:
extras/trailed_update/var.m:
clpr/cfloat.m:
extras/trailed_update/tests/func_trail_test.m:
extras/trailed_update/tests/func_trail_test_2.m:
	Handle MR_retry as a reason for unwinding the trail.
1999-10-08 02:56:24 +00:00
Fergus Henderson
9c8ecb5978 Fix a bug introduced by my improvements to memory profiling.
Estimated hours taken: 8

Fix a bug introduced by my improvements to memory profiling.
The bug was that it wasn't properly handling the case when the
pragma c_code fragments get inlined.

compiler/pragma_c_gen.m:
	When generating model_det/model_semi pragma c_code,
	#define MR_PROC_LABEL to be the entry label of the procedure
	containing the `pragma c_code' goal.

library/io.m:
library/string.m:
library/std_util.m:
library/store.m:
	Use MR_PROC_LABEL rather than hard-coding the procedure entry label.
1999-09-30 22:07:51 +00:00
Zoltan Somogyi
ac69527233 Supply missing MR_mktag wrappers on the first args of MR_field
Estimated hours taken: 0.1

library/std_util.m:
	Supply missing MR_mktag wrappers on the first args of MR_field
	references.
1999-09-28 02:03:48 +00:00
Zoltan Somogyi
bca4cb8162 Make the entire Mercury system bootstrap without backwards compatbility.
Estimated hours taken: 12

Make the entire Mercury system bootstrap without backwards compatbility.

compiler/llds_out.m:
compiler/pragma_c_gen.m:
	Add MR_ prefixes on generated code.

library/builtin.m:
library/exception.m:
library/private_builtin.m:
library/std_util.m:
library/store.m:
	Add MR_ prefixes.

runtime/mercury_deep_copy_body.h:
runtime/mercury_heap.h:
runtime/mercury_stacks.h:
runtime/mercury_string.h:
runtime/mercury_tags.h:
runtime/mercury_type_info.h:
	Add MR_ prefixes.

runtime/mercury_bootstrap.c;
runtime/mercury_engine.c;
runtime/mercury_ho_call.c;
runtime/mercury_tabling.c;
runtime/mercury_trace_base.c;
runtime/mercury_type_info.c;
runtime/mercury_wrapper.c;
	Add MR_ prefixes. In some cases, fix indentation; in functions using
	four-space indentation, convert all tabs to spaces.

trace/mercury_trace_browse.m:
trace/mercury_trace_declarative.m:
trace/mercury_trace_external.m:
trace/mercury_trace_help.m:
	Add MR_ prefixes.
1999-09-27 05:20:58 +00:00
Fergus Henderson
05bb4b1e88 More improvements to memory profiling.
Estimated hours taken: 0.75

More improvements to memory profiling.

runtime/mercury_tags.h:
	Add `_msg' versions of MR_list_cons() and MR_list_empty().
	these record the allocations in the memory profile.

runtime/mercury_heap.h:
	Add `_msg' versions of create1(), create2(), and create3(),
	for use by MR_list_cons_msg() and MR_list_empty_msg().
	Also delete create2_fb() and create2_bf() since they are not used.

library/io.m:
library/string.m:
library/store.m:
library/std_util.m:
	Change calls to MR_list_cons() to instead call MR_list_cons_msg()
	so that these allocations will get included in the memory profile.
	Likewise for MR_list_empty().
1999-09-24 06:25:16 +00:00
Fergus Henderson
3aaf4351f3 Improve memory profiling.
Estimated hours taken: 1.5

Improve memory profiling.

library/io.m:
library/string.m:
library/store.m:
library/std_util.m:
	Change calls to incr_hp() to instead call incr_hp_msg() so that
	these allocations will get included in the memory profile.
	Likewise for calls to tag_incr_hp(), incr_hp_atomic(), etc.

runtime/mercury_heap.h:
	When calling MR_record_allocation() in tag_incr_hp_msg(),
	use ENTRY(proclabel) rather than LABEL(proclabel), so that
	it works even if the allocation is actually done outside
	of the procedure, where the ENTRY label is visible but the
	LABEL isn't.  This can happen if pragma c_code that calls
	tag_incr_hp_msg() is inlined into some other procedure.
1999-09-24 05:47:14 +00:00
Fergus Henderson
9748ebf7ff Delete an unnecessary cast that was causing a compiler warning
Estimated hours taken: 0.25

library/std_util.m:
	Delete an unnecessary cast that was causing a compiler warning
	(and which for C compilers other than gcc might cause an error).
1999-09-17 06:40:32 +00:00
Peter Ross
39be0f175e Add functional and logical versions of fst and snd for the pair data
Estimated hours taken: 0.5

library/std_util.m:
    Add functional and logical versions of fst and snd for the pair data
    structure.
1999-08-20 07:57:12 +00:00
Warwick Harvey
3b26c80e4e Changed all type_ctor_info structures to use the MR_TypeCtorInfo type.
Estimated hours taken: 16

Changed all type_ctor_info structures to use the MR_TypeCtorInfo type.  This
is primarily to reduce the number of conflicts when merging independent
changes to the type_ctor_info structures.  As part of this, changed the type
of `string_const' to be `String' rather than `Word *', to avoid type errors
in the initialisers for compiler-generated type_ctor_infos.

compiler/llds_out.m:
	Don't emit definitions for type_ctor_info structs; instead use
	`MR_TypeCtorInfo_struct'.
	Removed a couple of casts of `string_const's to type `String', since
	they are no longer necessary.

compiler/llds.m:
	Changed the entries for `string_const' and `multi_string_const' in
	llds__const_type/2 to be `string' rather than `data_ptr'.

library/array.m:
library/builtin.m:
library/private_builtin.m:
library/std_util.m:
runtime/mercury_bootstrap.c:
runtime/mercury_type_info.c:
	Changed all the hand-defined type_ctor_info structures to just use
	`MR_TypeCtorInfo_struct', and added appropriate casts to the
	initialisers.  This included removing what appears to have been the
	last vestiges of `USE_TYPE_LAYOUT' conditionals since their use was
	so broken that it would probably be easier to re-implement the same
	functionality from scratch than to debug and rebuild on what was left.

runtime/mercury_type_info.h:
	Introduced `struct MR_TypeCtorInfo_struct' as the name of the
	(previously anonymous) struct which `MR_TypeCtorInfo' was a pointer
	to.
	Introduced `MR_DECLARE_TYPE_CTOR_INFO_STRUCT' for declaring
	type_ctor_info structures, since `MR_DECLARE_STRUCT' generates
	old-style names for type_ctor_infos.

runtime/mercury_deep_copy.c:
runtime/mercury_tabling.c:
library/std_util.m:
extras/exceptions/exception.m:
	Changed some uses of `MR_DECLARE_STRUCT' to use
	`MR_DECLARE_TYPE_CTOR_INFO_STRUCT' instead.

runtime/mercury_bootstrap.h:
	Added some `#define's of some old type_ctor_info type names to be
	`MR_TypeCtorInfo_struct', so that during bootstrapping the type
	names generated by the old version of the compiler work with the new
	scheme used in the manual definitions.

runtime/mercury_string.h:
	Changed the type of the macro `string_const/2'.  It used to cast to
	`Word *', now it casts to `String'.
1999-08-12 09:58:49 +00:00
Tyson Dowd
b845fcb08f Fix a bug that was causing the compiler to fail the debugger
Estimated hours taken: 4

Fix a bug that was causing the compiler to fail the debugger
tests with an unknown layout error.  std_util:type_info/0 needs
to be defined by hand so we can tell the RTTI system that it is
a type_info.

This change breaks bootstrapping with earlier compilers.
Use the CVS tag bootstrap_19990719_handdefine_typeinfo to
bootstrap this change.

compiler/type_util.m:
	Add std_util:type_info/0 to the hand defined types.
	This is different to private_builtin:type_info/1 which
	was already there.  It was type_info/0 that the debugger
	was failing on.

library/builtin.m:
	Move the type_ctor_info for c_pointer back into this module.
	It should have finished bootstrapping by now.

library/std_util.m:
	Define type_ctor_info as (abstractly) equivalent to a type_info
	instead of equivalent to a c_pointer.  This will allow this type
	to be handled by the garbage collector or debugger.

runtime/mercury_bootstrap.c:
	Move the RTTI info for c_pointer out of this module.
	Add the type_ctor_info for type_info/0 as it is now a hand
	defined type.

tests/hard_coded/higher_order_type_manip.exp:
	Fix expected test results not that type_ctor_info is equivalent
	to type_info/0.



Estimated hours taken: _____

<overview or general description of changes>

<directory>/<file>:
	<detailed description of changes>
1999-07-19 04:51:43 +00:00
Fergus Henderson
65782f9925 Add functions for the single output det predicates in a number
Estimated hours taken: 5

[This change was by Ralph Becket.
I'm just the person who reviewed it and committed it.  -fjh.]

Add functions for the single output det predicates in a number
of modules in the standard library.  Basically, for each

	:- pred f(in, ..., in, out) is det.

I have added the declaration

	:- func f(in, ..., in) = out.

and definition

	f(X1, ..., Xn) = Y :-
		f(X1, ..., Xn, Y).

library/char.m:
library/dir.m:
library/map.m:
library/string.m:
library/list.m:
library/set.m:
	Make the changes described above.

library/array.m:
	As above, except array input modes are all array_ui or
	array_di as appropriate and array output modes are array_uo.

library/int.m:
	Added forward versions of +/2, */2 and -/2 as plus/2, times/2
	and minus/2 respectively, to make it easier to pass these
	as arguments to higher-order predicates.
	Also added func constants for max_int, min_int and bits_per_int.

library/integer.m:
	Replaced local functions for list head, tail and length with
	calls to equivalent functions now defined in list.m.

library/io.m:
	Added func for error_message/2.

library/list.m:
	Add functions det_head/1 and det_tail/1 which abort on null lists.

library/set.m:
	Add functions map/2, filter_map/2 and fold/3.

library/std_util.m:
	Added utility function to construct a pair object from its
	arguments and general purpose higher order functions for
	partial functions and for function composition, exponentiation
	and exchanging the arguments of a binary function.
1999-07-07 15:19:42 +00:00
Tyson Dowd
eae3174a2c Add MR_TYPECTOR_REP_* to the type_ctor_info to describe the
Estimated hours taken: 30  (including debugging)

Add MR_TYPECTOR_REP_* to the type_ctor_info to describe the
representation of this type.

We want to do this because it allows us to check quickly to see
what kind of data representation is being used.  Previously this
information was spread throughout the type_ctor_layout and
type_ctor_functors data structures.  It was complex to interpret
and contained a lot of unnecessary duplication.

We can now omit data structures such as the type_ctor_layout in many
cases (it is only necessary for discriminated unions).  Because we rule
out some of the possible alternatives, the encodings used in the
type_ctor_layout can be simplified.  Also, the functors indicator in
type_ctor_functors can be removed, as it subsumed by this data
structure.

Use this representation in code that uses RTTI.

compiler/base_type_info.m:
	Add a missing alternative to the type_ctor_rep (this was a
	bug).

library/array.m:
library/builtin.m:
library/private_builtin.m:
runtime/mercury_bootstrap.c:
	Use MR_TYPECTOR_REP_* in the type_ctor_infos for builtin types.

library/std_util.m:
runtime/mercury_deep_copy_body.h:
runtime/mercury_tabling.c:
	Use MR_TYPECTOR_REP_* and MR_DISCUNION_TAG_* to dispatch on
	data representations.

	Also, fix a bug in deep_copy when copying floating point values.
	I'm not sure when this stopped working, or if this is exactly
	the right fix, but it is more correct than the previous code.

runtime/mercury_type_info.c:
runtime/mercury_type_info.h:
	Update code to use MR_TYPECTOR_REP_*.
	Use a struct for type_ctor_info.

tests/hard_coded/Mmakefile:
tests/hard_coded/deep_copy.m:
tests/hard_coded/deep_copy.exp:
	Add a test case for deep_copy.
1999-07-06 06:32:33 +00:00
Tyson Dowd
3ecbe3eed0 Move the type_ctor_infos for array and univ into their proper places.
Estimated hours taken: 0.5

Move the type_ctor_infos for array and univ into their proper places.
This change has bootstrapped on most of our platforms, but actually
causes trouble linking small programs (because it creates runtime ->
library dependencies).  So we should move it as soon as possible.


library/array.m:
library/std_util.m:
	Add type_ctor_info for array and univ.

runtime/mercury_bootstrap.c:
	Remove type_ctor_info for array and univ.
1999-06-02 10:05:08 +00:00
Zoltan Somogyi
c6812299c2 Remove support for --args simple. We don't use it, we won't use it even for
Estimated hours taken: 4.5

Remove support for --args simple. We don't use it, we won't use it even for
experiments, and it is unnecessary complication.

If anybody were using --args simple, this would need bootstrapping, but
since nobody does, there is no need, and this can be committed as an
ordinary change.

compiler/options.m:
doc/user_guide.texi:
scripts/*.in:
scripts/*.sh-subr:
	Remove the --args option.

compiler/globals.m:
	Remove the args_method global and its access predicates.

compiler/handle_options.m:
	Don't set the args_method global from the option.

compiler/arg_info.m:
	Remove support for --args simple. This allows us to remove a now
	redundant argument from an exported predicate.

compiler/mercury_compile.m:
	Remove the code for passing -DCOMPACT_ARGS to the C compiler.

compiler/bytecode_gen.m:
compiler/fact_table.m:
compiler/follow_vars.m:
compiler/live_vars.m:
compiler/call_gen.m:
	Don't pass the unnecessary argument to arg_info.

compiler/call_gen.m:
compiler/unify_gen.m:
	Remove now unnecessary assertions.

compiler/hlds_pred.m:
	Don't include an args_method in proc_infos; instead, include
	a slot that says whether the procedure's address is taken or not.
	(In most cases, this determined whether the args_method was
	simple or compact.) We will need this bool in the near future
	(when we generate layout structures for procedures whose address
	is taken).

	Modify the signatures of exported predicates to accommodate
	this change to the data structure.

compiler/hlds_out.m:
	Print the new slot, not the args_method.

compiler/lambda.m:
	When creating procedures from lambdas, set the address-taken slot
	to address_is_taken instead of setting up its args_method.

compiler/make_hlds.m:
	Minor changes to conform to the changes in the signatures of
	the predicates exported from hlds_pred.m.

compiler/check_typeclass.m:
compiler/clause_to_proc.m:
compiler/dnf.m:
compiler/magic.m:
compiler/magic_util.m:
compiler/modecheck_call.m:
compiler/pd_info.m:
compiler/post_typecheck.m:
compiler/unify_gen.m:
	Minor changes to conform to the changes in the signatures of
	the predicates exported from hlds_pred.m and make_hlds.m.

runtime/mercury_type_info.h:
	Remove the conditional definition of the macros that provided
	an argument-method-independent way of referring to the registers
	holding the inputs and outputs of e.g. unification procedures.
	We don't need the independence anymore, and using registers instead
	of macros in the code ensures that maintainers are aware of register
	reuse issues (e.g. they copy an input from r1 before overwriting it
	with an output).

runtime/mercury_conf_param.h:
runtime/mercury_grade.h:
	Remove support for the args method component of the grade.

runtime/mercury_ho_call.c:
runtime/mercury_tabling.c:
library/*.m:
	Conform to the changes in runtime/mercury_type_info.h by effectively
	applying the #defines appropriate to compact args by hand.

	Remove code and data structures only needed for simple args.
	Remove comments needed only in the presence of uncertainty about
	the args method.
1999-06-01 09:46:20 +00:00
Zoltan Somogyi
c2da42e6d0 Allow the compiler to handle create rvals whose arguments have a size
Estimated hours taken: 16

Allow the compiler to handle create rvals whose arguments have a size
which is different from the size of a word. Use this capability to reduce
the size of RTTI information, in two ways.

The first way is by rearranging the way in which we represent information
about the live values at a label. Instead of an array with an entry for
each live value, the entry being a pair of Words containing a shape
representation and a location description respectively, use an array
of shape representations (still Words), followed by an array of 32-bit ints
(which may be smaller than Word) describing locations whose descriptions
don't fit into 8 bits, followed by an array of 8-bit ints describing
locations whose descriptions do fit into 8 bits.

The second way is by reducing the sizes of some fields in the C structs
used for RTTI. Several of these had to be bigger than necessary in the
past because their fields were represented by the args of a create rval.

On cyclone, this reduces the size of the object file for queens.m by 2.8%.

IMPORTANT
Until this change is reflected in the installed compiler, you will not be
able to use any modules compiled with debugging in your workspaces if the
workspace has been updated to include this change. This is because the RTTI
data structures generated by the old installed compiler will not be compatible
with the new structure definitions.

The workaround is simple: if your workspace contains modules compiled with
debugging, don't do a cvs update until this change has been installed.

configure.in:
	Check whether <stdint.h> is present. If not, autoconfigure
	types that are at least 16 and 32 bits in size.

runtime/mercury_conf.h.in:
	Mention the macros used by the configure script, MR_INT_LEAST32_TYPE
	and MR_INT_LEAST16_TYPE.

runtime/mercury_conf_param.h:
	Document the macros used by the configure script, MR_INT_LEAST32_TYPE
	and MR_INT_LEAST16_TYPE.

runtime/mercury_types.h:
	If <stdint.h> is available, get the basic integer types (intptr_t,
	int_least8_t, etc) from there. Otherwise, get them from the
	autoconfigure script. Define types such as Word in terms of these
	(eventually) standard types.

runtime/mercury_stack_layout.h:
	Add macros for manipulating short location descriptions, update the
	types and macros for manipulating long location descriptions.
	Modify the way the variable count is represented (since it now must
	count locations with long and short descriptions separately),
	and move it to the structure containing the arrays it describes.

	Reduce the size of the some fields in structs. This required some
	reordering of fields to avoid the insertion of padding by the compiler,
	and changes to the definitions of some types (e.g. MR_determinism).

runtime/mercury_layout_util.[ch]:
runtime/mercury_stack_trace.c:
runtime/mercury_accurate_gc.c:
trace/mercury_trace.c:
trace/mercury_trace_external.c:
trace/mercury_trace_internal.c:
	Update the code to conform to the changes to stack_layout.h.

compiler/llds.m:
	Modify the create rval in two ways. First, add an extra argument to
	represent the types of the arguments, which used to always be implicit
	always a word in size, but may now be explicit and possibly smaller
	(e.g. uint_least8). Second, since the code generator would do the wrong
	thing with creates with smaller than wordsize arguments, replace
	the old must-be-unique vs may-be-nonunique bool with a three-valued
	marker, must_be_dynamic vs must_be_static vs can_be_either.

	Add uint_least8, uint_least16, uint_least32 (and their signed variants)
	and string as llds_types.

	Add a couple of utility predicates for checking whether an llds_type
	denotes a type whose size is the same as word.

compiler/llds_out.m:
	Use explicitly given argument types when declaring and initializing
	the arguments of a cell, if they are given.

compiler/llds_common.m:
	Don't conflate creates with identical argument values but different
	C-level argument types. The probability of a match is minuscule anyway.

compiler/stack_layout.m:
	Use the new representation of creates to generate the new versions of
	RTTI data structures.

compiler/code_exprn.m:
	If a create is marked must_be_static, don't inspect the arguments
	to decide whether it can be static or not. If it can't, we'll get
	an abort later on in llds_out or during C compilation anyway.

compiler/base_type_layout.m:
	When creating pseudo typeinfos, return the llds_type of the resulting
	rval.

	Minor changes required by the change in create.

compiler/base_type_info.m:
compiler/base_typeclass_info.m.m:
compiler/code_util.m:
compiler/dupelim.m:
compiler/exprn_aux.m:
compiler/jumpopt.m:
compiler/livemap.m:
compiler/lookup_switch.m:
compiler/middle_rec.m:
compiler/opt_debug.m:
compiler/opt_util.m:
compiler/string_switch.m:
compiler/unify_gen.m:
compiler/vn_cost.m:
compiler/vn_filter.m:
compiler/vn_flush.m:
compiler/vn_order.m:
compiler/vn_type.m:
compiler/vn_util.m:
compiler/vn_verify.m:
	Minor changes required by the change in create.

library/benchmarking.m:
library/std_util.m:
	Use the new macros in hand-constructing proc layout structures.

library/Mmakefile:
	Add explicit dependencies for benchmarking.o and std_util.o
	on ../runtime/mercury_stack_layout.h. Although this is only a subset
	of the truth (in reality, all library objects depend on most of the
	runtime headers), it is a good tradeoff between safety and efficiency.
	The other runtime header files tend not to change in incompatible ways.

trace/Mmakefile:
	Add explicit dependencies for all the object files on
	../runtime/mercury_stack_layout.h, for similar reasons.
1999-04-30 06:21:49 +00:00
Zoltan Somogyi
dfb59414e4 Prefix everything defined in runtime/mercury_{stacks,tags}.h MR_.
Estimated hours taken: 3

Prefix everything defined in runtime/mercury_{stacks,tags}.h MR_.
In the process, get rid of the grade component MR_DEBUG_NONDET_STACK,
since this makes the update to mercury_stacks.h simpler and its use is
long obsolete.

runtime/mercury_tags.h:
	Put MR_ prefixes in front of everything defined here.

runtime/mercury_stacks.h:
	Put MR_ prefixes in front of everything defined here.

	Remove support for MR_DEBUG_NONDET_STACK. Replace most of the
	lost functionality by calling an updated mkframe_msg.

	Remove the definitions of push() and pop(). Their use conflicts with
	the idea that everything on the det stack is part of a frame, which
	the RTTI stuff depends on.

runtime/mercury_bootstrap.h:
	Add backward compatibility macros for the old names in the above two
	files.

	Remove some old entries in this file which are no longer needed.

runtime/mercury_wrapper.c:
	Remove the only uses of push() and pop().

	Put MR_ in front of some things that need them.

runtime/mercury_engine.c:
	Put MR_ in front of some things that need them.

runtime/mercury_misc.[ch]:
	Make mkframe_msg get the name of the procedure that owns the stack
	frame from an explicitly passed argument, rather than the prednm slot
	(which no longer exists). This actually improves low-level debugging
	support without MR_DEBUG_NONDET_STACK.

	Remove unnecessary return statements.

runtime/mercury_debug.h:
	Pass on the new arg of mkframe_msg.

	Fix long lines.

runtime/mercury_conf_param.h:
	Remove the documentation of MR_DEBUG_NONDET_STACK.

runtime/mercury_grade.h:
	Remove the grade component of MR_DEBUG_NONDET_STACK.

doc/reference_manual.texi:
	Document the MR_ prefixed versions of list_empty, list_cons etc.

library/io.m:
library/std_util.m:
library/string.m:
	Add prefixes to some references to the runtime.
1999-04-30 04:25:42 +00:00
Tyson Dowd
6cb525f6bc This change does some renaming to match the new nomenclature introduced
Estimated hours taken: 5

This change does some renaming to match the new nomenclature introduced
in the RTTI paper.

Rename simple tags as unshared tags, complicated tags as shared
remote tags and complicated constant tags as shared local.
Also rename "simple vector" as "functor descriptor",
"functors vector" as "enum vector".

compiler/base_type_layout.m:
compiler/bytecode.m:
compiler/bytecode_gen.m:
compiler/hlds_data.m:
compiler/make_tags.m:
compiler/switch_gen.m:
compiler/tag_switch.m:
compiler/unify_gen.m:
	Perform these renamings in the compiler, renaming a few
	functors and data structures.

library/std_util.m:
runtime/mercury_deep_copy_body.h:
runtime/mercury_tabling.c:
runtime/mercury_type_info.c:
runtime/mercury_type_info.h:
	Perform these renamings in the library and runtime, renaming
	macros and variables.
1999-04-22 01:04:32 +00:00
Zoltan Somogyi
3bf462e0b7 Switch to a closure representation that includes runtime type and procedure id
Estimated hours taken: 36

Switch to a closure representation that includes runtime type and procedure id
information, so that closures can be copied, garbage collected, printed, etc.

This RTTI information is not yet used. Adding code to use it would be futile
until Tyson finishes his changes to the other RTTI data structures.

Note also that this change provides the information required for solving the
problem of trying to deep copy closures only for grades that include
--typeinfo-liveness. Providing this info for other grades is future work.

configure.in:
	Find out what the right way to refer to a variable-sized array
	at the end of a struct is.

runtime/mercury_ho_call.h:
	New file to define the structure of closures and macros for accessing
	closures.

runtime/Mmakefile:
	Add the new header file.

runtime/mercury_ho_call.c:
	Add an entry point to handle calls to new-style closures. The code
	to handle old-style closures, which was unnecessarily duplicated for
	each code model, stays until all the installed compilers use the new
	closure representation.

	Until that time, the new entry point will contain code to detect
	the use of old-style closures and invoke the old code instead.
	This allows stage1s compiled with old compilers to use the old style
	and stage2 to use the new style without any special tricks anywhere
	else.

	Add a new entry point to handle method calls of all code models.
	The old entry points, which had the same code, will also be deleted
	after this change has been bootstrapped.

runtime/mercury_calls.h:
	Remove the macros that call closures. Their interface sucked, they
	were not used, and their implementation is now out of date.

runtime/mercury_stack_layout.h:
	Add a new type, MR_Type_Param_Locns, for use by the C type
	representing closures. Since MR_Stack_Layout_Vars has a field,
	MR_slvs_tvars, which references a data structure identical
	in every way to MR_Type_Param_Locns, change the type of that field
	to this new type, instead of the previous cheat.

runtime/mercury_layout_util.h:
	Minor update to conform to the new type of the MR_slvs_tvars field.
	(This is the only use of that field in the system.)

runtime/mercury_type_info.h:
	Add new types MR_TypeInfo and MR_PseudoTypeInfo. For now, they
	are just Word, but later we can make them more accurate.
	In the meantime, we can refer to them instead of to Word,
	making code clearer. One such reference is now in mercury_ho_call.h.

compiler/notes/release_checklist.html:
	Add a reminder to remove the redundant code from mercury_ho_call.c
	after bootstrapping.

compiler/llds.m:
	Replace three code addresses for calling closures and another three
	for calling methods with one each.

compiler/call_gen.m:
compiler/dupelim.m:
compiler/opt_debug.m:
compiler/opt_util.m:
compiler/llds_out.m:
	Trivial updates in accordance with the change to llds.m

compiler/code_info.m:
	Move the code to handle layouts to continuation_info.m,
	since that's where it belongs. Leave only the code for picking
	up parameters from code_infos and for putting results back in there.

	Remove the redundant arguments of code_info__init, and extract
	them from ProcInfo, to make clear that they are related.

compiler/code_gen.m:
	Since we pass ProcInfo to code_info__init, don't pass its components.

compiler/continuation_info.m:
	Add the code moved from code_info.m, in a form which takes explicit
	arguments for things that used be hidden in the code_info.

	Add new code, closely related to the moved code, that creates
	layout info from a procedure's argument info, rather than from a
	(part of) the current code generator state. This way, it can be
	invoked from places that don't have a code_info for the procedure
	for which they want to generate layouts. This is the case when
	we generate layouts for closures.

compiler/par_conj_gen.m:
compiler/trace.m:
	Minor changes required by the move of stuff from code_info to
	continuation_info.

compiler/stack_layout.m:
	Export some predicates for use by unify_gen.

compiler/unify_gen.m:
	Switch to creating new style closures, complete with layout info.

	Optimize the code for extending closures a bit. By copying the
	fixed words of the closure outside the loop, we avoid incurring
	the loop overhead twice.

compiler/code_util.m:
	Add a couple of utility predicates for continuation_info.m and
	unify_gen.m

library/benchmarking.m:
library/std_util.m:
	Refer to the new entry point for handling closures.

browser/dl.m:
	Use the new closure representation.

	Note that extras/dynamic_linking/dl.m, which is supposed to be
	the same as browser/dl.m but is not, should also be updated, but
	this will be handled later by Fergus.

tests/hard_coded/closure_extension.{m,exp}:
	A new test case to exercise the code for extending closures.

tests/hard_coded/Mmakefile:
	Enable the new test case.
1999-04-16 06:05:49 +00:00
Tyson Dowd
9e3a8eae9c During the writing of the RTTI paper, we decided that type_ctor_info
Estimated hours taken: 8

During the writing of the RTTI paper, we decided that type_ctor_info
was a much better name than base_type_info.

Rename base_type* as type_ctor*, except we don't rename the modules
base_type_info and base_type_layout just yet.

Most of these changes were made using the following sed patterns:

s/base_type_info/type_ctor_info/g
s/base_type_layout/type_ctor_layout/g
s/base_type_functors/type_ctor_functors/g
s/BASETYPE_INFO/TYPE_CTOR_INFO/g
s/TYPEFUNCTORS/TYPE_CTOR_FUNCTORS/g
s/TYPELAYOUT/TYPE_CTOR_LAYOUT/g
s/BASE_TYPEINFO/TYPE_CTOR_INFO/g
s/BASE_TYPE_INFO/TYPE_CTOR_INFO/g
s/BaseTypeInfo/TypeCtorInfo/g
s/BaseTypeLayout/TypeCtorLayout/g
s/base_type(/type_ctor(/g
s/:- module type_ctor_info/:- module base_type_info/g
s/:- module type_ctor_layout/:- module base_type_layout/g
s/type_ctor_info__/base_type_info__/g
s/type_ctor_layout__/base_type_layout__/g
/import_module/s/type_ctor_info/base_type_info/g
/import_module/s/type_ctor_layout/base_type_layout/g

compiler/*.m:
library/*.m:
runtime/*.{c,h}:
profiler/demangle.m:
util/mdemangle.c:
	Applied the above sed commands.

runtime/mercury_bootstrap.h:
	Add bootstrapping #defines so the type_ctor_* substitutions in
	the library don't cause link problems.

	Delete some redundant bootstrapping definitions.
1999-03-22 08:09:52 +00:00
Zoltan Somogyi
f7dae2f885 Add two new types:
Estimated hours taken: 0.1

library/std_util.m:
	Add two new types:

	:- type maybe_error ---> ok ; error(string).
	:- type maybe_error(T) ---> ok(T) ; error(string).

	We should think about replacing several types in
	io.m with instances of these.
1999-03-12 01:20:28 +00:00
Fergus Henderson
469036b27c Add parentheses to use of `some' in type declaration for has_type/2,
Estimated hours taken: 0.1

library/std_util.m:
        Add parentheses to use of `some' in type declaration for has_type/2,
	to avoid syntax error for SICStus Prolog.
1999-02-07 14:07:24 +00:00
Fergus Henderson
7e0b766779 Fix a memory allocation bug reported by
Estimated hours taken: 6

Fix a memory allocation bug reported by
Warwick Harvey <wharvey@cs.monash.edu.au>.

library/std_util.m:
runtime/mercury_type_info.c:
	Use `newmem()' rather than `malloc()' when allocating memory
	that will contain Mercury terms or types.  This is needed
	because the Boehm collector does not trace memory allocated
	with malloc().
1999-01-28 11:46:29 +00:00
Fergus Henderson
3ca511d8eb Add parentheses to use of `some' in type declaration for univ_value/1,
Estimated hours taken: 0.1

library/std_util.m:
	Add parentheses to use of `some' in type declaration for univ_value/1,
	to avoid syntax error for SICStus Prolog.
1999-01-05 17:05:06 +00:00
Thomas Conway
b2b99e5b50 Improvements to coroutining support. These changes allow us to do
Estimated hours taken: 20

Improvements to coroutining support. These changes allow us to do
provide io primatives that cause the Mercury context to suspend rather
than causing the engine to block.

configure.in:
	Test to see if we can handle contexts that block on IO
	using select().

compiler/pragma_c_gen.m:
	Include the predicate name in the calls to MR_OBTAIN_GLOBAL_C_LOCK
	and MR_RELEASE_GLOBAL_C_LOCK for improved debugging.

	Fix a bug where the global lock was not being released when
	semidet pragma c code failed.

runtime/mercury_thread.h:
	Change the global lock macros to include the message generated
	by the changes to pragma_c_gen.

library/char.m:
library/std_util.m:
	include `thread_safe' in the flags for a couple of pragma c
	definitions that seem to have missed out.

runtime/mercury_context.{c,h}:
	Add a list of "pending" contexts that are blocked on a
	file descriptor. When the runqueue becomes empty, we call
	select on all the pending contexts.

	Move schedule from the header file to the c file (changing
	it from a macro to a function) for easier debugging at a
	slight performance cost.

	TODO: add a nonblocking call to select so that we can poll
	for io from time to time rather than waiting till there is
	nothing else to do.

runtime/mercury_reg_workarounds.{c,h}:
	Make functions that forward to the FD_* macros, which on Linux
	attempt to use registers that we've already grabbed. Aarrggh!

runtime/mercury_thread.c:
	Tidy up some of the conditional compilation.

runtime/mercury_types.h:
	Remove the definition of SpinLock since we're not using them
	and are not likely to any time soon.
1998-12-15 00:22:29 +00:00
Fergus Henderson
79cceb4407 Change the standard library to use existential types.
Estimated hours taken: 4

Change the standard library to use existential types.

library/std_util.m:
        Add new existentially typed procedures univ_value/1 and has_type/2.

library/term.m:
library/io.m:
	Use existential types rather than unsafe casts and other hacks.
1998-11-19 06:11:01 +00:00
Zoltan Somogyi
372a3f4c12 Remove a stray . that would cause a C syntax error if COMPACT_ARGS
Estimated hours taken: 0.01

library/std_util.m:
	Remove a stray . that would cause a C syntax error if COMPACT_ARGS
	is not defined.
1998-11-17 00:57:39 +00:00
Fergus Henderson
5a8ff8166a Add an mdb command to invoke the term browser.
Estimated hours taken: 2

Add an mdb command to invoke the term browser.

trace/mercury_trace_internal.c:
	Add code to implement a new command `browse', which invokes
	the interactive term browser in browser/browse.m.

doc/mdb_categories:
doc/user_guide.texi:
	Document the new `browse' mdb command.
	Also simplify the documentation on the `print' command.

browser/browse.m:
	Change browse/3 so that it takes an argument of type `T' rather
	than `univ'.

library/std_util.m:
	Modify ML_expand() so that it does not abort for values of type
	c_pointer, type_info, or array(T).  This is to prevent the
	browser from aborting when trying to display values of those types.
1998-11-15 14:00:34 +00:00
Zoltan Somogyi
620ce80408 Make stack layout structures work in grades that do not have static code
Estimated hours taken: 16

Make stack layout structures work in grades that do not have static code
addresses. (Although it seems that those grades do not work in the absence
of layout structures.)

compiler/llds_out.m:
	If an entry label has a layout structure, then during its
	initialization, output a macro that will, if necessary,
	initialize the code address inside its layout structure.

	Do not output a const before a layout structure if the macro
	will actually initialize a code address inside it.

compiler/llds.m:
	Separate out proc_layouts from internal_layouts in the type
	data_name, since only proc_layouts have code addresses in them.

	Clarify the existing documentation of the label type's alternatives.
	This should help prevent the recurrence of bugs like the one in
	mercury_goto.h.

compiler/stack_layout.m:
	Replace code addresses inside proc layout structures with a dummy
	value if code addresses are not static.

runtime/mercury_goto.h:
	Fix a long-standing bug: init_local should treat its argument
	as a procedure entry label, not as a label internal to a procedure.

runtime/mercury_stack_layout.h:
	In the macros for creating proc layouts by hand-written C code,
	allow for the absence of static code addresses, and add a new
	macro that fills in the code address slot in proc layouts
	at initialization time if necessary.

library/benchmarking.m:
library/private_builtin.m:
library/std_util.m:
	Add calls to the new initialization macro to accompany hand-written
	proc layout structures.
1998-11-12 03:16:29 +00:00
Fergus Henderson
10de5678fc Fix various gcc warnings.
Estimated hours taken: 1

Fix various gcc warnings.

library/std_util.m:
library/benchmarking.m:
extras/trailed_update/tests/func_trail_test.m:
extras/trailed_update/tests/func_trail_test_2.m:
	Add some casts -- without these, the code might not compile
	with compilers other than gcc.

library/private_builtin.m:
	Avoid the use of nested extern declarations, by moving
	the declarations out of the enclosing function.

runtime/mercury_array_macros.h:
	Initialize `element' in MR_bsearch().
	Without this, gcc reports lots of spurious warnings when
	compiling trace/*.c.
1998-11-05 16:35:29 +00:00
Zoltan Somogyi
8caba4e15d Make it possible to compile a module (e.g. std_util) without debugging,
Estimated hours taken: 18

Make it possible to compile a module (e.g. std_util) without debugging,
while still allowing debuggable code called from that module via higher-order
predicates (e.g. solutions) to have a proper stack trace.

compiler/options.m:
	Add the new option --stack-trace-higher-order.

compiler/mercury_compile.m:
	Always invoke continuation_info and stack_layout, since it is no
	longer the case that either all procedures or none get layout
	structures generated for them, and the other modules are in a better
	position to make that decision.

compiler/continuation_info.m:
	Handle the extra tests required by the change to mercury_compile.m.

	When we gather info about a procedure, remember whether that
	procedure must have a procedure layout that includes the procedure id
	section.

compiler/stack_layout.m:
	Use the flag remembered by continuation_info to help decide
	whether we need procedure layout structures.

	Fix an old space wastage: after generating marker saying that
	the second and later groups of fields of a procedure layout are
	not present, do not generate another marker saying that the
	third group of fields is not present. Since it was in the wrong
	position, it did not have the right meaning; it only worked because,
	due to the presence of the first marker, it was never looked at anyway.

compiler/code_gen.m:
	Use the new capability of continuation_info.m to require
	procedure layouts including procedure id sections for any predicate
	that has higher-order arguments, if --stack-trace-higher-order is set.

compiler/globals.m:
	Rename want_return_layouts as want_return_var_layouts, since this
	is a more accurate representation of what the predicate does.

compiler/call_gen.m:
compiler/code_info.m:
	Conform to the change in globals.m.

compiler/llds_out.m:
	Separate the c_modules containing compiler-generated code into two
	groups, those that define labels that have stack layouts and those
	that don't. In most cases one or the other category will be empty,
	but with --stack-trace-higher-order, the c_modules containing
	higher-order procedures will have stack layouts, while others will
	not.

	Reorganize the way the way the initialization functions are generated,
	by putting c_modules falling into different categories into different
	bunches. c_module falling into the first category always have their
	initialization code included, while those in the second category
	have it included only if the old flag MR_MAY_NEED_INITIALIZATION
	is set.

	Delete the obsolete #define of MR_STACK_TRACE_THIS_MODULE.

	Improve some predicate names, in an effort to prevent confusion
	about what a "file" is (since the code uses more than one meaning,
	given the presence of --split-c-files).

compiler/pragma_c_gen.m:
	Fix an old bug: s/NONDET_FIXED_SIZE/MR_NONDET_FIXED_SIZE/.
	Required for the change to library/string.m.

doc/user_guide.texi:
	Document the new option.

runtime/mercury_goto.c:
	Simplify the conditions under which labels get added to the label
	table with:

	- The macros init_{entry,label,local}_ai always add
	the label to the label table without a layout structure.

	- The macros init_{entry,label,local}_sl always add it with a layout
	structure.

	- Whether the macros init_{entry,label,local} with no suffix
	add the label to the label table depends on the values of other
	configuration parameters, but they will never include a layout
	structure.

	The intended use is that any label that has a layout structure should
	be initialized with a _sl macro. Any other label that should always
	be in the label table if the label table is needed at all (labels
	such as do_fail) should be initialized with _ai. Everything else
	should be initialized with a suffixless macro.

runtime/mercury_conf_params.c:
	Remove MR_USE_STACK_LAYOUTS and MR_STACK_TRACE_THIS_MODULE, since
	due to the simplification of mercury_goto.h, they are not used anymore.

runtime/mercury_stack_layout.h:
	Remove the old macros for creating layout structures with bogus
	contents, and replace them with new macros for creating layout
	structures with meaningful contents.

runtime/mercury_engine.c:
runtime/mercury_wrapper.c:
	Remove bogus layout structures. Ensure the labels defined here
	always get into the label table.

runtime/mercury_ho_call.c:
	Remove bogus layout structures. Add proper ones where necessary.

runtime/mercury_bootstrap.c:
runtime/mercury_type_info.c:
	Remove bogus layout structures.

runtime/mercury_boostrap.h:
	Add this new file for bootstrapping purposes.

	Temporarily #define NONDET_FIXED_SIZE as MR_NONDET_FIXED_SIZE, since
	pragma_c_gen.m refers to the former until the update to it gets
	installed.

runtime/Mmakefile:
	Add a reference to mercury_boostrap.h.

library/builtin.m:
	Remove bogus layout structures.

library/array.m:
library/benchmarking.m:
library/private_builtin.m:
	Remove bogus layout structures. Add proper ones.

library/std_util.m:
	Remove bogus layout structures. Add proper ones.

	Replace references to framevar(n) with references to MR_framevar(n+1).

	Fix an old bug in code under #ifndef COMPACT_ARGS: in the
	implementation of mercury____Compare___std_util__univ_0_0_i1, the
	succip register was not being saved across the call to
	mercury__compare_3_0.

library/string.m:
	Remove the need for bogus layout structures, by converting the
	implementation of string__append(out, out, in) from hand-written
	C module into nondet pragma C code.
1998-11-05 03:53:48 +00:00
Peter Ross
2fd0c764d2 Changes to compile the compiler using compilers other then gcc.
Estimated hours taken: 30

Changes to compile the compiler using compilers other then gcc.  Tested
on 'cc -std1', 'cc -std1 -migrate' on the alphas, 'cc' and 'lcc' on the
sparcs.

boehm_gc/linux_threads.c:
    Ensure that the compilation unit isn't empty by always #including at
    least on file.

compiler/llds_out.m:
    Remove all remaining occurences of (const Word *).

compiler/mercury_compile.m:
    Call transform_llds.

compiler/options.m:
    Add the option max_jump_table_size.  This option is needed because
    lcc barfs when the jump_table for computed gotos size is over 128.

compiler/transform_llds.m:
    Transform computed_gotos whose table size is over
    max_jump_table_size to binary search down to computed gotos whose
    table size is less then or equal to max_jump_table_size.

doc/user_guide.texi:
    Document --max-jump-table-size.

library/benchmarking.m:
library/math.m:
library/private_builtin.m:
library/std_util.m:
    s/\\n/\\\\n/g so that we don't get line breaks in string constants.

library/io.m:
    Change an LVALUE_CAST to type Word as RHS of the expression gets
    cast to type Word.

scripts/mgnuc.in:
    lcc gets called with "-w" flag to avoid spurious warnings.  Also if
    --no-ansi is defined pass "-D__EXTENSIONS__" to the compiler to
    ensure that all of the header files are read.

trace/mercury_trace_internal.c:
    Add a cast to (Word *) because LHS of the expression has type (Word *)
1998-10-30 05:12:17 +00:00
Zoltan Somogyi
8a0ceb49aa This checkin has several major purposes, set out in the sections below,
Estimated hours taken: 240

This checkin has several major purposes, set out in the sections below,
all connected with the implementation of the new debugger command set.

DOCUMENT NEW DEBUG COMMAND SET

doc/user_guide.texi:
	Add a new section on the debugger. The description of the commands
	is complete, but some of the background sections, and the section
	about how to build debuggable executables, are not yet done.

	Update the documentation of the tracing options.

doc/generate_mdb_doc:
	A new shell script that automatically converts some of the new
	sections of the user guide into the online documentation of the
	debugger.

doc/mdb_categories:
	The fixed initial part of the online documentation.

doc/Mmakefile:
	Add rules for creating mdb_doc, the file that is the online
	documentation of the debugger, and for installing it together
	with mdbrc.

Mmake.common.in:
	Define INSTALL_DOC_DIR for doc/Mmakefile.

scripts/mdbrc.in:
	A debugger command script that reads in the online documentation
	and then defines some standard aliases.

configure.in:
	Define the variable that scripts/mdb.in and scripts/mdbrc.in use
	to find the right files, and get configure to perform the
	substitutions.

configure.in:
scripts/mdb:
scripts/mdb.in:
	Replace mdb with mdb.in. Mdb is now created during configuration
	from mdb.in, filling in the name of the file that contains the default
	debugger initialization commands.

util/info_to_mdb.c:
	A program that does most of the work involved in automatically
	converting user guide sections into online documentation.
	(This couldn't easily be written in sh, because sh's read
	command has no notion of pushback.)

util/Mmakefile:
	Add info_to_mdb to the list of targets.

tools/bootcheck:
	Make sure that the tests in tests/debugger are executed with an
	initialization setup that is equivalent to what users will see
	by default.

REORGANIZE TRACING OPTIONS

compiler/globals.m:
compiler/handle_options.m:
compiler/options.m:
compiler/trace.m:
	Reorganize the handling of trace levels around the new options
	--trace-internal, --trace-redo, and --trace-return.

compiler/*.m:
	Use the new ways of getting at trace levels.

tests/hard_coded/typeclasses/Mmakefile:
	s/--trace all/--trace deep/

SUPPORT RETRY

compiler/trace.m:
	After every call to MR_trace(), emit code that checks whether it
	should jump away, and if yes, performs the jump. This is used to
	implement retry. (The debugger cannot execute the jump itself
	because it is in the wrong C stack frame.)

compiler/llds.m:
compiler/continuation_info.m:
compiler/stack_layout.m:
	Modify the data structures that record information about live
	value at program points, to record the identity of each variable.
	This is necessary for the implementation of the restart command,
	since we do not want to confuse two distinct variables just because
	they have the same name. For example, a variable whose name is X
	and number is 5 is now recorded in the name array as "5:X".

	Clean up the data structure a bit, so that we don't have to store
	dummy names for values that are not variables.

compiler/*.m:
	Minor changes to conform to the data structure changes.

runtime/mercury_stack_layout.h:
	Redefine an existing macro to strip away the initial number: prefix
	from the "name" of a variable (keeping its original function on
	changed data), and add a new one to access the raw unstripped data.

runtime/mercury_init.h:
runtime/mercury_wrapper.h:
	Update the prototype of MR_trace_{fake,real}, and the type of the
	global that points to them.

runtime/mercury_layout_util.h:
	Add an extra function, MR_get_register_number, for use by retry.

USE FIXED STACK SLOTS FOR TRACE INFO

compiler/code_gen.m:
compiler/code_info.m:
compiler/live_vars.m:
compiler/trace.m:
	If execution tracing is enabled, reserve the first few stack slots
	to hold the event number of the call event, the call number, the
	call depth, the redo layout structure address (if generating redo
	events) and the from_full flag at the time of call (if we are doing
	shallow tracing). By allocating the first four of these to fixed stack
	slots, the debugger knows where to look for them without having
	to be told. It finds out the location of the fifth, if needed,
	from a new slot in the proc layout structure. (It is not possible
	to allocate all five to fixed stack slots without wasting stack space
	in some cases.)

compiler/trace.m:
	Remove from the call to MR_trace the parameters that are now in fixed
	stack slots, since MR_trace can now look them up itself.

compiler/continuation_info.m:
compiler/stack_layout.m:
	Add an extra field to the proc_layout_info. If the module is shallow
	traced, this field says which stack slot holds the saved value of
	MR_from_full. If it is not shallow traced, this field says that
	there is no such stack slot.

runtime/mercury_stack_layout.h:
	Add macros for accessing the fixed stack slots holding the event
	number of the call event, the call number, the call depth, and,
	at a redo event, the redo layout structure address.

	Support the new field in proc layouts that gives the location of the
	from-full flag (if any).

runtime/mercury_trace_base.[ch]:
trace/mercury_trace.[ch]:
	Remove the call number and call depth arguments from MR_trace
	and its avatars, since this info is now in fixed stack slots
	in every procedure that can call MR_trace. This should reduce
	the size of the executable significantly, since there are lots
	of calls to MR_trace.

runtime/mercury_init.h:
runtime/mercury_wrapper.h:
	Update the prototype of MR_trace_{fake,real}, and the type of the
	global that points to them.

START NUMBERING FRAMEVARS FROM ONE

compiler/code_info.m:
compiler/live_vars.m:
compiler/llds_out.m:
compiler/trace.m:
	Start numbering framevars from 1 internally to the compiler;
	the runtime already starts from 1. This simplifies several tasks.

ADD REDO EVENTS

compiler/trace.m:
compiler/code_gen.m:
	Before the code that executes "succeed()", emit code to push a
	a temp nondet frame whose redoip points to a label in the runtime
	that calls MR_trace for a REDO event and then fails, provided
	--trace-redo is set.

compiler/llds.m:
	Add a new code address constant, do_trace_redo_fail, which stands
	for the address in the trace system to which calls MR_trace for
	the redo event and then fails.

compiler/trace.m:
compiler/llds_out.m:
	Provided we are doing redo tracing, fill in the slot that holds
	the layout information for the REDO event.

compiler/*.m:
	Minor changes to conform to handle the new code address constant.

browser/debugger_interface.m:
	Add redo to trace_port_type.

runtime/mercury_trace_base.[ch]:
	Add a C module containing the code that calls MR_trace for REDO
	events.

ENSURE THAT INPUT ARGUMENTS ARE ALWAYS VISIBLE

compiler/trace.m:
	When generating the set of live variables at internal ports,
	the variables that are in the pre-death set of the goal into which
	we are entering may not be available. However, the variables in the
	pre-death set that are also in the resume vars set will be available,
	so now include info about them in the layout structure for the event.
	Since with tracing the non-clobbered input args are in all resume vars
	sets, this ensures that these input args will be available from all
	internal events.

compiler/code_info.m:
	Export a previously internal predicate (current_resume_point_vars)
	to make this possible.

BUG FIX: WANT RETURN LAYOUTS

compiler/globals.m:
compiler/call_gen.m:
compiler/code_info.m:
compiler/mercury_compile.m:
	Add a new pred globals__want_return_layouts, which says whether the
	compiler should generate layout structures for call returns. This pred
	centralizes the several previous copies of the test. One of those
	copies (the one in call_gen) was faulty, leading to a bug: in the
	presence of execution tracing but the absence of accurate gc,
	information about the variables that are live at the call return
	wasn't being gathered properly.

BUG FIX: #include mercury_trace_base.h

compiler/llds_out.m:
	#include mercury_trace_base.h, not mercury_trace.h, since now
	mercury_trace_base.h defines everything directly accessible from
	modules compiled with tracing.

RECAST MERCURY_TRACE_UTIL AS MERCURY_LAYOUT_UTIL

runtime/mercury_trace_util.[ch]:
runtime/mercury_layout_util.[ch]:
	Rename this module from trace_util to layout_util, since it is also
	used by the native garbage collector. Remove "trace" from the names
	of functions.

	Get rid of the global variable MR_saved_regs, and instead thread
	a pointer to this data structure through the relevant functions
	as an extra argument.

	Add a lot more documentation in the header file.

runtime/Mmakefile:
	Reflect the module rename.

runtime/*.c:
	Refer to the new module.

DELETE EASY-TO-MISUSE MACROS

runtime/mercury_stacks.h:
	Delete the based_framevar and based_detstackvar macros, since their
	continued use can lead to off-by-one errors, and the saved_framevar
	and saved_detstackvar macros, since they are no longer used.

runtime/*.c
	Update any references to any macros removed from mercury_stacks.h.

MISC RUNTIME CHANGES

runtime/mercury_trace_base.[ch]:
trace/mercury_trace*.[ch]:
	Make typedef'd names conform to the naming convention.

	Make MR_trace_call_{seqno,depth} consistently Unsigned, rather than
	sometimes Word and sometimes Unsigned.

FIX BUG: MAKE THE DEBUGGER PRINT TO STDOUT, NOT THE CURRENT STREAM

library/io.m:
	Export to C code the predicates that return the identities and types
	of stdin, stdout and stderr, as well as io__print/[34].

library/std_util.m:
	Export to C code a predicate that returns the type_info for the
	type stdutil:type_info. This type_info is required if C code
	wants to invoke make_permanent on any type_info structure,
	as the debugger does.

runtime/mercury_init.h:
	Add extern declarations for the C functions now exported from io.m.

runtime/mercury_wrapper.[ch]:
	Add new global variables to hold the addresses of these C functions.

runtime/mercury_layout_util.c:
	Use indirect calls through these global variables to print Mercury
	values, instead of lower-level code.

util/mkinit.c:
	Assign the addresses of the functions exported from io.m to the
	global variables defined in mercury_wrapper.h.

BUG FIX: STACK TRACE FUNCTIONS DEPEND ON THE LABEL TABLE

runtime/mercury_stack_trace.c:
	On entry to any of the functions exported from this module,
	ensure that the label table is loaded by calling do_init_modules.
	Without a filled-in label table, the stack trace will not be able to
	find any stack layout info.

BUG FIX: REMOVE BROWSER/*.C

configure.in:
	When removing .c files generated by the C compiler, remove those
	in the browser directory as well as the compiler, library and
	profiler directories.

IMPLEMENT NEW DEBUGGER COMMAND SET

runtime/mercury_stack_trace.[ch]:
	Factor out the code that prints the id of a procedure into a function
	of its own, so that it can also be used from the debugger, ensuring
	appearance commonality.

	Add more documentation in the header file.

trace/mercury_trace_internal.c:
	Implement the proposed command set. Command names are now words,
	and several commands now have options allowing the user to override
	the default print level or strictness of the command, or the
	invocation conditions or action of a break point. Allows control
	over command echoing and the scrolling of sequences of event reports.
	Supports aliases, command file sourcing etc. Implements the retry
	command, using the info in the fixed stack slots.

trace/mercury_trace.[ch]:
	Extend the trace controls to support the new functionalities
	required by the new debugger language, which are print levels,
	variable-strictness commands, a more flexible finish command,
	and the retry command.

	Pass the command structure to MR_trace_event_report, since
	the user can now forcibly terminate the scrolling of reports.

trace/mercury_trace_alias.[ch]:
	New module to manage aliases for the debugger.

trace/mercury_trace_help.[ch]:
	New module to interface to browser/help.m.

trace/mercury_trace_spy.[ch]:
	New module to manage break points. The test of whether an event
	matches a break point is now much more efficient than before.
	The new module also allows several breakpoints with different
	actions and different invocation conditions (e.g. all ports,
	entry port, interface ports or specific (possibly internal) port)
	to be defined on the same procedure.

trace/mercury_trace_tables.[ch]:
	New module to manage a table of the debuggable modules, in which
	each such module is linked to the list of the layouts of all the
	procedures defined in that module. This information allows the
	debugger to turn the name of a predicate/function (possibly together
	with its arity and mode number) into the procedure layout structure
	required by the spy point module. Eventually it may also be useful
	in supplying lists of identifiers for command line completion.

	Modules for which no stack layout information is available will
	not be included in the table, since do_init_modules will not
	register any labels for them in the label table.

trace/Mmakefile:
	Mention the new files.

runtime/mercury_array_macros.h:
	A new file holding macros that can be useful in more than one module.

runtime/Mmakefile:
	Mention the new file.

runtime/mercury_conf.h.in:
	Mention a new configuration macro, MR_CANNOT_USE_STRUCTURE_ASSIGNMENT,
	used by runtime/mercury_array_macros.h.

configure.in:
	Find out whether we need to define MR_CANNOT_USE_STRUCTURE_ASSIGNMENT.

ADD TRACE DEPTH HISTOGRAMS

runtime/mercury_conf_param.h:
	Document MR_TRACE_HISTOGRAM.

runtime/mercury_trace_base.[ch]:
	Define the data structures for the histogram, and print the histogram
	when a traced program exits if MR_TRACE_HISTOGRAM is set.

trace/mercury_trace.[ch]:
	If MR_TRACE_HISTOGRAM is defined, record a count of the number of
	events at each depth. This information can help us evaluate space-time
	tradeoffs.

FACTOR OUT SHELL CODE HANDLING GRADE IMPLICATIONS

scripts/final_grade_options.sh-subr:
	A new file to contain any code that implements implications between
	grade flags; currently implements the implication debug -> use trail.

scripts/mgnuc.in:
scripts/ml.in:
	Replace the code that is now in final_grade_options.sh-subr with
	an inclusion of final_grade_options.sh-subr.

configure.in:
	Handle final_grade_options.sh-subr as {init,parse}_grade_options.sh-subr
	are handled.

SIMPLIFY THE MAINTAINANCE OF CONSISTENCY BETWEEN DEBUGGER CODE AND DOCUMENTATION

doc/Mmakefile:
	Add rules for creating mdb_command_list, a C code fragment
	that can included manually in trace/mercury_trace_internal.c
	to supply the list of valid commands, and mdb_command_test.inp,
	which is a list of invalid invocations of debugger commands,
	which tests whether the help message for such invocations
	can be located as expected.

doc/generate_mdb_command_list:
doc/generate_mdb_command_test:
	Awk scripts to create mdb_command_list and mdb_command_test.inp
	respectively from mdb_doc.

tools/bootcheck:
	Copy mdb_command_test.inp from doc to tests/debugger.

tests/debugger/Mmakefile:
	Add a new test that checks whether we get an internal error, unable
	to locate the right help node, for each invalid command invocation in
	mdb_command_test.inp.

UPDATE TEST CASES

tests/debugger/Mmakefile:
	Reenable queens. Conform to the new set of options.

tests/debugger/*.inp:
tests/debugger/*.exp:
	Update the inputs and expected outputs of the debugger test cases
	to use the new command set and output formats.
1998-10-16 06:20:28 +00:00
Fergus Henderson
abd526580f Another fix to my change to ensure that the declarations and definitions
Estimated hours taken: 0.5

Another fix to my change to ensure that the declarations and definitions
for data constants specify the same linkage (extern or static).
This one is needed to make it work with --split-c-files.

runtime/mercury_goto.h:
	Add an `MR_' prefix to the MODULE_STATIC_OR_EXTERN.

library/array.m:
library/builtin.m:
library/std_util.m:
extras/clpr/cfloat.m:
	Use MR_MODULE_STATIC_OR_EXTERN instead of `static' on the hand-coded
	definitions of the base_type_functors and base_type_layouts for
	builtin types.
1998-09-04 11:26:10 +00:00