Commit Graph

63 Commits

Author SHA1 Message Date
Peter Wang
524f4d72e2 Delete references to Erlang backend in makefiles.
Mmake.workspace:
Mmakefile:
*/Mmakefile:
tests/*/Mmakefile:
tests/valid/Mmake.valid.common:
trace/Mmakefile:
    As above.
2020-10-27 11:10:11 +11:00
Zoltan Somogyi
b8b845a568 Fix mmakefile rules for os,cs,css,javas.
The main objective of this change is to get bootchecks in the csharp
and java grades to actually build the slice, profiler, deep_profiler
and mfilterjavac directories, which (due to the bug this diff fixes)
they weren't doing before.

However, since one side effect of this change is to eliminate
one source of annoying warnings from mmake about references to undefined
variables, a subsidiary objective is to eliminate other sources of such
warnings as well, which mostly come from the rules for making tags files.

browser/Mmakefile:
deep_profiler/Mmakefile:
library/Mmakefile:
mdbcomp/Mmakefile:
profiler/Mmakefile:
slice/Mmakefile:
ssdb/Mmakefile:
    When creating stage 3, the bootcheck builds, in each directory,
    only the files that it wants to compare against their stage 2 versions.
    This means that it wants to build all the .c, .cs or .java files,
    which it does via the cs, css and javas mmake targets.

    The correct definitions of the rules of these targets depends on
    whether mmc --make is being used or not, so we need at least two
    sets of definitions: one for mmc --make, and for no mmc --make,
    and conditionally selecting the appropriate one. The latter definition
    has the problem that it refers to mmake variables that are intended
    to be defined in .dv files created by mmc --generate-dependencies,
    but until that has been run, those mmake variables are undefined.

    Until now, the only directories that had both the mmc --make
    and the no mmc --make definitions were the ones needed to build
    the compiler. Bootchecks in the csharp and java grades, which
    always use --make make, got errors when they tried to build
    the directories that bootcheck builds after the compiler:
    the slice, profiler, deep_prof and mfilterjavac directories.

    This diff ensures that all directories we build in bootcheck
    get all both versions of the os, cs, css, and javas targets.
    In fact, they get two subversions of the no mmc --make version:
    one for use in the presence of .dv files, and one for use in their
    absence. The latter just builds the .dv files and invokes mmake
    again. This avoids one source of warnings about undefined mmake
    variables.

    To avoid another source, make the rules for tags files and their
    proxies depends on *.m instead of mmake variables such as $(mcov.ms),
    since this makes sense even before making dependencies. The only price
    is that any untracked Mercury source files in the directory have to
    either be given some other suffix, or moved somewhere else.

    Where relevant, make the mtags invocation prefer the master versions
    of files that are copied from the mdbcomp directory to other directories,
    since this is the only writeable version.

    Make the os and cs rules consistently NOT build the _init.[co] files.
    The way we use those files in bootcheck, we never need them;
    when we need them, the right target to give is the executable anyway.

    In the slice directory, don't put mcov between mtc_union and mtc_diff.

    Eliminate unnecessary duplication, e.g. of sources in rules.

    Eliminate double negatives in conditionals.

    Fix formatting.

Mmake.common.in:
bindist/Mmakefile:
bytecode/Mmakefile:
compiler/Mmakefile:
doc/Mmakefile:
grade_lib/Mmakefile:
robdd/Mmakefile:
samples/Mmakefile:
scripts/Mmakefile:
tools/Mmakefile:
trace/Mmakefile:
util/Mmakefile:
    Add "ft=make" to vim modelines. This is redundant for the files whose
    names is Mmakefile, but it is needed for Mmake.common.
2020-04-11 20:10:38 +10:00
Zoltan Somogyi
845ac1ecff Add some missing dependencies. 2020-04-08 02:09:32 +10:00
Julien Fischer
a1c4dd7b37 Fix stage 2 bootcheck with --use-mmc-make.
deep_profiler/Mmakefile:
slice/Mmakefile:
     Restore the .PHONY directives on the Mercury.modules target.
2020-01-18 04:22:17 +11:00
Zoltan Somogyi
a618ab31e1 Insist that without mmc -f, module a.b.c be in a.b.c.m.
This should fix Mantis bug #489, which shows that without this,
the compiler can mistakenly believe that a file with a name such as lexer.m
contains a module of the standard library, rather than a submodule named
test.lexer.

compiler/parse_module.m:
    Require that :- module declarations specify the expected name.
    The name may be expected because it exactly matches the filename
    (as above), or because mmc -f has recorded the actual name
    as the expectation.

    Factor report_module_has_unexpected_name out of
    check_module_has_expected_name, since it is needed on its own.
    Simplify its code.

    Simplify the code for doing checks on :- end_module declarations.

doc/reference_manual.texi:
    Document this change in the reference manual.texi.

    Replace references to "the University of Melbourne Mercury implementation"
    with just "the Melbourne Mercury implementation".

slice/Mmakefile:
    Run mmc -f *.m before making dependencies, because the modules copied
    from mdbcomp have non-fully-qualified filenames.

*/Mmakefile:
    Delete inappropriate .PHONY directives from Mercury.modules targets.

    Include Mercury.modules among the files to be deleted by clean_local
    targets.

tests/submodules/ts.tsub.m:
    Provide the full name of this module in its :- module declaration.

tests/submodules/initialise_parent.initialise_child.m:
    Fix white space.

