Commit Graph

958 Commits

Author SHA1 Message Date
Simon Taylor
8ee89867fc Finish off the change to make ml' and c2init' take the
Estimated hours taken: 0.5
Branches: main

Finish off the change to make `ml' and `c2init' take the
same set of options.

scripts/Mmake.vars.in:
	Make ALL_MLFLAGS include C2INITFLAGS, EXTRA_C2INITFLAGS, etc.
	ALL_C2INITFLAGS is now equivalent to ALL_MLFLAGS.

doc/reference_manual.texi:
	Change references to C2INITFLAGS to refer to MLFLAGS instead.
2001-12-18 12:13:15 +00:00
Simon Taylor
93f2516efb Write the grade in the header comment in the generated `<module>_init.c' file.
Estimated hours taken: 0.25
Branches: main

Write the grade in the header comment in the generated `<module>_init.c' file.
The `<module>_init.c' file contains grade dependent conditional compilation,
so the `<module>_init.o' file must be rebuilt when the grade changes.

util/mkinit.c:
	Add an option `-g' for the grade.
	Add the grade to the header comment.

scripts/c2init.in:
	Pass the grade to mkinit.

scripts/Mmakefile:
scripts/canonical_grade.sh-subr:
	canonical_grade.sh-subr is now used by c2init.
2001-12-18 05:44:17 +00:00
Simon Taylor
bb885a0807 Address Fergus's review comments.
Estimated hours taken: 0.25
Branches: main

scripts/parse_ml_options.sh-subr.in:
	Address Fergus's review comments.
2001-12-06 14:39:51 +00:00
Simon Taylor
5c9f6f5841 Combine the options for ml and c2init. Once mmake has been
Estimated hours taken: 1
Branches: main

Combine the options for ml and c2init. Once mmake has been
altered to pass MLFLAGS to c2init users will be able to
mostly ignore the existence of c2init.

This change requires an installed compiler which uses `--init-c-file'
rather than `-o' to name c2init's output file. This is difficult to
test for in configure.in.

Bootstrap CVS tag: bootstrap_20011203_init_c_file_c2init_option

scripts/parse_ml_options.sh-subr.in:
	Parse the combined options for ml and c2init.

	The `-o' and `--output' options for c2init have been removed
	(`-o' conflicts with a linker option), use `--init-c-file' instead.

configure.in:
	Add parse_ml_options.sh-subr.in to the list of files to substitute.

scripts/ml.in:
scripts/c2init.in:
	Include parse_ml_options.sh-subr.

scripts/Mmakefile:
	ml and c2init depend on parse_ml_options.sh-subr.
2001-12-03 03:11:26 +00:00
Simon Taylor
285dc19732 Finish the change to allow installed Mercury libraries to be
Estimated hours taken: 0.2
Branches: main

Finish the change to allow installed Mercury libraries to be
used directly by mmc.

bootstrap CVS tag: bootstrap_20011119_fullarch_opt

scripts/mmc.in:
	Pass the value of the `--fullarch' option determined
	at configuration time.

configure.in:
	Test for the `--fullarch' option. Remove an old test
	for `.c_date' files.
2001-11-19 07:25:08 +00:00
Simon Taylor
161226cc22 This is the first part of a change to make c2init and ml take
Estimated hours taken: 0.25

This is the first part of a change to make c2init and ml take
the same set of options (the c2init options will be added as
an "Initialization options" section of the ml options). When
this change is complete, users will only need to add `--trace'
to MLFLAGS, not C2INITFLAGS as well. c2init is an implementation
detail that users shouldn't need to know about.

scripts/c2init.in:
	Remove the `-l' short form of the `--library' option,
	since it conflicts with the use of `-l' as a linker option.

	Add `--no-main' as a synonym for `--library', which will
	cause less confusion with the `--make-shared-lib' ml
	option. `--library' will still be accepted for backwards
	compatability because the C interface samples refer to it.

	Add `--init-c-file' as a synonym for `-o' and `--output'.
	The latter two will be removed after mmake and mmc are
	changed to use `--init-c-file' because they don't make
	sense as ml options.
2001-11-13 08:28:05 +00:00
Fergus Henderson
2a897087f7 Allow for the possibility of comments and blank lines in `:- type'
Branches: main
Estimated hours taken: 1

scripts/mtags:
	Allow for the possibility of comments and blank lines in `:- type'
	declarations.
2001-10-31 14:57:12 +00:00
Simon Taylor
286462b554 Define the $(useds_subdir) variable, which is used
Estimated hours taken: 0.5
Branches: main

scripts/Mmake.vars.in
	Define the $(useds_subdir) variable, which is used
	by the clean target. This fixes recompilation test
	case failures on mars.
2001-10-28 18:04:12 +00:00
Simon Taylor
c697725315 The compiler usually considers a file extension to include the `.',
Estimated hours taken: 0.25
Branches: main

The compiler usually considers a file extension to include the `.',
so pass `.o' rather than `o' as the value of `--object-file-extension'.
This change avoids the need to handle `--executable-file-extension' (which
can be empty) as a special case.

