Commit Graph

958 Commits

Author SHA1 Message Date
Tyson Dowd
10315a1cb3 Fix CPU recognition problems with the Pentium 4.
Estimated hours taken: 0.75
Branches: main release dotnet-foreign

Fix CPU recognition problems with the Pentium 4.

The P4 reports its CPUID as "15" which is pretty unexpected
as previously Intel chips used numbers such as "4", "5" and "6".

Many scripts assumed the pattern i?86 or i[345678]86 would match
x86 chips.

The result of mis-identifying the chip is generally failure to compile,
and even if you do hack around the compilation problems it will almost
certainly fail to build the garbage collector correctly.

config.guess:
config.sub:
configure.in:
scripts/mgnuc.in:
scripts/ml.in:
tools/test_mercury:
	Replace i?86 with i*86, and i[345678]86 with i[0-9]*86.
2001-04-10 15:37:38 +00:00
Fergus Henderson
7f0ff9ac19 Delete an old bootstrapping hack that is no longer needed.
Estimated hours taken: 0.25
Branches: release, main

scripts/mmc.in:
	Delete an old bootstrapping hack that is no longer needed.
2001-04-09 08:54:05 +00:00
Fergus Henderson
8bc8db5018 Delete some accidentally duplicated code.
Estimated hours taken: 0.25
Branches: main

scripts/mmake.in:
	Delete some accidentally duplicated code.
	The code for handling `--no-use-subdirs' was there twice.
2001-03-20 02:10:34 +00:00
Fergus Henderson
151502a160 Don't enable -Wpointer-arith, since for gcc < 3.0 it causes too many
Estimated hours taken: 0.25
Branches: release, main

scripts/mgnuc.in:
	Don't enable -Wpointer-arith, since for gcc < 3.0 it causes too many
	spurious warnings in system header files.  (This is fixed in gcc 3.0,
	though, so at some point we should re-enable it.)
2001-03-20 02:01:34 +00:00
David Jeffery
19ceeaf30f Merge the changes from the HAL branch onto the main branch.
Estimated hours taken: 40
                       (to do this merge... 100s of hours on the HAL branch
		        itself by myself and Warwick Harvey though).

Merge the changes from the HAL branch onto the main branch. With the recent
changes made to the HAL implementation, this means adding just one grade,
`.rt' or --reserve-tag, which reserves one tag (zero) in each type for
use by HAL's Herbrand constraint solver. This disables no-tag types and
enumerations.

This grade will now bootstrap, and passes all tests, except for a few failing
cases in the debugger and tabling directories.

compiler/options.m:
compiler/handle_options.m:
	Add the `.rt' or --reserve-tag grade option.
runtime/mercury_conf_param.h:
	Document the macro MR_RESERVE_TAG
doc/user_guide.texi:
	Document the `.rt' grade.

compiler/make_hlds.m:
	Don't record any types as no-tag types if we are in a .rt grade.
compiler/make_tags.m:
compiler/type_ctor_info.m:
	Allocate tags starting from `1' in .rt grades.
compiler/rtti_out.m:
	In .rt grades, output a dummy ptag definition for tag `0'.
compiler/type_util.m:
	Add predicates `type_util__constructors_are_dummy_argument_type' and
	`type_constructors_are_type_info' for use when allocating tags to
	ensure that type infos and dummy types (io__state/0 and store__store/1)
	are still treated as no-tag types in .rt grades.

library/sparse_bitset.m:
	When allocating a sparse bitset element, use tag `1' if we are in a
	.rt grade.

runtime/mercury_tags.h:
	Define a macro `MR_UNIV_TAG' which is `1' is we in a .rt grade and
	`0' otherwise. (Now that univ is a user defined type, it is a also
	assigned a `var' tag).
	Also make the definitions of MR_RAW_TAG_NIL and MR_RAW_TAG_CONS take the
	.rt grade into account.
runtime/mercury_type_info.h:
	Define `MR_unravel_univ' and
	`MR_initialise_univ' for taking apart and putting together univs.

	Add a new secondary tag alternative: MR_SECTAG_VARIABLE, used to
	represent Herbrand variables.

library/std_util.m:
	Use MR_UNIV_TAG, MR_unravel_univ and MR_initialise_univ when
	manipulating univs.

	Handle the new MR_SECTAG_VARIABLE secondary tag by aborting.

runtime/mercury_deep_copy_body.h:
runtime/mercury_tabling.c:
runtime/mercury_unify_compare_body.h:
	Handle the new MR_SECTAG_VARIABLE secondary tag by aborting.

library/std_util.m:
	Add a constant for MR_SECTAG_VARIABLE in the MC++ back end.

scripts/canonical_grade.sh-subr:
scripts/init_grade_options.sh-subr:
scripts/mgnuc.in:
scripts/parse_grade_options.sh-subr:
	Process the new grade.