tests/submodules/*.*.m:
    Move separate submodules to their fully qualified filenames.
2020-01-12 22:13:01 +11:00
Zoltan Somogyi
4bf9dd6ca3 Build more directories in stages 2 and 3.
tools/bootcheck:
    Build the deep_profiler and mfilterjavac directories in stage 2.

    Build the slice, profiler, deep_profiler and mfilterjavac directories
    in stage 3. (We already used to build slice and profiler in stage 2.)

    Compare target language files in the stage 2 and stage 3 versions
    of the slice, profiler, deep_profiler and mfilterjavac directories,
    to make bootcheck a tougher test. This requires copying these directories
    to stage 3, instead of just linking them.

    Don't make dependencies in a directory if we had already done them
    earlier.

mfilterjavac/Mmakefile:
    Add targets for building C# and Java files.

slice/Mmakefile:
    Include the modules of the mcov and mtc_diff programs in the
    existing targets for building C, C# and Java files.

deep_profiler/Mmakefile:
profiler/Mmakefile:
    These makefiles already had targets for building C# and Java files.
    Fix grammar and/or indentation.

compiler/Mmakefile:
    Fix grammar and/or indentation.
2019-06-25 14:22:53 +02:00
Julien Fischer
ba24a880fe Add targets for building stage 3 C# source files.
browser/Mmakefile:
compiler/Mmakefile:
deep_profiler/Mmakefile:
library/Mmakefile:
mdbcomp/Mmakefile:
profiler/Mmakefile:
slice/Mmakefile:
ssdb/Mmakefile:
    Add the 'css' target for building the C# source files.
2017-10-22 06:38:07 -04:00
Julien Fischer
345bdfff55 Add targets for building the Java source files only.
browser/Mmakefile:
compiler/Mmakefile:
deep_profiler/Mmakefile:
mdbcomp/mdbcmp/Mmakefile:
profiler/Mmakefile:
slice/Mmakefile:
ssdb/Mmakefile:
    As above (required for stage 3).

    Delete residual references to the IL backend.
2017-10-21 21:36:40 -04:00
Zoltan Somogyi
d9d28f182a Add comments to Mmakefiles. 2016-04-25 20:03:09 +10:00
Julien Fischer
92c9a1fe4b Fix github issue #34: make uninstall leaves files behind.
Don't accidently strip the ".exe" extension from the deep profiler executables
on Windows when installing them.  (Deep profiling doesn't really work on
Windows, which is why this hasn't been noticed until now.)

compiler/Mmakefile:
mfilterjavac/Mmakefile:
profiler/Mmakefile:
slice/Mmakefile:
     Add an uninstall target in these directories.

     Delete a stray reference to the IL backend.

deep_profiler/Mmakefile:
     Fix the issue mentioned above w.r.t the ".exe" extension.

     We install mdprof_cgi in (potentially) two locations, make
     sure we (attempt to) uninstall them both.

     Update the uninstall target to handle the other executables in
     this directory.

doc/Mmakefile:
     Make the uninstall target remove the manual pages.

Mmakefile:
     Invoke uninstall targets in directories where we previously didn't.
2016-01-28 22:06:13 +11:00
Julien Fischer
3dd02876a5 Delete the MLDS->IL backend.
compiler/mlds_to_il.m:
compiler/mlds_to_ilasm.m:
compiler/mlds_to_managed.m:
compiler/il_peephole.m:
compiler/ilasm.m:
compiler/ilds.m:
    Delete the modules making up the MLDS->IL code generator.

compiler/globals.m:
compiler/prog_data.m:
    Delete IL as a target and foreign language.

compiler/prog_io_pragma.m:
    Delete the max_stack_size/1 foreign proc attribute.  This was only
    ever required by the IL backend.

compiler/options.m
    Delete options used for the IL backend.

compiler/write_deps_file.m:
    Don't generate mmake targets for .il files etc.

compiler/*.m:
    Conform to the above changes.

compiler/notes/compiler_design.html
compiler/notes/work_in_progress.html
    Conform to the above changes.

library/*.m:
    Delete IL foreign_proc and foreign_export pragmas.

README.DotNet:
    Delete this file.

browser/Mmakefile:
compiler/Mmakefile:
deep_profiler/Mmakefile:
mdbcomp/Mmakefile:
mfilterjavac/Mmakefile:
profiler/Mmakefile:
runtime/Mmakefile:
slice/Mmakefile:
    Conform the above changes.

configure.ac:
    Don't check that IL is a supported foreign language when performing the
    up-to-date check.

    Delete the '--enable-dotnet-grades' option.

scripts/Mmake.vars.in:
    Delete variables used for the IL backend (and in on case by the Aditi
    backend).

scripts/Mercury.config.bootstrap.in:
scripts/Mercury.config.in:
scripts/Mmake.rules:
scripts/canonical_grade.sh-subr:
tools/bootcheck:
    Delete stuff related to the 'il' and 'ilc' grades.

doc/reference_manual.texi:
     Delete the documentation of the 'max_stack_size' option.

doc/user_guide.texi:
     Delete stuff related to the IL backend.

tests/hard_coded/csharp_test.{m,exp}:
tests/invalid/foreign_type_missing.{m,err_exp}:
tests/valid/csharp_hello.m:
	Delete these tests: they are no longer relevant.

tests/hard_coded/equality_pred_which_requires_boxing.m:
tests/hard_coded/foreign_import_module.m:
tests/hard_coded/foreign_import_module_2.m:
tests/hard_coded/foreign_type.m:
tests/hard_coded/foreign_type2.m:
tests/hard_coded/foreign_type3.m:
tests/hard_coded/intermod_foreign_type2.m:
tests/hard_coded/lp.m:
tests/hard_coded/user_compare.m:
tests/invalid/foreign_type_2.m:
tests/invalid/foreign_type_missing.{m,err_exp}:
tests/invalid/foreign_type_visibility.m:
tests/invalid/illtyped_compare.{m,err_exp}:
tests/submodules/external_unification_pred.m
tests/valid/big_foreign_type.m
tests/valid/solver_type_bug.m
tests/valid_seq/foreign_type_spec.m
tests/valid_seq/intermod_impure2.m
    Delete IL foreign_procs where necessary.

tests/hard_coded/Mmakefile
tests/invalid/Mercury.options
tests/invalid/Mmakefile
tests/submodules/Mmakefile
tests/valid/Mercury.options
tests/valid/Mmake.valid.common
tests/valid/Mmakefile
tests/valid_seq/Mmakefile
tests/valid_seq/Mercury.options
    Conform to the above changes.
2015-09-21 11:34:46 +10:00
Julien Fischer
2bb3ad6f44 Install Java archives for the executables in the Mercury system.
If the compiler and (most of) the other tools are built in the Java grade then
have the install target also install the Java archives for the executables.

compiler/Mmakefile:
deep_profiler/Mmakefile:
mfilterjavac/Mmakefile:
profiler/Mmakefile:
slice/Mmakefile:
	As above.  (The ones for the deep profiling tools are are probably
	a bit useless in practice, but the others should all work.)
2015-09-03 20:53:33 +10:00
Zoltan Somogyi
8f88d0192b Simplify how we copy .m files from mdbcomp.
deep_profiling/Mmakefile:
slice/Mmakefile:
    These two directories contain programs that are independent of the
    compiler, and may thus need to be compiled in different grades.
    They thus need copies of compiled library modules that are separate from
    the compiler's compiled versions of those same library modules.
    For Mercury standard library modules, they can get those from the
    installed Mercury system. For modules of the mdbcomp library, we
    copy them bodily to these two directories, and compile them there.

    We used to use a cumbersome technique for this copying. Use a simpler,
    more direct method for this, one that does not copy any file unnecessarily,
    thus eliminating unnecessary recompilations.

    The make mechanism that the new method uses, static pattern rules,
    either did not exist when I wrote the old rule, or I did not know
    about it.
2015-08-27 01:17:11 +10:00
Zoltan Somogyi
a58ccaa5fc Copy modules to deep_profiler only if they changed. 2015-03-03 16:16:17 +11:00
Zoltan Somogyi
d33273d033 Tell vim not to expand tabs in Makefiles.
This file-specific setting will override a default setting of expandtabs
in $HOME/.vimrc.

*/Makefile:
*/Mmakefile:
    As above.

tests/hard_coded/.gitignore:
    Don't ignore the purity subdir. This ignore must have been left over
    from when purity.m was a test in hard_coded, not hard_coded/purity,
    and it ignored an executable, not a directory.
2015-01-08 22:07:29 +11:00
Zoltan Somogyi
500948d549 Break up mdbcomp/prim_data.m. The new modules have much better cohesion.
mdbcomp/sym_name.m:
    New module, containing the part of the old prim_data.m that
    dealt with sym_names.

mdbcomp/builtin_modules.m:
    New module, containing the part of the old prim_data.m that
    dealt with builtin modules.

mdbcomp/prim_data.m:
    Remove the things that are now in the two new modules.