scripts/mmc.in:
	Pass `.o' as the value of `--object-file-extension', rather than `o'.

compiler/mercury_compile.m:
	Remove code to prepend a `.' to the value of `--object-file-extension'
	before passing it to `module_name_to_file_name'.

compiler/options.m:
	Update the default values for the various `--*-extension' options
	to include the `.'.
2001-10-02 07:09:45 +00:00
Simon Taylor
fe350bd3bf Back out my change to pass -I- options to gcc to avoid
Estimated hours taken: 0.25

compiler/mercury_compile.m:
scripts/mgnuc.in:
boehm_gc/Makefile:
	Back out my change to pass -I- options to gcc to avoid
	Mercury generated header files clashing with system
	header files. The change doesn't work with the GCC
	sources.
2001-09-05 16:52:54 +00:00
Simon Taylor
bcccddd2f1 Don't allow header files generated by the Mercury compiler
Estimated hours taken: 6
Branches: main, release

scripts/mgnuc.in:
compiler/mercury_compile.m:
	Don't allow header files generated by the Mercury compiler
	to override the system header files. Unfortunately, this fix
	only works with GCC. We should avoid generating header files
	which clash with system headers.

	This fixes a problem that caused the compiler compiled with
	`--intermodule-optimization' to go into an infinite loop during
	termination analysis while compiling list.m. I think this problem
	was triggered by Tyson's change to implement exception handling
	for the .NET backend, which added a `:- pragma export' declaration
	to library/math.m. The generated library/math.h file was being
	selected in preference to /usr/include/math.h, which was causing
	compiler/term_pass1.c to be miscompiled by GCC.

	This change should't be needed at the moment. My change to improve
	error handling in the library removed the `:- pragma export'
	declaration from math.m.
2001-09-05 13:28:57 +00:00
Simon Taylor
5bbf28f105 Fix a bug in my change to add timestamps for `.c' files
Estimated hours taken: 0.5
Branches: main

scripts/Mmake.rules:
	Fix a bug in my change to add timestamps for `.c' files
	which broke installation of user libraries. Move the `.c_date'
	file into the temporary directory with the `.c' file while
	building the library to install in all the different grades.
2001-08-14 16:48:42 +00:00
Peter Ross
6909db9721 Add a rule to build an executable from a C# source file.
Estimated hours taken: 0.1
Branches: main

scripts/Mmake.rules:
    Add a rule to build an executable from a C# source file.
2001-08-14 08:19:31 +00:00
Peter Ross
bd19fe9e3e Optionally generate strongly named assemblies on the IL backend.
Estimated hours taken: 8
Branches: main

Optionally generate strongly named assemblies on the IL backend.

Strongly named assemblies are required by some aspects of the .NET
framework.  For example, when creating COM+ components.

We use the fact that you are allowed use the same key pair to sign more
then one assembly.  The key pair we use is the one used to sign the
mercury std library.  This allows us to place the correct public key
token in the `.assembly extern' reference.

README.DotNet:
    Document how to generate a strongly named assembly.

compiler/mlds_to_csharp.m:
compiler/mlds_to_mcpp.m:
    If --sign-assembly is enabled output a custom attribute which
    references the strong name key file `mercury.sn'.

compiler/mlds_to_il.m:
    If --sign-assembly is enabled add the correct decls to all the
    `.assembly extern' declarations.

compiler/modules.m:
    If --sign-assembly we need to generate a dependency between the IL
    file and the strong name key file `mercury.sn', also add the
    variable ILASM_KEYFLAG-<module> so that we add the option to sign
    the assembly with the key file `mercury.sn'.

compiler/options.m:
    Add --sign-assembly.

library/Mmakefile:
    Install the library strong name file as `mercury.sn' in the dll
    install directory.

scripts/Mmake.rules:
    Add a rule to copy mercury.sn into the local subdirectory.  This is
    needed so that cpp and csharp modules can reference this file.

scripts/Mmake.vars.in:
    Add the ILASM_KEYFLAG variables.
2001-08-12 13:29:17 +00:00
Simon Taylor
5180ce3f39 Add a comment documenting why $(rlos_subdir) is set to the
Estimated hours taken: 0.1
Branches: main

scripts/Mmake.vars.in:
	Add a comment documenting why $(rlos_subdir) is set to the
	empty string, even with --use-subdirs.