scripts/mmake.in:
	Add an option `--include-makefile', which includes a Makefile given
	as a command line argument into the Makefile generated by mmake.
	This is used to implement `halmake', a make program for HAL which
	just passes a bunch of extra rules and variable definitions onto
	mmake.

tests/debugger/existential_type_classes.m:
tests/hard_coded/existential_types_test.m:
trace/mercury_trace_declarative.c:
trace/mercury_trace_external.c:
trace/mercury_trace_internal.c:
	Use MR_UNIV_TAG.

TODO:
	- The declarative debugger falls over in .rt grades. This is possibly
	  because compiler/static_term.m assumes that the generated code uses
	  the same data representation as the compiler itself. This should be
	  fixed, although it is not critical; the declarative debugger won't
	  work with trailing as is, and the .rt grade is only ever used in
	  conjunction with trailing (.tr) at this stage.
2001-03-18 23:10:17 +00:00
Tyson Dowd
96eac21430 Modify Mmakefiles so that we don't try to install unnecessary
Estimated hours taken: 1
Branches: main release

boehm_gc/Mmakefile:
browser/Mmakefile:
trace/Mmakefile:
	Modify Mmakefiles so that we don't try to install unnecessary
	subsystems in IL grades.

runtime/Mmakefile:
	Add some support for installing the MCPP_HDRS and the DLLs in IL
	grades (largely untested).
	Fix some missing dependencies on the 'install_dirs' target.

library/Mmakefile:
scripts/Mmake.rules:
	Remove the check for ils_subdir, as this appears to be a
	cut-and-paste error -- the rules it surrounds are not for doing
	subdir builds.
	Use a clearer test for il as a substring in GRADE.
2001-03-16 01:40:43 +00:00
Fergus Henderson
9dcfc8663e Fix a problem where the nightly tests were failing the `--target asm'
Estimated hours taken: 0.5
Branches: main release

Fix a problem where the nightly tests were failing the `--target asm'
tests, because they were passing `--pic-reg', and that option was
being used with different semantics for the gcc back-end.

scripts/Mmake.rules:
	Use `--pic' rather than `--pic-reg'.
	(I forgot to commit this with my earlier changes.)
2001-03-11 16:52:45 +00:00
Fergus Henderson
3360d1cb59 Fix some more bugs in the handling of `DEFAULT_GRADE' and the
Estimated hours taken: 0.5

scripts/init_grade_options.sh-subr:
scripts/parse_grade_options.sh-subr:
	Fix some more bugs in the handling of `DEFAULT_GRADE' and the
	`-s<grade>' option.  Obviously this code had never been exercised.
2001-02-11 14:53:41 +00:00
Fergus Henderson
e09f36c7dd Fix another cut-and-paste error: change the second "case 0)" to
Estimated hours taken: 0.25

scripts/parse_grade_options.sh-subr:
	Fix another cut-and-paste error: change the second "case 0)" to
	"case *)".
2001-02-11 14:20:44 +00:00
Fergus Henderson
e74fb9ca42 Fix a cut-and-paste error: change the second "case 0)" to "case *)".
Estimated hours taken: 0.25

scripts/init_grade_options.sh-subr:
	Fix a cut-and-paste error: change the second "case 0)" to "case *)".
	This broke the default grade setting.
2001-02-11 12:47:40 +00:00
Fergus Henderson
787b241fc6 Fix a bug: s/allow_undefined/allow_undef/,
Estimated hours taken: 0.25

scripts/ml.in:
	Fix a bug: s/allow_undefined/allow_undef/,
	to match the variable name used elsewhere in this script.
2001-02-11 04:42:45 +00:00
Julien Fischer
9602919bbe Added new compiler options to support the Java backend and
Estimated hours taken: 4

Added new compiler options to support the Java backend and
updated documentation to reflect this.

compiler/globals.m:
	Removed comment about Java backend not being implemented.
	Replaced it by one say that it is work in progress.

compiler/mercury_compile.m:
	If Target = java then call the Java backend.

compiler/options.m:
	Added new options for compiling Java files:
	`--java'
	`--java-only'
	`--java-compiler' ('--javac')
	`--java-flags'
	`--java-classpath'
	`--java-object-file-extension'

compiler/handle_options.m:
	If compiling to Java then don't link.
	Added "java" grade.

compiler/mlds_to_java.m
	New file.
	XXX Currently just prints an error message about
	    the Java backend not being implemented.

doc/user_guide.texi:
	Documented new options for compiling Java files.

scripts/init_grade_options.sh-subr:
scripts/parse_grade_options.sh-subr:
scripts/final_grade_options.sh-subr:
	Added support for "java" grade.
2001-01-29 01:55:08 +00:00
Fergus Henderson
81d6a2316b Work-around gcc bug that broke library/table_builtin.m when built
Estimated hours taken: 1

scripts/mgnuc.in:
	Work-around gcc bug that broke library/table_builtin.m when built
	with `MCFLAGS = -O6' and `--intermodule-optimization'.
	GNU C version egcs-1.1.2 reported the following error message:
		table_builtin.c: In function `table_builtin_module':
		table_builtin.c:1880: fixed or forbidden register 3 (bx)
		was spilled for class GENERAL_REGS.
		This may be due to a compiler bug or to impossible asm
		statements or clauses.
	The work-around is to compile with `-O0'.