mdbcomp/mdbcomp.m:
deep_proiler/Mmakefile:
slice/Mmakefile:
    Add the two new modules.

browser/*.m:
compiler/*.m:
deep_proiler/*.m:
mdbcomp/*.m:
slice/*.m:
    Conform to the above changes.
2014-09-02 05:20:23 +02:00
Julien Fischer
cb28daa00a Make Mercury compile with Visual Studio 2013 (MSVC 12.0).
Fix some problems that were preventing the system from compiling properly with
MSVC.

(1) Visual Studio 2013 no longer includes the files NtWin32.Mak and Win32.Mak
which are required for building the Boehm GC with MSVC.  (This appears to be an
issue with upstream Boehm as well.)  The workaround here is to reference the
copies of this files included with the Windows 7 SDK.  (This appears to be the
official Microsoft workaround for dealing with this problem for now.)

(2) Disable support for `--c-debug' when using MSVC.  Using this option causes
MSVC to emit .pdb (Program Data Base), that contain the symbol information for
an object files.  This causes a variety of problems:

   (i) parallel builds are contending for the vc*.pdb file shared by all the
   object files in a directory causing compilation to abort.  (Compiling with
   the -FS option is another solution to this -- it causes the compiler to
   serialize access to the .pdb file -- but at the cost of slowing down
   compilation.)

   (ii) .pdb files are not cleaned up by realclean; compilation will abort
   if a pdb file generated by a different version of MSVC is encountered.

   (iii) we don't install the .pdb files alongside the libraries anyway.
   This can be a source of linker warnings.  (And shutting up the Microsoft
   linker seems to be very difficult indeed ...)

   (iv) compiling with -Zi (apparently) inhibits some C compiler optimizations.

Compiling with the older -Z7 (MSVC 7 style debugging info) option is another
alternative.  Using that option causes MSVC to include symbol information in
the object files, instead of in a separate file.

For now (i.e. the 14.01 release), disabling `--c-debug' for MSVC is the
simplest way of addressing the above issues.

README.MS-VisualC:
	Describe the problem with NtWin32.Mak and Visual Studio 2013 and
	provide two possible workarounds.

	Mention that `--c-debug' is not currently supported with MSVC and how
	to re-enable it.

	Simplify some of the instructions for setting up the build environment.

configure.ac:
scripts/mgnuc.in:
	Disable `--c-debug' with MSVC.

scripts/prepare_install_dir.in:
	Copy all makefile fragments for nmake into the boehm_gc directory for
	the library grade installation.  (This is in case the user copies
	NtWin32.Mak etc into the boehm_gc directory as per the second of
	the workarounds in README.MS-VisualC.)

slice/Mmakefile:
compiler/Mmakefile:
deep_profiler/Mmakefile:
mfilterjavac/Mmakefile:
profiler/Mmakefile:
slice/Mmakefile:
	Clean up any .pdb files.  Note that one is generated for each
	executable (regardless of whether -Zi is given to cl or not).
 	In addition, if -Zi is given to cl, there will be file named
	vc<version>.pdb generated (where <version> is the version of MSVC being
	used.)
2014-01-28 16:06:20 +11:00
Paul Bone
2f435f6aeb Remove the .mdbcomp_modules files in 'realclean'
In slice/ and deep_profiler/, when 'realclean' was executed
it removed copies of the .m files from mdbcomp/ but did not remove the
.mdbcomp_modules file.  When 'make' was executed again the .m files would
not be copied back into either slice/ or deep_profiler/

This patch fixes this problem by removing .mdbcomp_modules when 'realclean'
is executed.

deep_profiler/Mmakefile:
slice/Mmakefile:
    As above.
2013-01-16 14:09:27 +11:00
Paul Bone
347e098330 Fix race conditions for the 'depend' make target.
Fix the race conditions in the deep_profiler and slice directories when they
copy the mdbcomp files in.

deep_profiler/Mmakefile:
slice/Mmakefile:
    As above.
2013-01-09 16:42:10 +11:00
Zoltan Somogyi
0d1ac0f053 Prevent not just the deep profiler, but also the other programs in the
Estimated hours taken: 1
Branches: main

Prevent not just the deep profiler, but also the other programs in the
Mercury system from running out of stack in hlc grades.

mdbcomp/shared_utilities.m:
	A new module to contain the predicate that increases OS limits
	on stack usage as much as possible.

mdbcomp/mdbcomp.m:
	Include the new module in this package.

deep_profiler/startup.m:
	Remove the stack unlimit predicate that is now in
	mdbcomp/shared_utilities.m.

deep_profiler/Mmakefile:
slice/Mmakefile:
	Copy the new file over from mdbcomp, along with the rest of the files
	in the mdbcomp package.

compiler/mercury_compile.m:
slice/mcov.m:
slice/mdice.m:
slice/mslice.m:
slice/mtc_diff.m:
slice/mtc_union.m:
	Invoke the stack unlimit predicate.

mdbcomp/prim_data.m:
	Fix a missing divider.
2012-03-27 23:29:15 +00:00
Julien Fischer
4739487f15 Make the slice, profiler and deep_profiler directories compile in the csharp
Branches: main, 11.07

Make the slice, profiler and deep_profiler directories compile in the csharp
grade.

deep_profiler/Mmakefile:
profiler/Mmkefile:
slice/Mmakefile:
	Point the C# compiler towards the stdlib assembly.
2012-02-16 00:15:06 +00:00
Peter Wang
6b1f89831e Let Mercury be built with a MinGW cross-compiler.
Branches: main

Let Mercury be built with a MinGW cross-compiler.

tools/configure_mingw_cross:
	Add shell script to prepare for cross-compilation.

README.MinGW-cross:
	Document how to use the shell script.

configure.in:
Mmake.common.in:
	Set a new variable CROSS_COMPILING.

	Set FULLARCH and BUILD_C_PROGS_FOR_BUILD_SYSTEM variables
	to be passed to the Boehm GC build system.

	Use $host-ar for AR when cross-compiling.

m4/mercury.m4:
	Determine gcc version with gcc -dumpversion instead of building
	a program and running it.

	Don't run test for mercury_cv_cc_type if set explicitly.

Mmake.workspace:
	Use the default c2init and mkinit when cross-compiling.
	The copies in the util directory would not be usable then.

boehm_gc/Mmakefile:
	Pass configured values of AR, RANLIB down to sub-make.

boehm_gc/Makefile.direct:
boehm_gc/build_atomic_ops.sh:
	Use configured value from Mmake.common for HOSTCC.

	Pass --host when configuring libatomic_ops.

util/Mmakefile:
	Make tools with .exe suffixes on Windows.

Mmakefile:
	Use the bootstrap compiler to build libgrades when cross-compiling.

	Conform to changed target names in the util directory.

compiler/Mmakefile:
deep_profiler/Mmakefile:
profiler/Mmakefile:
slice/Mmakefile:
	Conform to changed target names in the util directory.

Makefile:
	Clean .exe files on Windows.
2012-01-09 00:35:41 +00:00
Zoltan Somogyi
237be388c1 Replace mdprof_feedback, which currently does two jobs, with
Estimated hours taken: 1
Branches: main

Replace mdprof_feedback, which currently does two jobs, with
mdprof_create_feedback and mdprof_report_feedback, which do one job each.

deep_profiler/mdprof_feedback.m:
	Remove this module.

deep_profiler/mdprof_create_feedback.m:
deep_profiler/mdprof_report_feedback.m:
	Add these two modules. mdprof_create_feedback.m contains most of the
	code originally in mdprof_feedback.m, while mdprof_report_feedback.m
	contains only the code needed for printing out reports.m

deep_profiler/autopar_reports.m:
	Move here some code that would otherwise hav to duplicated in
	mdprof_create_feedback.m and mdprof_report_feedback.m.

	Keep private the previously exported predicates that are not needed
	outside this module after the above move.

deep_profiler/Mmakefile:
	Replace references to the deleted module with references to the new
	modules.

doc/user_guide.texi:
	Update the only reference to mdprof_feedback in this directory.
2011-09-26 05:37:45 +00:00
Zoltan Somogyi
8091c166d6 Start dividing a big module with low cohesion into several smaller, high
Estimated hours taken: 3
Branches: main

Start dividing a big module with low cohesion into several smaller, high
cohesion modules.

deep_profiler/mdprof_fb.automatic_parallelism.m:
	Distribute the contents of this module among five new submodules.
	Replace those contents with just the inclusions of the new submodules.
	Remove part of the old module implementing Jerome Tannier's algorithms.

deep_profiler/autopar_types.m:
	The part of the old module defining generally useful types
	and the operations on them.

deep_profiler/autopar_annotate.m:
	The part of the old module that annotated the representations of goals.

deep_profiler/autopar_find_best_par.m:
	The part of the old module that performed the search for the best way
	to parallelize a conjuncyion.

deep_profiler/autopar_search_callgraph.m:
	The rest of the old module; it still has low cohesion.
	I will chop it into smaller pieces over the next couple of days.

deep_profiler/Mmakefile:
	Add a target for Mercury.modules, and build before doing mmake depend.
2011-01-27 02:53:46 +00:00
Julien Fischer
3a3263e87b Make building stage 1 of the Mercury system work with the java grade.
Branches: main, 11.01

Make building stage 1 of the Mercury system work with the java grade.

compiler/Mmakefile:
deep_profiler/Mmakefile:
profiler/Mmakefile:
slice/Mmakefile:
	In non-C grades override any attempts to link against object
	files or archives.

	Compile with --allow-stubs where things still rely on C
	foreign procs and there are no alternative definitions
	currently available.
2011-01-26 07:38:03 +00:00
Paul Bone
1b62a52732 mmake uses VPATH to find sources when compiling Mercury, sources referred to by
dependency files are not path-qualified and therefore compiler/goal_path.m and
mdbcomp/goal_path.m where in conflict.  This change renames goal_path.m in
mdbcomp/ to mdbcomp.goal_path.m to avoid this problem.

mdbcomp/goal_path.m:
mdbcomp/mdbcomp.goal_path.m:
    As above.

slice/Mmakefile:
deep_profiler/MMakefile:
    Conform to the above change.
2011-01-14 04:07:55 +00:00
Paul Bone
d43239d6a7 Move some of the goal path code from compiler/goal_path.m to the mdbcomp
library where it can be used by the deep profiler.

Also move the goal path code from program_representation.m to the new module,
goal_path.m in mdbcomp/

mdbcomp/goal_path.m:
    New module containing goal path code.

mdbcomp/program_representation.m:
    Original location of goal path code.

compiler/goal_path.m:
    Move some of this goal_path code into mdbcomp/goal_path.m

mdbcomp/feedback.automatic_parallelisation.m:
mdbcomp/rtti_access.m:
mdbcomp/slice_and_dice.m:
mdbcomp/trace_counts.m:
browser/debugger_interface.m:
browser/declarative_execution.m:
browser/declarative_tree.m:
compiler/build_mode_constraints.m:
compiler/call_gen.m:
compiler/code_info.m:
compiler/continuation_info.m:
compiler/coverage_profiling.m:
compiler/deep_profiling.m:
compiler/format_call.m:
compiler/goal_path.m:
compiler/goal_util.m:
compiler/hlds_data.m:
compiler/hlds_goal.m:
compiler/hlds_out_goal.m:
compiler/hlds_out_pred.m:
compiler/hlds_pred.m:
compiler/interval.m:
compiler/introduce_parallelism.m:
compiler/layout_out.m:
compiler/llds.m:
compiler/mode_constraint_robdd.m:
compiler/mode_constraints.m:
compiler/mode_ordering.m:
compiler/ordering_mode_constraints.m:
compiler/polymorphism.m:
compiler/post_typecheck.m:
compiler/prog_rep.m:
compiler/prop_mode_constraints.m:
compiler/push_goals_together.m:
compiler/rbmm.condition_renaming.m:
compiler/smm_common.m:
compiler/stack_layout.m:
compiler/stack_opt.m:
compiler/trace_gen.m:
compiler/tupling.m:
compiler/type_constraints.m:
compiler/typecheck.m:
compiler/unify_gen.m:
compiler/unneeded_code.m:
deep_profiler/Mmakefile:
deep_profiler/analysis_utils.m:
deep_profiler/coverage.m:
deep_profiler/create_report.m:
deep_profiler/display_report.m:
deep_profiler/dump.m:
deep_profiler/mdprof_fb.automatic_parallelism.m:
deep_profiler/message.m:
deep_profiler/old_query.m:
deep_profiler/profile.m:
deep_profiler/program_representation_utils.m:
deep_profiler/read_profile.m:
deep_profiler/recursion_patterns.m:
deep_profiler/report.m:
deep_profiler/var_use_analysis.m:
slice/Mmakefile:
slice/mcov.m:
    Conform to the move of the goal path code.
2011-01-13 00:36:56 +00:00
Peter Wang
fd76da59ff Add support for the csharp' grade to mmc --make', and make it possible to
Branches: main

Add support for the `csharp' grade to `mmc --make', and make it possible to
install the `csharp' grade with `mmake install'.

Also some miscellaneous fixes.


configure.in:
        Require a recent enough bootstrap compiler that recognises C# as a
        language for `pragma foreign_type'.

Mmakefile:
        Use `mmc --make' to install the standard library in csharp grade.

aclocal.m4:
        Search for the Mono C# compiler `gmcs', which is required for generics
        at this time.  Prefer it over the DotGNU C# compiler, which I have not
        tested.

        Search for `mono'.  If found, it will be used in shell scripts to
        launch executables generated via the csharp backend.

        Remove "MS_" prefixes on the variables MS_CSC and MS_ILASM, which are
        not Microsoft-specific.  More importantly, it should be less likely to
        make the mistake of adding an extra underscore to CSCFLAGS and
        ILASMFLAGS.

README.DotNet:
        Conform to variable renamings.

compiler/compile_target_code.m:
        Add new linked target types `csharp_executable', `java_launcher' and
        `erlang_launcher', instead of overloading `executable'.

        Link with `mer_std.dll' and other libraries when generating C#
        executables.  There is no `mer_rt.dll'.

        Pass "/debug" to the C# compiler if `--target-debug' is set.

        Create a shell script to launch the executable if necessary.

        Delete an unused predicate `standard_library_directory_option'.

compiler/file_names.m:
        `.cs' and `.cs_date' are grade-dependent.

compiler/handle_options.m:
        Force `.exe' as the executable file extension in csharp grades.

        Make the `erlang' grade component imply the same options as MLDS
        grades.

compiler/make.m:
        Classify executable target types based on the compilation target.

compiler/make.module_target.m:
        Handle `mmc --grade csharp --make <target>.dll'.

compiler/make.program_target.m:
        Install library DLLs in csharp grades.

        Make clean targets remove files for csharp grades.

        Conform to changes.

compiler/make.util.m:
        Add a stub foreign type.

        Conform to changes.

compiler/module_cmds.m:
        Factor out code to generate the shell scripts which launch programs
        compiled in Java, Erlang and C# grades.

compiler/options.m:
        Add `cli_interpreter' option to remember the name of the program which
        should be used to run CLI (.NET) programs.

        Add C#-related options to the help message.

compiler/options_file.m:
        Remove "MS_" prefixes on MS_ILASM_FLAGS and MS_CSC_FLAGS, and remove
        the extra underscore before "FLAGS".  In all uses of the variables,
        they were spelt without the extra underscore.

doc/user_guide.texi:
        Document options and file types related to the C# grade.

library/Mmakefile:
        Pass `mercury_dotnet.cs' to the C# compiler when building the standard
        library.  Suppress some warnings.

        Allow stubs in this directory for csharp grade.

        Conform to variable renamings.

library/builtin.m:
        Uncomment foreign language pragmas for C#.

        Handle null values in C# implementation of `deep_copy'.

library/private_builtin.m:
library/string.m:
        Compare strings by ordinals in C#, instead of culture-specific rules.
        Although the latter is allowed according to the documentation, it is
        likely to slower, and cause confusion when porting between backends.

        Handle negative index in string.set_char.

library/rtti_implementation.m:
        Uncomment foreign language pragmas for C#.

        `System.Type.GetType' only searches the current executing assembly or
        in mscorlib for a type.  As we have to be able to find types in other
        assemblies (e.g. mer_std.dll or user DLLs), explicitly search through
        a list of assemblies.

library/thread.semaphore.m:
        Uncomment foreign language pragmas for C#.

        Fix missing class qualification.

library/array.m:
library/bitmap.m:
library/bool.m:
library/dir.m:
library/exception.m:
library/io.m:
library/mutvar.m:
library/par_builtin.m:
library/region_builtin.m:
library/store.m:
library/thread.m:
library/time.m:
library/univ.m:
library/version_array.m:
        Uncomment foreign language pragmas for C#.

mdbcomp/rtti_access.m:
        Add type and procedure stubs.

runtime/mercury_dotnet.cs.in:
        Override `Equals(object)' methods in `TypeCtorInfo_Struct' and
        `TypeInfo_Struct' classes.  This requires we override `GetHashCode' as
        well.

        Handle nulls arguments to `Equals' methods as is the expected behaviour.

        Override `ToString' in `TypeCtorInfo_Struct' to produce more useful
        output during debugging.

scripts/Mercury.config.in:
        Record the configured CLI_INTERPRETER and pass that to the compiler as
        a flag.

        Conform to variable renamings.

scripts/Mmake.vars.in:
        Pass value of CSCFLAGS from Mmake through to `mmc --make'.

        Conform to variable renamings.

scripts/Mercury.config.bootstrap.in:
scripts/Mmake.rules:
        Conform to variable renaming.

scripts/canonical_grade.sh-subr:
scripts/final_grade_options.sh-subr:
scripts/init_grade_options.sh-subr:
scripts/parse_grade_options.sh-subr:
        Canonicalise high-level code, high-level-data, C# target code to the
        `csharp' grade.

        Handle erlang grades like other grades.

scripts/prepare_install_dir.in:
        Copy `.cs' files from the runtime directory when preparing an install
        directory.

browser/Mmakefile:
compiler/Mmakefile:
deep_profiler/Mmakefile:
mdbcomp/Mmakefile:
profiler/Mmakefile:
runtime/Mmakefile:
slice/Mmakefile:
ssdb/Mmakefile:
trace/Mmakefile:
        Do as other non-C grades in this directory.

        Conform to variable renamings.

tests/hard_coded/foreign_enum_dummy.m:
tests/hard_coded/sub-modules/non_word_mutable.m:
tests/hard_coded/sub-modules/sm_exp_bug.m:
        Make these tests work in C#.

tests/mmc_make/Mmakefile:
        Update a regular expression to account for `mmc --make' writing
        "Making rebuild.exe" on platforms where the .exe suffix is not normally
        used.

tests/mmc_make/complex_test.exp2:
        Add alternative output (minor difference in floating point precision).

tests/debugger/Mmakefile:
tests/debugger/declarative/Mmakefile:
tests/general/structure_reuse/Mmakefile:
tests/hard_coded/Mmakefile:
tests/hard_coded/sub-modules/Mmakefile:
tests/par_conj/Mmakefile:
tests/stm/Mmakefile:
        Disable some tests in the csharp grade.

tests/invalid/Mmakefile:
        Disable some tests in the csharp grade.

        Enable a test which should work in java grades.

tests/valid/Mmakefile:
        Do as other non-C grades in this directory.

        When testing the csharp grade in this directory, produce only the C#
        target files for now.

tests/run_one_test:
        Don't compress a failing test case executable when the executable is
        actually only a shell script.
2010-09-30 07:23:36 +00:00
Paul Bone
7425922921 Refactor mdbcomp/feedback.m
Move automatic parallelisation specific code to a new module
mdbcomp/feedback.automatic_parallelism.m.

mdbcomp/feedback.m:
mdbcomp/feedback.automatic_parallelism.m:
	As above.

slice/Mmakefile
deep_profiler/Mmakefile
	Copy the new file into the current working directory when with the other
	mdbcomp files.

compiler/implicit_parallelism.m:
deep_profiler/mdprof_fb.automatic_parallelism.m:
deep_profiler/mdprof_feedback.m:
deep_profiler/measurements.m:
	Import the new module to access code that used to be in feedback.m

	Remove unused module imports.
2010-08-24 00:01:47 +00:00
Peter Wang
a3b8d2f9fa Add missing semicolon.
Branches: main

deep_profiler/Mmakefile:
        Add missing semicolon.
2009-11-12 04:00:06 +00:00
Zoltan Somogyi
16ce96291e Fix an old bug. The action for the target "tags_file_exists", which is
Estimated hours taken: 0.2
Branches: main

compiler/Mmakefile:
	Fix an old bug. The action for the target "tags_file_exists", which is
	implicitly remade whenever we rebuild the compiler, used to always
	touch .compiler_tags. This led the "tags" target to believe that
	the tags file (whose logical timestamp .compiler_tags represents)
	is at least as new as all the .m files, causing it to not actually
	remake the tags file, even when it should have.

	We now touch .compiler_tags only when rebuilding the tags file.

*/Mmakefile:
	Make the actions for tags follow the scheme in compiler/Mmakefile
	where needed.