2001-08-06 14:13:06 +00:00
Simon Taylor
6d1e43394d The Aditi query shell does not know about --use-subdirs,
Estimated hours taken: 0.2
Branches: main

The Aditi query shell does not know about --use-subdirs,
so put all the files it uses in the current directory.

compiler/modules.m:
	Put `.rlo', `.base_schema' and `.derived_schema' files
	in the current directory.

scripts/Mmake.vars.in:
	Set $(rlos_subdir) to the empty string, even with --use-subdirs.

compiler/rl_out.pp:
	Create the directory when creating the `.derived_schema' file.
	This isn't necessary any more, but will be needed if we ever
	go back to putting the `.derived_schema' file in a sub-directory.
2001-08-06 12:54:27 +00:00
Tyson Dowd
8496ab341a Implement the array operations (in C#).
Estimated hours taken: 2
Branches: main

Implement the array operations (in C#).
Add flags for handling compiling C# files in the library directory.

library/Mmakefile:
	Add /t:module to the C# compiler flags.
	We need this because by default C# creates assemblies, but we
	expect the library to be composed of modules.

library/array.m:
	Implement most of the functionality of arrays in C#.
	We still need to implement
		array__make_empty_array/1
		array__resize/4
		array__shrink/3
		array__copy/3
	array__make_empty_array requires more RTTI support (to figure
	out what type of array to create), and array__copy requires an
	implementation of deep_copy.

	You need the latest changes to the compiler which map array(T)
	to System.Array or T[] for this to compile.

scripts/Mmake.rules:
	Add ALL_MS_CSCFLAGS to the C# compiler flags.

scripts/Mmake.vars.in:
	Add MS_CSCFLAGS and associated flags.
2001-08-03 12:30:53 +00:00
Tyson Dowd
e9d95ada12 Change calls to mercury::runtime::convert to System::Covert.
Estimated hours taken: 2
Branches: main

library/builtin.m:
library/private_builtin.m:
library/sparse_bitset.m:
library/string.m:
	Change calls to mercury::runtime::convert to System::Covert.
	Use __box instead of mercury::runtime::Convert::ToObject

runtime/Mmakefile:
	Add a rule to remove the DOTNET_DLLS for clean_local.

runtime/mercury_il.il:
	Remove ConvertImpl class, use unbox and ldobj instead of ToInt32.

runtime/mercury_mcpp.cpp:
	Remove Convert class.

runtime/mercury_mcpp.h:
	Use __box instead of mercury::runtime::Convert::ToObject

scripts/Mmake.rules:
	Put the local include directory before the installed one when
	compiling with MC++.
	Also fix the rule for .cpp.dll to be the same as the subdir
	rule.
2001-07-31 10:08:03 +00:00
Simon Taylor
8ba417ad67 Fix a bug in my change to add timestamps for `.c' files
Estimated hours taken: 0.5
Branches: main

scripts/Mmake.rules:
	Fix a bug in my change to add timestamps for `.c' files
	which broke `--use-subdirs'.
2001-07-28 06:55:17 +00:00
Fergus Henderson
0b107322f4 Fix a typo: missing line continuation in error message.
Estimated hours taken: 0.1
Branches: main

scripts/mmake.in:
	Fix a typo: missing line continuation in error message.
2001-07-27 17:06:17 +00:00
Fergus Henderson
8b45bd6016 Fix a bug which occurred when combining --target asm with --use-subdirs.
Branches: main, release
Estimated hours taken: 1

Fix a bug which occurred when combining --target asm with --use-subdirs.

scripts/Mmake.rules:
compiler/modules.m:
	The .pic_s files go in the `pic_ss' subdirectory,
	not in the `ss' subdirectory.

scripts/Mmake.vars.in:
	Add `pic_ss_subdir' variable.
2001-07-27 16:06:29 +00:00
Fergus Henderson
080a9de8e1 Fix a typo in the definition of ss_subdir.
Estimated hours taken: 0.1
Branches: main, release

scripts/Mmake.vars.in:
	Fix a typo in the definition of ss_subdir.
	This broke things if you tried to use --target asm with --use-subdirs.
2001-07-27 15:40:26 +00:00
mercury
76b287a421 Fix a bug with the GCC back-end Mmake support that seems to have been
Branches: main
Estimated hours taken: 2

Fix a bug with the GCC back-end Mmake support that seems to have been
triggered somehow by stayl's .c_date changes.

scripts/Mmake.rules:
	For the *__c_code.{o,pic_o} targets, depend on the .s/.pic_s
	file rather than the .c file, since the .c file is generated
	as a side effect of generating the .s/.pic_s file.
2001-07-27 06:12:31 +00:00
Tyson Dowd
66bbcfc26d Merge the changes to support csharp building into the main branch
Estimated hours taken: 4
Branches: main

Merge the changes to support csharp building into the main branch
of the compiler.

compiler/modules.m:
	Write the CSHARP_ASSEMBLY_REFS-modulename for each C# foreign
	module.

scripts/Mmake.rules:
	Add rules to build C# DLLs.
2001-07-24 14:19:23 +00:00
Peter Ross
2c5af924c0 Remove the .foreign_os target.
Estimated hours taken: 0.25
Branches: main

Remove the .foreign_os target.

compiler/modules.m:
    Don't generate any references to .foreign_os.

scripts/Mmake.rules:
    Remove the .obj file which is created as a side effect by MSVC.
2001-07-18 09:37:34 +00:00
Peter Ross
7fe31d3493 Fix mmake rules to install the ilc grade.
Estimated hours taken: 2.5
Branches: main

Fix mmake rules to install the ilc grade.

library/Mmakefile:
    No longer build mercury_all.dll, instead just use the individual
    library dlls directly as the fixed limit in gacutil has been
    removed.
    Install mercury.dll in the gac.

scripts/Mmake.vars.in:
    Set the location of the mercury library DLLs correctly.

runtime/Mmakefile:
    For the IL backend make install_headers depend on install_lib so
    that the headers get installed during the grade install process.
2001-07-18 08:13:46 +00:00
Peter Ross
9e20b981ea Add mmake support for building modules which contain foreign code on the
Estimated hours taken: 5
Branches: main

Add mmake support for building modules which contain foreign code on the
IL backend.
Note that currently we don't install mercury_il.dll and mercury_mcpp.dll
somewhere where the C compiler can find them, so this change doesn't
work out of the box.

compiler/mlds_to_ilasm.m:
    Change the output file name for cpp files to <modulename>__cpp_code.cpp

compiler/mlds_to_mcpp.m:
    No longer output a reference to <modulename>.dll, as the cpp code
    doesn't refer to any of the entities defined in this dll.

compiler/modules.m:
    If a module contains some foreign code and we are on the IL backend
    generate a dependency which causes the foreign code dll to be built.
    Generate the make variable .foreign, .foreign_cs, .foreign_os and
    .foreign_dlls which refer to all the foreign modules.
    Generate rules to clean the foreign modules up.

scripts/Mmake.rules:
    Turn some unix paths into windows paths.

library/Mmakefile:
    Use the new .foreign variables to build the library instead of the
    previous hacks.
2001-07-17 15:40:38 +00:00
Peter Ross
03f1a1ece3 Improve the mmake support for the IL backend.
Estimated hours taken: 4
Branches: main

Improve the mmake support for the IL backend.
We still need to add code to do the pragma foreign code.

configure.in:
    To determine the extension off executable files use the new macro
    AC_EXEEXT.

compiler/modules.m:
    In the .dep file add a check to see if we are compiling in an IL
    grade.  If so, use a different top level rule.
    Add rules to generate, remove and so on all the .dll files.

scripts/Mmake.vars.in:
    Minor changes.
2001-07-17 08:56:32 +00:00
Zoltan Somogyi
142f66e8e6 Document why we don't uninstall $(EMACS_SCRIPTS) here.
Estimated hours taken: 0.2
Branches: main

scripts/Mmakefile:
	Document why we don't uninstall $(EMACS_SCRIPTS) here.
2001-07-16 08:08:47 +00:00
Zoltan Somogyi
1a0b253854 Add rules for installing the deep profiler from source. (Installing it from
Estimated hours taken: 2
Branches: main

Add rules for installing the deep profiler from source. (Installing it from
binary distributions is future work.)

configure.in:
	Add an option, --enable-deep-profiler=/path/name, that specifies the
	path name of the directory in which the CGI script should be installed
	(the default is apache's /usr/lib/cgi-bin).

	Report an error if the user requests deep profiling but it is not
	available.

Mmakefile:
	Remind the user to copy the CGI script to its directory.

scripts/Mmakefile:
	Document why we can't install the CGI script automatically.

	Be consistent about the order of rules.

scripts/Mmake.vars.in:
	Record the CGI directory for use in the toplevel Mmakefile.

scripts/mdprof.in:
	Record that mdprof_cgi and mdprof_server are installed in the directory
	for non-user-visible programs, alongside mercury_compile and
	mercury_profile.
2001-07-09 04:58:52 +00:00
Simon Taylor
6e46b775b6 Fix a bug in my change to add timestamps for `.c' files.
Estimated hours taken: 0.1
Branches: main

scripts/Mmake.rules:
	Fix a bug in my change to add timestamps for `.c' files.
	Create the subdirectories for the `.c_date', `.il_date',
	`.s_date' and `.pic_s_date' files when running `mmake depend'
	to work around a GNU make bug. (This duplicates similar code
	for `.date' etc. files).

	Fix a typo in the rules for `.pic_s' files.
2001-07-08 11:02:25 +00:00
Simon Taylor
120e4abf0c Fix a bug in my last change - add .PRECIOUS rules for
Estimated hours taken: 0.1
Branches: main

scripts/Mmake.rules:
	Fix a bug in my last change - add .PRECIOUS rules for
	the new date stamp files to stop make removing them.
2001-07-07 05:50:51 +00:00
Simon Taylor
4a7fb746f9 Use a timestamp file mechanism similar to that used for `.int' files
Estimated hours taken: 3

Use a timestamp file mechanism similar to that used for `.int' files
to avoid rechecking whether a module needs to be recompiled on each
mmake if no used interfaces have changed.

compiler/mercury_compile.m:
	Touch a `.c_date', `.il_date', `.s_date' or `.pic_s_date' file
	after compilation has finished.

compiler/recompilation_check.m:
	Touch a `.c_date', `.il_date', `.s_date' or `.pic_s_date' file
	if a module does not need to be recompiled.

compiler/modules.m:
scripts/Mmake.rules:
	Set up the make dependencies for timestamp files, in a similar
	manner to the `.date' files.

	Remove the timestamp files in the `clean' mmake target.

	Handle `.s' and `.pic_s' files as for the `.o' files
	when using `--target asm'. There are no `.s' or `.pic_s'
	files for nested modules.

scripts/Mmake.vars.in:
	Set up the subdir variables for the timestamp files.

Mmakefile:
scripts/mercury_cleanup_install:
	Save/restore the timestamp files and the `.used' files
	across the library grade installation.

configure.in:
	Remove the `.c_date' files for the `.c' files that
	need to be rebuilt.

doc/user_guide.texi:
	Document the new file extensions.
2001-07-06 11:25:36 +00:00
Fergus Henderson
aa6193d139 When searching for the clauses that match a given predicate
Estimated hours taken: 0.5
Branches: main

scripts/mtags:
	When searching for the clauses that match a given predicate
	declaration, assume that the clause has the same number of
	qualifiers as the declaration.  This is more likely to be
	correct than always assuming that the clause has the same
	number of qualifiers as the call, which is what we did previously.

	(The ideal thing to do here would be to search for clauses with
	any number of qualifiers, but that is tricky to do right, because
	the right operator to use for disjunction in the search pattern
	varies depending on the exact vim options set; it could be either
	"|" or "\|".)
2001-07-05 18:13:52 +00:00
Zoltan Somogyi
48dc5aae2c Fix a problem that used to cause installs into not-yet-created directories
Estimated hours taken: 0.5
Branches: main

Fix a problem that used to cause installs into not-yet-created directories
to fail.

scripts/Mmake.rules:
	Instead of invoking $(MC) --errorcheck-only when creating .err files,
	invoke the macros $(MCE).

scripts/Mmake.vars:
	Define the default value of $(MCE) as $(MC) --errorcheck-only.

compiler/Mmakefile:
	Override the default value of $(MCE) to specify the search path,
	just as all the other invocations of the Mercury compiler in this
	directory do. The absence of such override could lead to a raft
	of messages about interface files not being found when trying to
	create maybe_mlds_to_gcc.err.
2001-07-03 09:49:41 +00:00
Simon Taylor
9dd11b2fc6 Smart recompilation. Record version numbers for each item
Estimated hours taken: 400

Smart recompilation. Record version numbers for each item
in interface files. Record which items are used in each compilation.
Only recompile a module if the output file does not exist or
nothing has changed.

There is still some work to do on this:
- it doesn't work with inter-module optimization.
- it doesn't work when the module name doesn't match the file name.
  (this problem will go away when mmake functionality is moved into
  the compiler.

I'll hold off documenting this change in the NEWS file and
on the web page for a month or so, until I've had a bit more
experience using it.

compiler/options.m:
compiler/handle_options.m:
doc/user_guide.texi:
	Add an option `--smart-recompilation', currently off by default.

	Add an internal option `--generate-version-numbers' to control
	whether version numbers are written to the interface files. If
	`--smart-recompilation' is disabled because the module
	is being compiled with `--intermodule-optimization' (e.g. in the
	standard library), we still want to write the version numbers
	to the interface files.

	Add an option `--verbose-recompilation' (default off)
	to write messages describing why recompilation is needed.

	Add an option `--warn-smart-recompilation' (default on)
	to control warnings relating to the smart recompilation
	system. Warn if smart recompilation will not work with
	the output and inter-module optimization options given.

compiler/recompilation.m:
	Type declarations for smart recompilation.
	Predicates to record program items used by compilation.

compiler/recompilation_version.m:
	Compute version numbers for program items in interface files.

compiler/recompilation_usage.m:
	Find all items used by a compilation.

compiler/recompilation_check.m:
	Check whether recompilation is necessary.

compiler/timestamp.m:
	Timestamp ADT for smart recompilation.

compiler/mercury_compile.m:
	Invoke the smart recompilation passes.

compiler/modules.m:
compiler/prog_io.m:
	Return timestamps for modules read.

	When reading a module make sure the current input stream
	is reset to its old value, not stdin.

	Handle version number items in interface files.

compiler/module_qual.m:
compiler/unify_proc.m:
compiler/make_hlds.m:
	Record all items used by local items.

compiler/make_hlds.m:
	Process `:- pragma type_spec' declarations in
	add_item_list_clauses. The qual_info is needed
	when processing `:- pragma type_spec' declarations
	so that any equivalence types used by the declaration
	can be recorded as used by the predicate or function to
	which the `:- pragma type_spec' applies.

compiler/equiv_type.m:
	For each imported item, record which equivalence types
	are used by that item.

compiler/hlds_module.m:
	Add a field to the module_info to store information about
	items used during compilation of a module.

compiler/check_typeclass.m:
	Make sure any items used in clauses for typeclass method
	implementations are recorded in the `.used' file.

compiler/prog_data.m:
compiler/*.m:
	Factor out some duplicated code by combining the
	pred and func, and pred_mode and func_mode items.

	Make it easier to extract the name of a type, inst or mode
	from its declaration.

	Add an item type to hold the version numbers for an interface file.

	Allow warnings to be reported for `nothing' items (used for
	reporting when version numbers are written using an
	obsolete format).

compiler/prog_io.m:
compiler/prog_io_util.m:
compiler/typecheck.m:
compiler/type_util.m:
compiler/*.m:
	Strip contexts from all types, not just those in class constraints.
	This makes it possible to use ordinary unification to check
	whether items have changed (with the exception of clauses).

	Remove code to create types with contexts in typechecking.

	Remove code scattered through the compiler to remove contexts
	from types in class constraints.

compiler/hlds_pred.m:
compiler/prog_util.m:
	Move hlds_pred__adjust_func_arity to prog_util, so that it
	can be used by the pre-hlds passes.

compiler/typecheck.m:
compiler/hlds_module.m:
	Move typecheck__visible_modules to hlds_module.m, so it can
	be used by recompilation_usage.m.

compiler/typecheck.m:
	Add a comment telling where updates may be required if the
	code to typecheck a var-functor unification changes.

compiler/error_util.m:
	Allow writing messages without contexts (used for the verbose
	recompilation messages).

	Add functions to format sym_name and sym_name_and_arity,
	and to add punctuation to the end of an error message
	without unwanted line breaks before the punctuation.

scripts/Mmake.rules:
compiler/modules.m:
	Don't remove the output file before running the compiler. We need
	to leave the old output file intact if smart recompilation detects
	that recompilation is not needed.

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

library/io.m:
NEWS:
	Add predicates to find the modification time of files
	and input_streams.

library/set.m:
NEWS:
	Add a predicate version of set__fold

	Don't sort the output of set__filter, it's already sorted.

library/std_util.m:
NEWS:
	Add a predicate `std_util__map_maybe/3' and a function
  	`std_util__map_maybe/2' to apply a predicate or a function to
    	a value stored in a term of type `std_util__maybe'.

configure.in:
runtime/mercury_conf.h.in:
runtime/RESERVED_MACRO_NAMES:
	When checking whether the compiler is recent enough, check for
	the --warn-smart-recompilation option.

	Check for stat().

library/Mmakefile:
	Disable warnings about smart recompilation not working with
	`--intermodule-optimization'.

browser/Mmakefile:
	Disable warnings about smart recompilation not working when
	the module name doesn't match the file name.

runtime/mercury_string.h:
	Add a macro MR_make_string_const() which automates computation
	of the length of string argument to MR_string_const().

tests/recompilation/Mmakefile:
tests/recompilation/runtests:
tests/recompilation/test_functions:
tests/recompilation/TESTS:
tests/recompilation/README:
	A framework for testing smart recompilation.
	The option currently only works for the recompilation directory.

tests/recompilation/TEST.m.{1,2}:
tests/recompilation/TEST_2.m.{1,2}:
tests/recompilation/TEST.exp.{1,2}:
tests/recompilation/TEST.err_exp.2:
	Test cases, where TEST is one of add_constructor_r, add_instance_r,
	add_instance_2_r, add_type_nr, change_class_r, change_instance_r,
	change_mode_r, field_r, func_overloading_nr, func_overloading_r,
	lambda_mode_r, nested_module_r, no_version_numbers_r,
	pragma_type_spec_r, pred_ctor_ambiguity_r, pred_overloading_r,
	add_type_re, remove_type_re, type_qual_re.

tests/handle_options:
	Add an option `-e' to generate any missing expected output files.
2001-06-27 05:05:21 +00:00
Mark Brown
6f8beed44d Update this file.
Estimated hours taken: 0

scripts/.cvsignore:
	Update this file.
2001-06-25 16:00:26 +00:00
Fergus Henderson
a63454386c Fix some quoting bugs in my previous change.
Estimated hours taken: 0.5
Branches: main

scripts/Mmake.vars.in:
	Fix some quoting bugs in my previous change.
2001-06-18 05:58:15 +00:00
Fergus Henderson
3913870d4a Fix a couple of bugs in Tyson's recent change:
Estimated hours taken: 0.5
Branches: main

scripts/Mmake.vars.in:
	Fix a couple of bugs in Tyson's recent change:
	- $(MS_VISUALCPP_DIR) may contain spaces, and so must be in quotes
	- "/include" uses Unix-style path separators rather than Windows
	  path separators and so should be outside the call to cygpath.
2001-06-18 02:37:04 +00:00
Tyson Dowd
61fc5c0818 Fixes required for .NET Beta 2.
Estimated hours taken: 6
Branches: main

Fixes required for .NET Beta 2.

aclocal.m4:
	Autodetect the C++ compiler and find the VC++ directory from it.

compiler/mlds_to_il.m:
	Put "public" annotations on the IL we generate (private is now the
	default).

library/char.m:
	Fix a use of c_header_code to be foreign_decl("C",

runtime/mercury_il.il:
	Put "public" annotations on the IL (private is now the default).

scripts/Mmake.vars.in:
	Fix the include path and commandline for VC++.
2001-06-14 22:36:24 +00:00
Fergus Henderson
62a1c59b4b Fix a missing newline in the help message.
Estimated hours taken: 0.1
Branches: main, release

scripts/mmake.in:
	Fix a missing newline in the help message.
2001-06-03 16:04:03 +00:00
Mark Brown
ea9a820db8 Add two entries.
Estimated hours taken: 0
Branches: main

scripts/.cvsignore:
	Add two entries.
2001-05-31 10:42:07 +00:00
Zoltan Somogyi
04e614485d Implement deep profiling; merge the changes on the deep2 branch back
Estimated hours taken: 500
Branches: main

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

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

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

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

Mmakefile:
	Add targets for the new directory.

	Add support for removing inappropriate files from directories.

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

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

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

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

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

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

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

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

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

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

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

deep_profiler/measurements.m:
	Operations on profiling measurements.

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

	Add a mechanism for getting proc_ids for procedure clones.

	Remove next_proc_id, an obsolete and unused predicate.

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

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

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

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

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

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

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

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

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

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

	Improve formatting of the generated C code.

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

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

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

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

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

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

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

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

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

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

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

	Add support for watching the value at a given address.

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

	Print register contents only if -dr is specified.

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

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

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

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

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

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

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

	Add support for watching the value at a given address.

runtime/Mmakefile:
	Mention all the added files.

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

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

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

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

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

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

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

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

tests/*/Mmakefile:
tests/*/*/Mmakefile:
	In deep profiling grades, switch off the tests that test features
	that don't work with deep profiling, either by design or because
	the combination hasn't been implemented yet.
2001-05-31 06:00:27 +00:00
Fergus Henderson
273bbc39b5 A small start towards getting the Mercury compiler to run on Mingw,
Estimated hours taken: 5
Branches: main

A small start towards getting the Mercury compiler to run on Mingw,
without Cygwin: add a `mercury.bat' batch file for invoking the Mercury
compiler.

Note that currently Cygwin is still required:
	(1) For `c2init' and `ml'.
	(2) For `mmake'.
	(3) For installation (`configure' and `make install').
	(4) For mercury_update_interface.
	(5) For mkdir.
	(6) For fact tables.

However, there are work-arounds for most of these:
	(1) Currently the only work-around for `c2init' and `ml' is to use
	    the .NET back-end, which doesn't require them.
	(2) `mmake' is not strictly necessary; you can always invoke the
	    necessary commands by hand.  This is of course tedious and
	    error-prone, so we might eventually include more of mmake's
	    functionality into the Mercury compiler itself.
	(3) This would be easy enough to avoid; if we're willing to hard-code
	    the installation path, we could easily package up the installation
	    in a WinZip file or something similar.
	(4) XXX There's no good work-around for this right now.
	(5) Don't use --use-subdirs or --split-c-files.
	(6) Don't use fact tables.

scripts/mercury.bat.in:
	New file.  This is a rewrite of scripts/mmc.in using Windows batch
	file commands rather than Bourne shell.
	Note that this is named mercury.bat.in rather than mmc.bat.in
	because on Windows 2000 the name `mmc' is used for the
	Microsoft Management Console.

configure.in:
bindist/bindist.configure.in:
	Generate scripts/mercury.bat.
	Also add a new autoconf variable WINDOWS_LIBDIR, which is like
	LIBDIR except in Windows path format rather than Cygwin (Unix)
	path format; this is used by scripts/mercury.bat.in.

scripts/Mmakefile:
	Add mercury.bat to the list of scripts to install.
2001-05-27 10:52:08 +00:00
Tyson Dowd
bd732f891c Track the changes in the latest version of the .NET C++ compiler.
Estimated hours taken: 0.5
Branches: main

Track the changes in the latest version of the .NET C++ compiler.

scripts/Mmake.rules:
	Add mscoree.lib to the parameters passed to the C++ compiler.
2001-05-23 09:06:29 +00:00
Simon Taylor
46b8cd7a50 Fix a problem caused by my change to remove the RM_C mmake
Estimated hours taken: 0.1
Branches: main

scripts/Mmake.vars.in:
	Fix a problem caused by my change to remove the RM_C mmake
	variable. RM_C is still referred to by `.d' files generated
	before that change, so it still needs to be defined.
2001-05-19 13:53:06 +00:00
Simon Taylor
319df48866 Remove the RM_C mmake variable, which controlled whether the intermediate
Estimated hours taken: 0.5
Branches: main

Remove the RM_C mmake variable, which controlled whether the intermediate
`.c' files were removed (now they never are).

The implementation was buggy (it didn't work with parallel makes), and
made it difficult to avoid always recompiling the `.c' file with smart
recompilation.

Mmake.common.in:
configure.in:
README.AIX:
bindist/bindist.build_vars.in:
bindist/bindist.configure.in:
scripts/Mmake.vars.in:
scripts/Mmake.rules:
compiler/modules.m:
tools/bootcheck:
tools/binary_step:
*/Mmakefile:
	Remove references to RM_C, DEFAULT_RM_C and LIBRARY_RM_C.

compiler/modules.m:
	The `.o' and `.pic_o' file now depends only on the `.c' file,
	not on everthing the `.c' file depends on. The extra dependencies
	were only needed because the intermediate `.c' file could
	be removed by RM_C. This change is needed to avoid recompiling
	unchanged `.c' files with smart recompilation.
2001-05-18 14:23:59 +00:00
Fergus Henderson
c08e710e54 Fix a bug in c2init where, if an error occurred, it would leave the
Estimated hours taken: 2
Branches: main

Fix a bug in c2init where, if an error occurred, it would leave the
invalid output file around, causing problems the next time you ran Mmake.

This change also eliminates a dependency on using shell redirection (">")
when invoking system commands.

util/mkinit.c:
	Add new option `-o' for specifying the output file name.
	Also, if this option is specified, and there are any errors,
	then remove the output file. This fixes the bug mentioned above.
	Also, consistently use exit(EXIT_FAILURE) rather than exit(1).

scripts/c2init.in:
	Add new option `-o'/`--output', which just passes `-o' to mkinit.

compiler/modules.m:
compiler/mercury_compile.m:
	Use `-o' rather than shell redirection when invoking c2init.
2001-05-08 12:48:34 +00:00
Tyson Dowd
5ddff184df A few fixes for the scripts in the .NET backend.
Estimated hours taken: 0.5
Branches: main

A few fixes for the scripts in the .NET backend.


scripts/Mmake.rules:
	Use -CLR instead of -com+, the latter is undocumented, confusing and
	may stop working in the future.

scripts/Mmake.vars.in:
	Remove the reference to the .NET libraries as these are no longer
	needed when using the command line C++ compiler cl.
	Remove ALL_CFLAGS from the CLFLAGS -- the wrong flags were being
	passed to cl (such as the -g flag) which it didn't understand.
2001-04-25 15:16:49 +00:00
Fergus Henderson
f4d815cd67 Don't enable `--strip' by default on MacOS X (Darwin),
Estimated hours taken: 0.25

scripts/ml.in:
	Don't enable `--strip' by default on MacOS X (Darwin),
	since `cc -s' doesn't seem to do the right thing.
2001-04-16 09:34:21 +00:00