2001-01-28 10:23:11 +00:00
Fergus Henderson
05475302fd Add Mmake support for building code that uses the C interface
Estimated hours taken: 4

Add Mmake support for building code that uses the C interface
with the GCC back-end.

The GCC back-end already compiles code using the C interface to a
separate C file.  This changes add Mmake support for compiling that
file and linking it into the final executable (or library).

scripts/Mmake.rules:
	Add a rule for building the *__c_code.{o,pic_o} files.

compiler/modules.m:
	Add field names to the `modules_import' type.
	Add a new field `foreign_code' which records whether
	or not the module contains foreign code.
	For target asm, if the module does contain foreign code,
	include the *__c_code.o files as extra object files to link.

compiler/intermod.m:
compiler/mercury_compile.m:
	Trivial changes to reflect the new field of the modules_import
	type.
2001-01-24 13:18:26 +00:00
Fergus Henderson
624651fb03 Fix a bug in the Mmake support for shared libraries
Estimated hours taken: 0.75

Fix a bug in the Mmake support for shared libraries
for `--target asm'.

scripts/Mmake.rules:
	When generating the `.pic_s' file, pass `--pic-reg' to mmc.
	(XXX we should perhaps use a different option,
	e.g. `--pic', for this.)

compiler/mlds_to_gcc.m:
	If `--pic-reg' is passed, generate the output in a `.pic_s'
	file, rather than a `.s' file.
2001-01-24 06:28:34 +00:00
Fergus Henderson
da1f8c7f6a Fix a bug where the Mmake rule for making `.pic_s' files didn't work,
Estimated hours taken: 0.5

Fix a bug where the Mmake rule for making `.pic_s' files didn't work,
because it was passing $(CFLAGS_FOR_PIC), i.e. `-fpic -DPIC',
to the GCC back-end, but the GCC back-end didn't understand `-DPIC'.
(The GCC *driver* understands `-D', as does the GCC C front-end,
but the back-end doesn't.)

scripts/Mmake.vars.in:
	Define new variable GCCFLAGS_FOR_PIC, and set it to `-fpic'.

scripts/Mmake.rules:
	In the rule for making `.pic_s' files, use $(GCCFLAGS_FOR_PIC)
	instead of $(CFLAGS_FOR_PIC).
2001-01-23 16:12:56 +00:00
Fergus Henderson
67df9a7894 Add some comments explaining that the `--target il' option is
Estimated hours taken: 0.25

scripts/mmake.in:
	Add some comments explaining that the `--target il' option is
	not supported.  Issue a warning if it is used.
2001-01-17 09:16:51 +00:00
Fergus Henderson
3de6904858 Merge my recent changes on the gcc-backend-branch back onto
Estimated hours taken: 0.5

mercury/Mmake.common.in:
mercury/configure.in:
mercury/compiler/Mmakefile:
mercury/compiler/maybe_mlds_to_gcc.pp:
mercury/compiler/mercury_compile.m:
mercury/compiler/mlds_to_gcc.m:
mercury/compiler/modules.m:
mercury/runtime/mercury_type_info.h:
mercury/runtime/mercury_wrapper.c:
mercury/runtime/mercury_wrapper.h:
mercury/scripts/Mmake.rules:
mercury/scripts/Mmake.vars.in:
mercury/scripts/final_grade_options.sh-subr:
mercury/scripts/init_grade_options.sh-subr:
mercury/scripts/mmake.in:
mercury/scripts/parse_grade_options.sh-subr:
gcc/Make-lang.in:
gcc/Makefile:
gcc/Mmakefile:
gcc/lang-specs.h:
gcc/mercury-gcc.c:
	Merge my recent changes on the gcc-backend-branch back onto
	the main branch.
2001-01-17 02:45:07 +00:00
Tyson Dowd
53f2dbc1b4 First implementation of the standard library in managed C++.
Estimated hours taken: 200

First implementation of the standard library in managed C++.

configure.in:
	Autodetect the .NET SDK, and set MS_DOTNET_SDK_DIR based on it.
	Find the IL assembler, and set ILASM.

compiler/inlining.m:
	Turn off inlining of pragma_foreign_code with the IL backend.

compiler/mlds_to_c.m:
	Add a comment questioning the foreign language interfacing still to be
        done in this backend, and remove the "inline target code" from
        this list (since it has been completed).

compiler/mlds_to_il.m:
	Generate code for :- external.  We generate a forwarding
	function to the expected implementation in
	<modulename>__c_code.cpp

	Rename all the classes to use MixedCase, and to put them in the
	mercury.runtime namespace.

compiler/mlds_to_ilasm.m:
	Don't use the System or mercury namespaces by default.
	Change the names of the runtime cpp files to mercury_mcpp.dll
	and mercury_il.dll.
	Use c_util to output unops and binops.

doc/user_guide.texi:
	Document MS_CL_NOASM, MS_CLFLAGS and EXTRA_MS_CLFLAGS.

library/*.m:
	Rename pragma c_code as pragma foreign_code("C", ...).
	Add pragma foreign_code for MC++.
	Only a fraction of the predicates are implemented, everything
	else simply throws and exception when called.
	Implementations of predicates marked with :- external are
	provided as pragma foreign_code, but are commented out.

library/Mmakefile:
runtime/Mmakefile:
	Add targets for building the dlls for the library.

runtime/mercury_mcpp.cpp:
runtime/mercury_mcpp.h:
	Implementation of the runtime.

runtime/mercury_il.il:
	This file mainly implements things that can't be written in
	managed C++ (e.g. function pointers).

scripts/Mmake.rules:
scripts/Mmake.vars.in:
        Add rules for generating .dlls and .exes from .ils and .cpps.
2001-01-01 04:04:05 +00:00
Zoltan Somogyi
7e0a04f17c Add options to configure that allow the user to specify the set of library
Estimated hours taken: 8

Add options to configure that allow the user to specify the set of library
grades to be installed more precisely.

configure.in:
	Add an option --enable-libgrade=<gradelist> that specifies
	the list of library grades precisely.

	Add an option, --disable-most-grades, that reduces the installed
	grades to a "minimum" level for developers (asm_fast.gc,
	asm_fast.gc.debug.tr and hlc.gc), since this is useful to minimize
	installation time e.g. when installing a release of the day on a
	laptop.

	Add an option, --disable-nogc-grades, that prevents the installation
	of grades without garbage collection.

	Add an option, --disable-prof-grades, that prevents the installation
	of profiling grades.

	Add an option, --disable-trail-grades, that prevents the installation
	of trailing grades.

	Add an option, --disable-pair-grades, that prevents the installation
	of thread-safe grades.

.INSTALL.in:
	Mention the new configure options, as well as some previously
	undocumented old ones.

scripts/canonical_grade.in:
	A new script to be used by configure.in. Its jobs is to print the
	canonical version of a grade string.

scripts/canonical_grade.sh-subr:
	A new sh subroutine, containing code previously from ml.in that is
	now also needed by canonical_grade.in.

scripts/ml.in:
	Move code from here to canonical_grade.sh-subr.

Mmakefile:
	Include scripts/canonical_grade in tar files, since configure.in
	needs it.

bindist/Mmakefile:
	Include scripts/canonical_grade in binary distributions, since
	configure.in needs it.
2000-12-18 07:17:44 +00:00
Fergus Henderson
f9a1b60349 Fix a buggy regexp in my previous change.
Estimated hours taken: 0.1

scripts/mtags:
	Fix a buggy regexp in my previous change.
2000-12-11 10:43:11 +00:00
Fergus Henderson
b922c9287e Output tags for field names.
Estimated hours taken: 0.5

scripts/mtags:
	Output tags for field names.
2000-12-11 09:58:07 +00:00
Fergus Henderson
bc34d2adc6 Fix a bug with the Mmake dependencies for il' and .rlo'
Estimated hours taken: 0.5

compiler/modules.m:
	Fix a bug with the Mmake dependencies for `il' and `.rlo'
	files in cases of code involving nested modules where the
	source file name doesn't directly match the fully-qualified
	module name.

scripts/Mmake.rules:
	Fix a cut-and-paste error in the rule for creating `.il' files.
2000-12-09 11:03:10 +00:00
Fergus Henderson
7e40904f02 Fix a couple of bugs:
Estimated hours taken: 1

scripts/ml.in:
	Fix a couple of bugs:
	- it was using $compiler instead of $COMPILER
	- it was assuming that compilers other than gcc and lcc understand
	  the `-static' option
2000-12-09 07:36:19 +00:00
Fergus Henderson
a14d0ab6bf Fix to work with Emacs 20.4.1 on Linux.
Estimated hours taken: 2

scripts/gud.el:
	Fix to work with Emacs 20.4.1 on Linux.
	There were several problems:
	(1) The gud-redirect-io stuff was broken, since it relies on ttys,
	    and apparently Emacs now just uses pipes rather than ttys.
	    For now I've just disabled that by setting gud-redirect-io
	    to false (nil).
	(2) There were some bugs in the code for the case where gud-redirect-io
	    was false (nil):
	    - I'd accidentally omitted the `progn' around the body of an
	      if-then-else, and thus accidentally written `if (...) A else B'
	      when I had intended to write `if (...) { A; B; }'.
	    - One part of the code was assuming that the gud-prog-buffer
	      variable was set, but this was only true for the case where
	      gud-redirect-io was true (t).
2000-12-05 07:07:00 +00:00
David Overton
d1a768cdb5 Modify the options to mtags to make them more complete and to
Estimated hours taken: 3

scripts/mtags:
	Modify the options to mtags to make them more complete and to
	simplify the implementation of the output function.  There are
	now three orthogonal low-level options (`--keep-duplicates',
	`--search-definitions' and `--extended-attributes') and
	several high-level options (`--emacs', `--vim', `--elvis',
	`--traditional-vi', and `--simple') which set combinations of
	low-level options appropriate for various editors.

	Also, make `--vim' the default option.  This creates a tags
	file which allows vim to make use of its extended
	tags-handling facilities while remaining backwards compatible
	with vi.

NEWS:
	Mention changes to mtags.
2000-12-04 05:43:38 +00:00
David Overton
5067f1aebf Allow mode declarations using ==' as well as ::'.
Estimated hours taken: 0.5

scripts/mtags:
	Allow mode declarations using `==' as well as `::'.
	Strip trailing whitespace from constructor names before
	outputting to the tags file.  (Tag lookups of constructors
	should actually work properly now.)
2000-12-04 02:10:55 +00:00
Fergus Henderson
a68373aa39 Support using `lcc' as the C compiler.
Estimated hours taken: 6

Support using `lcc' as the C compiler.
I've tested this on i686-pc-linux-gnu, using grade `none.gc'.

This is not a complete fix; it still fails a few test cases which I
haven't investigated yet.  They might be due to bugs in lcc.

configure.in:
	Some more fixes so that `configure' works with CC set to a compiler
	other than gcc:
	- Fix a bug in the autoconf test for using sockets.
	  The code here was assuming that the second argument
	  to the AC_TRY_LINK macro was some C code at global
	  scope (e.g. containing definitions of functions
	  and global variables), but in fact the argument is a C
	  function body.  By chance this worked anyway with gcc,
	  because gcc supports nested functions!  But it didn't
	  work with other C compilers.
	- Fix a bug where it was assuming that asm labels
	  work on alpha*-dec-*; this is true for gcc, but
	  not for other C compilers.
	- Set the `-I' options in CPPFLAGS rather than in CFLAGS,
	  so that they get used for `AC_CHECK_HEADER'.
	- For Irix, don't assume that we should use grade reg.gc
	  unless the compiler is gcc.
	- Make sure that we use CFLAGS_FOR_GOTOS and/or CFLAGS_FOR_REGS
	  when running the tests for non-local gotos and/or global
	  registers.

boehm_gc/gcconfig.h:
	If __LCC__ is defined, use the generic C version of GC_push_regs()
	rather than the version implemented using inline assembler, since
	lcc doesn't support inline assembler.

scripts/mgnuc.in:
	If `--no-ansi', is specified, pass `-D_GNU_SOURCE' to the C compiler.
	This is needed for lcc, because lcc always passes `-DPOSIX_SOURCE',
	and so we need to explicit pass `-D_GNUC_SOURCE' to enable all the
	stuff in the standard header files.

scripts/ml.in:
	Change the way we pass options to the linker, since the syntax
	for this is slightly different in lcc than it is for gcc.
2000-12-01 03:22:21 +00:00
Fergus Henderson
77c3805338 Remove `-Wtraditional'. In my previous change, I added a
Estimated hours taken: 0.1

scripts/mgnuc.in:
	Remove `-Wtraditional'.  In my previous change, I added a
	comment about why it was removed, but forgot to actually
	remove it!
2000-11-25 13:15:07 +00:00
Fergus Henderson
cbd6937986 Change the sequence of ex commands that we put in the tags
Estimated hours taken: 0.75

scripts/mtags:
	Change the sequence of ex commands that we put in the tags
	file (in the default and `--keep-duplicates' configurations),
	so that for pred/func tags, hitting `n' after the tag will
	take you straight to the procedure's clauses (assuming they
	start in column 1), rather than just going to the next use
	of that name.
2000-11-21 13:47:01 +00:00
Fergus Henderson
2a83de4d09 Use /\b...\b/ to skip whitespace when matching the
Estimated hours taken: 0.25

scripts/mtags:
	Use /\b...\b/ to skip whitespace when matching the
	`:- interface' and `:- implementation' declarations.
2000-11-18 16:26:44 +00:00
Fergus Henderson
72565412b8 Add Mmake support for generating `.il' files.
Estimated hours taken: 1

Add Mmake support for generating `.il' files.
Note that this change does NOT add rules for generating
`.dll' or `.exe' files from the `.il' files.

scripts/Mmake.vars.in:
	Set the ils_subdir variable.

scripts/Mmake.rules:
	Add a pattern rule for creating `.il' files.

compiler/modules.m:
	Add code to emit the dependencies for `.il' files.
	Add code to emit the `<main-module>.ils' variable
	and the `<main-module>.ils' target.
	Also fix a bug where it wasn't handling the `.rlos'
	target correctly when --use-subdirs was enabled.
2000-11-17 07:34:17 +00:00
Fergus Henderson
94b62ae1f6 Don't pass `-Wtraditional' to GNU C, since this results in
Estimated hours taken: 0.25

scripts/mgnuc.in:
compiler/mercury_compile.m:
	Don't pass `-Wtraditional' to GNU C, since this results in
	many warnings with gcc 2.96, e.g. about the use of ANSI C
	preprocessor constructors such as string concatenation and
	indented `#define'.  We don't care about compatibility with
	pre-ANSI C compilers.
2000-11-17 03:50:12 +00:00
Fergus Henderson
018fc359f2 Delete some debugging code (`set -x') that zs left in
Estimated hours taken: 0.1

scripts/c2init.in:
	Delete some debugging code (`set -x') that zs left in
	(apparently accidentally) in his last commit.
2000-11-05 04:15:34 +00:00
Zoltan Somogyi
2ac218f9a7 This is part 2 of a change that provides a register of all the types defined
Estimated hours taken: 4

This is part 2 of a change that provides a register of all the types defined
in the program.

util/mkinit.c:
	After part 1 of this change, each compiler-generated module has three
	initialization functions: the old one (to register label addresses
	etc), one to register type_ctor_infos, and one to register module
	layouts for the debugger. However, only the first was invoked from
	the mkinit generated <mainmodule>_init.c file.

	This change invokes the other two as well. One complication is that
	hand-written "modules" do not have the two new kinds of initialization
	functions, so only their first initialization function should be
	called. We do this by requiring those "modules" to have one of two
	specific forms: an initial prefix of either sys_init or
	mercury_sys_init.

scripts/c2init.in:
	Rerrange the mechanism we use to allow the overriding of the locations
	of the init files to be passed to mkinit. The previous mechanism used
	a single environment variable, MERCURY_MOD_LIB_MODS, to hold the names
	of these init files. While the default setting of this variable was
	conditional on whether the --trace option was given to c2init
	(including the init file for the browser only with --trace),
	there was no way to override the default value in a similarly
	conditional manner. This is now a problem, because including the
	browser init file in the list of init files passed to mkinit will
	cause mkinit to emit code that causes the browser's modules to be
	linked in, without also linking in the libraries (e.g. -ldl) on which
	the browser depends. The reason why this hasn't bitten us earlier
	is that the code that drags in the browser was #ifdef'ed out
	in the first initialization function; the reason why it would
	bite us now is that it is *not* #ifdef'ed out in the second
	initialization function (the one that register type_ctor_infos).

	The new mechanism uses two environment variables, MERCURY_MOD_LIB_MODS
	and MERCURY_TRACE_LIB_MODS, with the first normally containing
	the filenames of the init files of the runtime and library directories
	and the second the filename of the init file of the browser directory.
	The value of the second environment variable is passed to mkinit
	only if c2init is invoked with the --trace flag.

	There is also a new environment variable MERCURY_TRACE_LIB_DIR,
	which has a role parallel to MERCURY_MOD_LIB_DIR.

compiler/Mmakefile:
profiler/Mmakefile:
tools/bootcheck:
	Specify the filename of the browser init file in
	MERCURY_TRACE_LIB_MODS.

library/array.m:
library/builtin.m:
library/private_builtin.m:
library/std_util.m:
	Add code to initialization functions to register the type_ctor_infos
	of hand-defined types.

	Note that this code is in the usual initialization function, the one
	called by do_init_modules(). Putting this code in a separate
	initialization function that is called by do_init_modules_type_tables()
	would require complicating mkinit.c considerably.

runtime/mercury_wrapper.c:
	Make do_init_modules_type_tables() call do_init_modules(), so that
	calling do_init_modules_type_tables() guarantees the registration
	of all the type_ctor_infos in the program, including the hand-defined
	ones.

runtime/mercury_context.c:
	Make the name of the handwritten module follow the convention now
	required by mkinit.
2000-10-31 07:54:11 +00:00
Peter Ross
f165b14514 Chnages to handle that the latest cygwin architecture id string is
Estimated hours taken: 0.25

ml.in:
    Chnages to handle that the latest cygwin architecture id string is
    no longer contains 32.
2000-10-27 09:19:07 +00:00
David Overton
eb94c4d7f4 Fix pattern matching code for implementation' and interface'
Estimated hours taken: 0.5

scripts/mtags:
	Fix pattern matching code for `implementation' and `interface'
	declarations.
2000-10-06 06:37:15 +00:00
Fergus Henderson
0f88e6e50a Fix two bugs in my previous fix for the `-lm' portability problem:
Estimated hours taken: 0.75 (about half of it by Tyson)

configure.in:
	Fix two bugs in my previous fix for the `-lm' portability problem:
	- AC_CHECK_LIB should have been AC_HAVE_LIBRARY
	- SHARED_LIB needed to be valid as *both* Make and sh syntax.
	  To fix this one, we've added a new variable SHARED_LIB_SH
	  which has the sh-syntax version of it, while SHARED_LIB now
	  has the Make-syntax version of it.

scripts/ml.in:
	Use SHARED_LIB_SH rather than SHARED_LIB.

bindist/bindist.build_vars.in:
	Pass on the value of SHARED_LIB_SH.
2000-09-24 08:52:12 +00:00
Fergus Henderson
7a7d709aaf For Linux, add `-ldl' to THREAD_LIBS.
Estimated hours taken: 0.5

scripts/ml.in:
	For Linux, add `-ldl' to THREAD_LIBS.
	This avoids link errors in grade asm_fast.par.gc.
	Also add some comments.
2000-09-22 08:27:30 +00:00
Fergus Henderson
4e725be273 Fix a bug in the Mercury 0.9 binary distribution.
Estimated hours taken: 0.25

Fix a bug in the Mercury 0.9 binary distribution.

bindist/bindist.Makefile.in:
	Change EMACS_SCRIPTS to INSTALL_EMACS_SCRIPTS,
	to match the name used in the install_emacs_scripts rule.
2000-09-22 08:23:45 +00:00
Fergus Henderson
d1c4f80e86 Improve the documentation about the use of -DNO_SIGNALS and
Estimated hours taken: 0.25

runtime/mercury_prof_mem.h:
runtime/mercury_prof_mem.c:
	Improve the documentation about the use of -DNO_SIGNALS and
	the use of malloc/GC_malloc in the profiling signal handler.

boehm_gc/Makefile:
scripts/mgnuc.in:
	Add pointers to the documentation in runtime/mercury_prof_mem.h.
2000-09-21 05:01:11 +00:00
Fergus Henderson
3f52368009 When invoking mercury_compile to check whether it supports
Estimated hours taken: 0.25

scripts/mmc.in:
	When invoking mercury_compile to check whether it supports
	`--cflags-for-threads', make sure that we redirect stdin
	from /dev/null, to ensure that the test doesn't hand if
	debugging is enabled.
2000-09-18 07:06:32 +00:00
Fergus Henderson
50ce611dd7 Add a work-around for a bootstrapping problem with my
Estimated hours taken: 0.25

scripts/mmc.in:
	Add a work-around for a bootstrapping problem with my
	previous change to use `--cflags-for-threads'.
2000-09-16 00:08:38 +00:00
Fergus Henderson
385d38b5cf Fix a bug: mmc wasn't passing the right flags to the C compiler
Estimated hours taken: 2

Fix a bug: mmc wasn't passing the right flags to the C compiler
when `--parallel' was specified.

configure.in:
	Set CFLAGS_FOR_THREADS, using code adopted from the code
	in scripts/mgnuc.in.

scripts/mgnuc.in:
	Use CFLAGS_FOR_THREADS rather than doing the case analysis
	here.

scripts/mmc.in:
	Pass `--cflags-for-threads $CFLAGS_FOR_THREADS' to mercury_compile.

compiler/options.m:
	Add a new option `--cflags-for-threads', for use by scripts/mmc.in.

compiler/mercury_compile.m:
	If --parallel is enabled, pass the --cflags-for-threads
	options to the C compiler.

bindist/bindist.build_vars.in:
	Pass on CFLAGS_FOR_THREADS.
2000-09-16 00:08:37 +00:00
Tyson Dowd
6d78224020 Add new options and grades for the IL back-end.
Estimated hours taken: 24	(by fjh)

Add new options and grades for the IL back-end.

Implement an option to handle output parameters for nondeterministic
procedures by passing the outputs (by value) to the continuation,
rather than using pass-by-reference.  This is needed for IL
because IL does not allow managed pointers (which we used to
implement pass-by-refernece) to be stored as fields of environment
structs.

Also add an option to return outputs by value in det/semidet code.
This is not yet tested, since none of our target languages support
returning multiple values.

(Note that the IL backend is not activated by these changes -- it
hasn't been checked in).

compiler/globals.m:
	Use field names for the globals structure.
	Add new `target' field to the globals.

compiler/options.m:
compiler/handle_options.m:
	Add new options `--target', `--target-only', `--il', and `--il-only'.
	`--target' specifies the output langauge (e.g. C or IL).
	`--target-only' says to only compile to the output language
	(e.g. similar to -C or --compile-to-c option).
	`--il' sets target to IL.
	`--il-only' sets target to IL and specifies --target-only.

	Add new grades `il' and `ilc'.
	These grades are used for compiling to il grades.  `il' is the
	normal `il' grade, while `ilc' uses low-level (C-like) data
	representations.

	Change `--compile-to-c' from a boolean option to an abbreviation
	for `--target c --target-only', and move it from the "Output options"
	section to the "Compilation model options" section.

	Comment out the documentation for `--generate-prolog' and
	`--prolog-dialect', since those options are not yet implemented.

	Document the `--infer-all' option.

compiler/mercury_compile.m:
	Check the `target_code_only' option rather than `compile_to_c',
	since the latter is just an abbreviation now, not a real option.

compiler/ml_call_gen.m:
compiler/ml_code_gen.m:
compiler/ml_code_util.m:
compiler/ml_unify_gen.m:
	Use the `--det-copy-out' option to decide whether to pass
	output arguments for model_det/model_semi procedures by
	reference, or whether to just return multiple values.
	Use the `--nondet-copy-out' option to decide whether to pass
	output arguments for model_non procedures by reference, or
	whether to just pass them to the continuation.

compiler/mlds.m:
        Change the mlds__cont_type so that it includes a list of
        the continuation's argument types (if any).

compiler/mlds_to_c.m:
        Update to reflect the change to mlds.m.

doc/user_guide.texi:
        Update the documentation to reflect the above changes.


scripts/parse_grade_options.sh-subr:
	Add new options `--target' and `--il'.

scripts/init_grade_options.sh-subr
        Add new grades `il' and `ilc'.

scripts/final_grade_options.sh-subr
        Make `--target il' imply `--high-level-code'.
2000-09-16 00:08:30 +00:00
Peter Ross
7d946d77f4 Build the hlc.par.gc grade using MSVC.
Estimated hours taken: 32

Build the hlc.par.gc grade using MSVC.

boehm_gc/NT_MAKEFILE:
	Seperate the rules for building libpar_gc.lib and libgc.lib as
	they use different makefiles.
	Use gc.mak to build libpar_gc.dll
	Note the thread safe garbage collector must be built as a dll
	according to the README.win32 documentation.

boehm_gc/gc.mak:
	Change the name from gc.dll to libpar_gc.dll
	This gets built in the Release directory.

boehm_gc/Mmakefile:
	Remove the Release directory as well.

scripts/mgnuc.in:
scripts/ml.in:
	Pass the appropiate flags to the c compiler and the linker to
	build in hlc.par.gc grade.

util/mkinit.c:
	Delete a duplicate reference to GC_stackbottom.
2000-09-06 11:04:44 +00:00
Peter Ross
056876130d Apply suggestion of fjh and allow LINK environment variable to be
Estimated hours taken: 0.1

scripts/ml.in:
    Apply suggestion of fjh and allow LINK environment variable to be
    overidden by the user.
2000-08-31 14:46:43 +00:00
Peter Ross
4a80e125d3 Set the default stack size to 10Mb when linking programs
Estimated hours taken: 0.1

scripts/ml.in:
	Set the default stack size to 10Mb when linking programs
	compiled with MSVC.
2000-08-25 14:19:35 +00:00
Fergus Henderson
d7ed113ec6 Support installing both .par' and non-.par' versions of the GC library.
Estimated hours taken: 3

Support installing both `.par' and non-`.par' versions of the GC library.

scripts/ml.in:
	Change the code for computing which version of the GC library
	to link in so that it also takes the `.par' grade component
	into account, rather than just the `.prof' grade component.
	Add new options `--print-gc-grade' (for use by the top-level
	Mmakefile) and `--print-grade' (for symmetry).

Mmakefile:
	When invoking sub-makes in the boehm_gc directory,
	pass down GC_GRADE instead of PROF.
	Compute the GC_GRADE value using `scripts/ml ... --print-gc-grade`
	rather than computing it manually, since this avoids code duplication.

boehm_gc/Mmakefile:
boehm_gc/Makefile:
boehm_gc/NT_MAKEFILE:
	s/gc$(PROF)/$(GC_GRADE)/g

runtime/Mmakefile:
trace/Mmakefile:
browser/Mmakefile:
bytecode/Mmakefile:
library/Mmakefile:
compiler/Mmakefile:
profiler/Mmakefile:
	Change the code for computing which version of the GC library
	to link in so that it also takes the `.par' grade component
	into account, rather than just the `.prof' grade component.
2000-08-17 05:31:11 +00:00
Zoltan Somogyi
173f8c24b7 Rename excp as exception.
Estimated hours taken: 0.5

Rename excp as exception.

doc/user_guide.texi:
	Document the new name.

trace/mercury_trace_internal.c:
	Recognize the new name.

scripts/mdbrc.in:
	Recognize "e" and "excp" as aliases for "exception".
2000-07-19 01:35:01 +00:00