2009-09-22 04:37:12 +00:00
Zoltan Somogyi
7df1fc0548 Fix several occurrences of a bug that prevented the tags files from
Estimated hours taken: 0.5
Branches: main

compiler/Mmakefile:
deep_profiler/Mmakefile:
slice/Mmakefile:
	Fix several occurrences of a bug that prevented the tags files from
	being rebuilt, even when requested, when source files changed in other
	directories. The bug was the attempt to use "*.m" as a pattern
	in contexts where it was taken as just a string.
2009-08-17 10:19:39 +00:00
Peter Wang
d795f6bb55 Don't delete mercury directories as the Java backend no longer uses
Branches: main

browser/Mmakefile:
compiler/Mmakefile:
deep_profiler/Mmakefile:
library/Mmakefile:
profiler/Mmakefile:
slice/Mmakefile:
ssdb/Mmakefile:
        Don't delete mercury directories as the Java backend no longer uses
        them.
2009-06-22 02:58:56 +00:00
Julien Fischer
1ba64033d6 Clean up the mercury subdirectories used by the Java backend.
browser/Mmakefile:
compiler/Mmakefile:
deep_profiler/Mmakefile:
library/Mmakefile:
profiler/Mmakefile:
slice/Mmakefile:
ssdb/Mmakefile:
	Delete any mercury directories.
2009-06-12 11:52:48 +00:00
Paul Bone
01d145ab8f Introduce a feedback system that allows analysis tools to feed information
Estimated hours taken: 8
Branches: main

Introduce a feedback system that allows analysis tools to feed information
back into the compiler.  This can be used with the deep profiler to improve
many optimizations.  Tools update information in the feedback file rather than
clobbering existing un-related information.

Modify the implicit parallelism work to make use of the new feedback system.
mdprof_feedback updates a feedback file and in the future will be able to
collect more information from the deep profiler.

mdbcomp/feedback.m:
	Created a new module for the feedback system, types representing feedback
	information and predicates for reading and writing feedback files, and
	manipulating feedback information are defined here.

mdbcomp/mdbcomp.m:
	Updated to include the mdbcomp/feedback.m in this library.

mdbcomp/program_representation.m:
	Created a new type to describe a call.  This is used by the current
	implicit parallelism implementation.

deep_profiler/mdprof_feedback.m:
	Updated to use the new feedback system.  The old feedback file code has
	been removed.
	--program-name option has been added, a program name must be provided to
	be included in the header of the feedback file.
	Conform to changes in mdbcomp/program_representation.m

compiler/globals.m:
	Added feedback data to globals structure.
	Added predicates to get and set the feedback information stored in the
	globals structure.
	Modified predicates that create the globals structure.

compiler/handle_options.m:
	Set feedback information in globals structure when it is created in
	postprocess_options.
	Read feedback information in from file in check_option_values.
	Code added to postprocess_options2 to check the usage of the
	--implicit-parallelism option.

compiler/implicit_parallelism.m:
	This module no-longer reads the feedback file it's self, this code has
	been removed, as has the IO state.
	Information from the feedback state is retrieved and used to control
	implicit parallelism.

compiler/mercury_compile.m:
	No-longer checks options for implicit parallelization, this is now done in
	compiler/handle_options.m.
	Conform to changes in implicit_parallelism.m

deep_profiler/Mmakefile:
slice/Mmakefile:
	Modified to include mdbcomp/feedback.m for compilation in this directory.
2008-07-23 23:20:35 +00:00
Zoltan Somogyi
08d0329897 Don't try to install the deep profiler in the CGI directory
Estimated hours taken: 0.1
Branches: main

deep_profiler/Mmakefile:
	Don't try to install the deep profiler in the CGI directory
	if the user doesn't have write permission there.
2008-06-06 09:03:28 +00:00
Julien Fischer
6101e7ef45 Fix a problem that sometimes prevents parallel builds from working.
Estimated hours taken: 1
Branches: main

Fix a problem that sometimes prevents parallel builds from working.

deep_profiler/Mmakefile:
slice/Mmakefile:
	Only build the .depend targets in the above directories
	*after* the required files have been copied from the
	mdbcomp directory.
2007-12-08 15:29:02 +00:00
Olivier Annet
edc99d6d43 There are some modification for the nondet transformation.
Estimated hours taken: 120
Branches: main

There are some modification for the nondet transformation. When a retry of a
nondet procedure A is asked during the execution of the program, a choicepoint
is left behind and the execution start the retry on procedure B. When the retry
on B is finished, the compiler come back at the choicepoint and finish the call
of the procedure A. This give a wrong number of event.

The proposed solution is: when a retry is asked in a nondet procedure named A
at an exit port, the debugger do not execute any operation until it reach the
fail of the procedure A. It is only at this moment that the execution of B
begin.

If user use a predicate like solutions.unsorted_solutions, he will obtain more
than one time the same solution. The use of solutions is right because it
remove the duplicates


Determinism failure tranformed:

% detism_failure:
%
%   p(...) :-
%       promise_<original_purity> (
%           (
%               CallVarDescs = [ ... ],
%               impure call_port(ProcId, CallVarDescs),
%               <original body>
%	    ;
%                % preserve_backtrack_into
%               impure fail_port(ProcId, CallVarDescs, DoRetry),
%               (
%                   DoRetry = do_retry,
%                   p(...)
%               ;
%                   DoRetry = do_not_retry,
%                   fail
%               )
%           )
%       ).


Determinism erroneous transformed:
%   p(...) :-
%       promise_<original_purity> (
%           (
%               CallVarDescs = [ ... ],
%               impure call_port(ProcId, CallVarDescs),
%               <original body>,
%           )
%       ).


analysis/Mmakefile:
	Delete the LINK_STDLIB_ONLY=yes line as we need to link with the
	libmer_ssdb if source-to-source debugging is enabled.

browser/util.m:
	At the browser prompt, use io.read_line_as_string instead of
	functions in the trace library to read input if the trace library is
	not linked in.

compiler/mercury_compile.m:
	Move the ssdb transformation to after the higher order specialisation
	pass to work around a compiler abort. The higher order specialisation
	removes predicates which are used to "force the production of
	user-requested type specializations, since they are not called from
	anywhere and are no longer needed". Let `p' be such a procedure, and
	the specialised version be `p1'. Then remove `p'. But due to the ssdb
	transformation, `p1' will contain a call to `p', in order to support
	retry.

        I'm not sure where the ssdb transform should go. I assume as early as
	possible.

compiler/ssdebug.m:
	- Transform procedures with `failure' and `erroneous' determinisms.
	- Funny modes are not managed
	    I think we can and should handle `unused' arguments as well, but
	    later.

profiler/Mmakefile:
	Link with the mer_ssdb library.

ssdb/Mercury.options:
	Link with the mer_browser library to support browsing of terms.

ssdb/ssdb.m:
	- 4 new event for the nondet procedure are now use. They are :
	  ssdb_call_nondet, ssdb_exit_nondet, ssdb_fail_nondet,
	  and ssdb_redo_nondet. In the same way, an different event handler
	  has been created to managed each of them.
	  The ssdb_redo event was no more useful.
	- The old structure debugger_state has been divided in different
	  mutable variables to allow more flexibility.
	- The old breakpoint list are now a map with (module_name, pred_name)
	  as key and the breakpoint structure as value.
	- The depth is now compute with the stack depth, it is easier to manage
	  and more flexible.
	- Some new command have been added: delete/enable/disable breakpoint,
	  break info, finish N, retry N, browse X

deep_profiler/DEEP_FLAGS.in:
deep_profiler/.mgnuc_copts:
deep_profiler/Mmakefile:
tests/.mgnuc_copts.ws:
tests/WS_FLAGS.ws:
	Search in the ssdb directory for files.
2007-12-05 05:38:55 +00:00
Julien Fischer
5d6a4a6cf7 Always compile the programs in the deep_profiler directory.
Estimated hours taken: 0.1
Branches: main

Always compile the programs in the deep_profiler directory.  Given the
increased dependence of this code on the mdbcomp directory it is sensible to
always compile the code, not just when the deep profiler is enabled.

Installation of the deep profiler is still conditional on the existence of
the CGI lib directory etc.

Mmakefile:
deep_profiler/Mmakefile:
	Always build the dependencies and compile the deep_profiler directory.
2007-11-02 13:00:25 +00:00
Julien Fischer
c63829b430 Fix a problem when compiling the source distribution.
Estimated hours taken: 0.2
Branches: main

Fix a problem when compiling the source distribution.

deep_profiler/Mmakefile:
	Make sure that the C files for mdprof_procrep are built and
	included in the source distribution; otherwise make will try
	and build them from the Mercury files - which doesn't work
	if you don't have a Mercury compiler installed.
2007-09-24 13:26:58 +00:00
Zoltan Somogyi
2dc982cfe4 Make a representation of the program available to the deep profiler.
Estimated hours taken: 50
Branches: main

Make a representation of the program available to the deep profiler. We do
this by letting the user request, via the option "--deep-procrep-file"
in MERCURY_OPTIONS, that when the Deep.data file is written, a Deep.procrep
file should be written alongside it.

The intended use of this information is the discovery of profitable
parallelism. When a conjunction contains two expensive calls, e.g. p(...) and
q(...) connected by some shared variables, the potential gain from executing
them in parallel is limited by how early p produces those variables and how
late q consumes them, and knowing this requires access to the code of p and q.

Since the debugger and the deep profiler both need access to program
representations, put the relevant data structures and the operations on them
in mdbcomp. The data structures are significantly expanded, since the deep
profiler deals with the whole program, while the debugger was interested only
in one procedure at a time.

The layout structures have to change as well. In a previous change, I changed
proc layout structures to make room for the procedure representation even in
non-debugging grades, but this isn't enough, since the procedure representation
refers to the module's string table. This diff therefore makes some parts of
the module layout structure, including of course the string table, also
available in non-debugging grades.

configure.in:
	Check whether the installed compiler can process switches on foreign
	enums correctly, since this diff depends on that.

runtime/mercury_stack_layout.[ch]:
runtime/mercury_types.h:
	Add a new structure, MR_ModuleCommonLayout, that holds the part of
	the module layout that is common to deep profiling and debugging.

runtime/mercury_deep_profiling.[ch]:
	The old "deep profiling token" enum type was error prone, since at
	each point in the data file, only a subset was applicable. This diff
	breaks up the this enum into several enums, each consisting of the
	choice applicable at a given point.

	This also allows some of the resulting enums to be used in procrep
	files.

	Rename some enums and functions to avoid ambiguities, and in one case
	to conform to our naming scheme.

	Make write_out_proc_statics take a second argument. This is a FILE *
	that (if not NULL) asks write_out_proc_statics to write the
	representation of the current module to specified stream.

	These module representations go into the middle part of the program
	representation file. Add functions to write out the prologue and
	epilogue of this file.

	Write out procedure representations if this is requested.

	Factor out some code that is now used in more than one place.

runtime/mercury_deep_profiling_hand.h:
	Conform to the changes to mercury_deep_profiling.h.

runtime/mercury_builtin_types.c:
	Pass the extra argument in the argument lists of invocations of
	write_out_proc_statics.

runtime/mercury_trace_base.[ch]:
	Conform to the name change from proc_rep to proc_defn_rep in mdbcomp.

runtime/mercury_grade.h:
	Due to the change to layout structures, increment the binary
	compatibility version numbers for both debug and deep profiling grades.

runtime/mercury_wrapper.[ch]:
	Provide two new MERCURY_OPTION options. The first --deep-procrep-file,
	allows the user to ask for the program representation to be generated.
	The second, --deep-random-write, allows tools/bootcheck to request that
	only a fraction of all program invocations should generate any deep
	profiling output.

	The first option will be documented once it is tested much more fully.
	The second option is deliberately not documented.

	Update the type of the variable that holds the address of the
	(mkinit-generated) write_out_proc_statics function to accept the second
	argument.

util/mkinit.c:
	Pass the extra argument in the argument list of write_out_proc_statics.

mdbcomp/program_representation.m:
	Extend the existing data structures for representing a procedure body
	to represent a procedure (complete with name), a module and a program.
	The name is implemented as string_proc_label, a form of proc_label that
	can be written out to files. This replaces the old proc_id type the
	deep profiler.

	Extend the representation of switches to record the identity of the
	variable being switched on, and the cons_ids of the arms. Without the
	former, we cannot be sure when a variable is first used, and the latter
	is needed for meaningful prettyprinting of procedure bodies.

	Add code for reading in files of bytecodes, and for making sense of the
	bytecodes themselves. (It is this code that uses foreign enums.)

mdbcomp/prim_data.m:
	Note the relationship of proc_label with string_proc_label.

mdbcomp/rtti_access.m:
	Add the access operations needed to find module string tables with the
	new organization of layout structures.

	Provide operations on bytecodes and string tables generally.

trace/mercury_trace_cmd_browsing.c:
	Conform to the change to mdbcomp/program_representation.m.

compiler/layout.m:
	Add support for a MR_ModuleCommonLayout.

	Rename some function symbols to avoid ambiguities.

compiler/layout_out.m:
	Handle the new structure.

compiler/stack_layout.m:
	Generate the new structure and the procedure representation bytecode
	in deep profiling grades.

compiler/llds_out.m:
	Generate the code required to write out the prologue and epilogue
	of program representation files.

	Pass the extra argument in the argument lists of invocations of
	write_out_proc_statics that tells those invocations to write out
	the module representations between the prologue and the epilogue.

compiler/prog_rep.m:
	When generating bytecodes, include the new information for switches.

compiler/continuation_info.m:
	Replace a bool with a more expressive type.

compiler/proc_rep.m:
	Conform to the change to continuation_info.m.

compiler/opt_debug.m:
	Conform to the change to layout.m.

deep_profiler/mdprof_procrep.m:
	A new test program to test the reading of program representations.

deep_profiler/DEEP_FLAGS.in:
deep_profiler/Mmakefile:
	Copy the contents of the mdbcomp module to this directory on demand,
	instead of linking to it. This is necessary now that the deep profiler
	depends directly on mdbcomp even if it is compiled in a non-debugging
	grade.

	The arrangements for doing this were copied from the slice directory,
	which has long done the same.

	Avoid a duplicate include of Mmake.deep.params.

	Add the new test program to the list of programs in this directory.

Mmakefile:
	Go through deep_profiler/Mmakefile when deciding whether to do "mmake
	depend" in the deep_profiler directory. The old actions won't work
	correctly now that we need to copy some files from mdbcomp before we
	can run "mmake depend".

deep_profiler/profile.m:
	Remove the code that was moved (in cleaned-up form) to mdbcomp.

deep_profiler/dump.m:
deep_profiler/profile.m:
	Conform to the changes above.

browser/declarative_execution.m:
browser/declarative_tree.m:
	Conform to the changes in mdbcomp.

doc/user_guide.texi:
	Add commented out documentation of the two new options.

slice/Mmakefile:
	Fix formatting, and a bug.

library/exception.m:
library/par_builtin.m:
library/thread.m:
library/thread.semaphore.m:
	Update all the handwritten modules to pass the extra argument now
	required by write_out_proc_statics.

tests/debugger/declarative/dependency.exp:
	Conform to the change from proc_rep to proc_defn_rep.

tools/bootcheck:
	Write out deep profiling data only from every 25th invocation, since
	otherwise the time for a bootcheck takes six times as long in deep
	profiling grades than in asm_fast.gc.

	However, do test the ability to write out program representations.

	Use the mkinit from the workspace, not the installed one.

	Don't disable line wrapping.
2007-09-12 06:21:20 +00:00
Zoltan Somogyi
24afc700c7 Avoid a question that "make install" can ask in some circumstances
Estimated hours taken: 0.1
Branches: main

deep_profiler/Mmakefile:
	Avoid a question that "make install" can ask in some circumstances
	about overwriting a read-only file.
2007-08-08 01:49:39 +00:00
Peter Wang
7fa0dff1b5 Add more documentation for the Erlang backend.
Estimated hours taken: 6
Branches: main

Add more documentation for the Erlang backend.

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

NEWS:
	Mention the Erlang backend.

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

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

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

	Make configure check for Erlang tools.

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

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

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

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

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

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

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

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

scripts/final_grade_options.sh-subr:
scripts/parse_grade_options.sh-subr:
	Make these scripts know about the erlang grade so that parts of the
	build system won't abort on seeing it.
2007-07-20 01:22:06 +00:00
Ian MacLarty
fb975d9331 Add the -f option to rm when installing and uninstalling the deep
Estimated hours taken: 0.2
Branches: main

deep_profiler/Mmakefile:
	Add the -f option to rm when installing and uninstalling the deep
	profiler cgi, otherwise the script stops and waits for confirmation
	from the user.
2006-11-21 03:08:38 +00:00
Jerome Tannier
1889ed21e7 New module which writes to a file the list of call sites static
Estimated hours taken: 20
Branches: main

deep_profiler/mpdrof_feedback.m:
    New module which writes to a file the list of call sites static
    whose matching call sites dynamic's average/median
    callseqs exceed the given threshold.

Mmakefile:
deep_profiler/Mmakefile:
    Build and install mdprof_feedback.m.

    Fix an existing bug. The install target should depend
    on mdprof_test and mdprof_dump.
2006-10-19 06:20:20 +00:00
Julien Fischer
6876a026ce Fix a typo in my last change.
deep_profiler/Mmakefile:
	Fix a typo in my last change.
2006-10-09 07:13:37 +00:00
Julien Fischer
3565aa7918 Install mdprof_test and mdprof_dump - it is useful to have them
Estimated hours taken: 0.1
Branches: main

deep_profiler/Mmakefile:
	Install mdprof_test and mdprof_dump - it is useful to have them
	available when trying to isolate bugs in the deep profiler.
2006-10-09 05:56:19 +00:00
Peter Wang
964ffbb950 These changes allow the compiler to be built with `mmake --use-mmc-make'.
Estimated hours taken: 2
Branches: main

These changes allow the compiler to be built with `mmake --use-mmc-make'.

*/Mmakefile:
	Add dummy rules for optional `Mmake.*.params' files so that
	`mmc --make' is not asked to make them.

library/INTER_FLAGS_MMC_MAKE:
library/Mmakefile:
	Add a version of the `library/INTER_FLAGS' file to be used when
	`mmc --make' is being used.

library/LIB_FLAGS.in:
	Add `--c-include-directory ../robdd' so that `mmc --make' can find
	the included C files for `robdd.m'.

tools/bootcheck:
	Make `bootcheck --use-mmc-make' imply `bootcheck --use-subdirs'.

	Copy `INTER_FLAGS_MMC_MAKE' to stage 2 and stage 3 directories.

	Manually make `*_FLAGS' files in the stage 2 directory if
	`--use-mmc-make' is in effect.
2005-12-16 05:49:40 +00:00
Zoltan Somogyi
d56de30e9d Remove most of the junk from the command lines executed by make when building
Estimated hours taken: 12
Branches: main

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

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

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

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

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

	Conform to the changes in configure.in.

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

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

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

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

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

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

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

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

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

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

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

tests/Mmakefile:
	Allow the environment to define DIFF_OPTS.

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

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

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

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

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

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

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

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

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

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

	Move the setting of MMAKE_USE_SUBDIRS and MMAKE_USE_MMC_MAKE after
	we have built stage1, and always copy the profilers if --use-subdirs
	is set. The old ways of doing things caused problems if bootcheck
	was given --use-subdirs but stage1 doesn't use subdirs: the bootcheck
	modified the stage1 slice, profiler and deep_profiler directories.
2005-05-06 08:42:37 +00:00
Zoltan Somogyi
d8694dc1aa Significantly enhance the infrastructure for debugging problems with the deep
Estimated hours taken: 8
Branches: main

Significantly enhance the infrastructure for debugging problems with the deep
profiler by providing facilities for dumping out some of the main data
structures. These were needed for my recent fix of mercury_deep_profiling.c
in the runtime.

There are no algorithmic changes in the non-debugging parts of the code.

deep_profiler/dump.m:
	New module for containing predicates that dump data structures.
	The first draft was by Julien.

deep_profiler/mdprof_dump.m:
	New program for dumping out the contents of Deep.data files.
	The first draft was by Julien.

deep_profiler/startup.m:
	Provide a mechanism for dumping out the main data structures at three
	stages.

deep_profiler/mdprof_cgi.m:
deep_profiler/mdprof_test.m:
	Pass the options to startup to control these dumps.

deep_profiler/measurements.m:
	Provide a mechanism for getting all the counts of a measurement at
	once.

deep_profiler/array_util.m:
	Provide extra modes of some predicates for use in the other modules.

deep_profiler/read_profile.m:
	Fix Julien's fix: handle init predicates as well as the other uci
	predicates.

deep_profiler/profile.m:
	Reorder the arguments of predicates as required to enable the use
	of state variable notation in the callers.

deep_profiler/*.m:
	Conform to the change in profile.m, and use state variable notation
	where this is advantageous.

	Convert some modules to four-space indentation where this eliminates
	excessive indentation or bad line breaks.

deep_profiler/Mmakefile:
	Handle the new mdprof_dump program.
2005-04-25 06:51:58 +00:00