mirror of
https://github.com/Mercury-Language/mercury.git
synced 2026-04-15 09:23:44 +00:00
As we discussed, it has fallen into disuse. Its main purpose was to
pave the way for the .net backend and later for the java and csharp grades.
Now that the .net backend is ancient history and the java and csharp grades
are established, that purpose is gone, and for every other purpose,
hlc is better because it is simpler and faster.
compiler/options.m:
Delete the --high-level-data option. It is no longer needed,
bacause the data representation scheme is now a direct function
of the target language.
doc/user_guide.texi:
Delete references to the --high-level-data option.
NEWS:
Mention that --high-level-data is no longer supported.
compiler/compute_grade.m:
Delete references to the hl grade component, and conform
to the deletion of the --high-level-data option.
compiler/compile_target_code.m:
Give some predicates more meaningful names, and conform to the
deletion of the --high-level-data option.
compiler/const_struct.m:
compiler/du_type_layout.m:
compiler/globals.m:
compiler/handle_options.m:
compiler/lco.m:
compiler/mercury_compile_main.m:
compiler/ml_gen_info.m:
compiler/ml_type_gen.m:
compiler/ml_unify_gen_construct.m:
compiler/mlds_to_c_data.m:
compiler/mlds_to_c_func.m:
compiler/mlds_to_c_type.m:
compiler/mlds_to_c_util.m:
Conform to the deletion of the --high-level-data option.
grade_lib/grade_spec.m:
grade_lib/grade_vars.m:
Delete the datarep solver variable, since the data representation
is now a direct function of the target language.
Delete the requirements involving the deleted solver variable.
grade_lib/grade_structure.m:
Delete the datarep component of the representation of MLDS C grades,
since its value would now be fixed.
grade_lib/grade_solver.m:
grade_lib/grade_string.m:
grade_lib/try_all_grade_structs.m:
grade_lib/var_value_names.m:
Conform to the changes above.
grade_lib/Mmakefile:
Link the grade library's test programs statically, like we do
the executables in the other directories.
library/io.m:
library/robdd.m:
library/rtti_implementation.m:
runtime/mercury_conf_param.h:
runtime/mercury_grade.h:
runtime/mercury_hlc_types.h:
Remove references to MR_HIGHLEVEL_DATA, as well as any code
that was guarded by #ifdef MR_HIGHLEVEL_DATA.
scripts/Mmake.vars.in:
scripts/canonical_grade.sh-subr:
scripts/final_grade_options.sh-subr:
scripts/init_grade_options.sh-subr:
scripts/mgnuc.in:
scripts/mgnuc_file_opts.sh-subr:
scripts/mmake.in:
scripts/mmc.in:
scripts/mtc:
scripts/parse_grade_options.sh-subr:
scripts/parse_ml_options.sh-subr.in:
Remove references to --high-level-data options.
In canonical_grade.sh-subr, compute the base grade more directly.
Remove a few left-over references to the assembler backend.
Add or fix vim modelines where relevant.
Fix inconsistent indentation.
Add missing ;;s in case statements.
Switch to using ${var} references instead of just $var.
tests/invalid/Mercury.options:
Make the test_feature_set test case run in grade java instead of hl.gc.
tests/invalid/test_feature_set.err_exp:
Update the expected out for the grade change.
184 lines
4.7 KiB
Bash
Executable File
184 lines
4.7 KiB
Bash
Executable File
#!/bin/sh
|
|
#---------------------------------------------------------------------------#
|
|
# vim: ts=4 sw=4 expandtab ft=sh
|
|
#---------------------------------------------------------------------------#
|
|
# Copyright (C) 2005-2006 The University of Melbourne.
|
|
# This file may only be copied under the terms of the GNU General
|
|
# Public License - see the file COPYING in the Mercury distribution.
|
|
#---------------------------------------------------------------------------#
|
|
#
|
|
# IMPORTANT: the manpage is produced automatically from this help
|
|
# message, so if you change the help message, don't forget to check
|
|
# that the manpage still looks OK.
|
|
Help="\
|
|
Name: mtc - gathering trace counts from Mercury programs
|
|
Usage: mtc [options] <executable> [<args>]...
|
|
Description:
|
|
\`mtc' invokes the specified command \`<executable> <args>...'.
|
|
If that command is a Mercury program that was compiled with debugging
|
|
enabled (e.g. using the \`--debug' option), or if that command invokes
|
|
such a program, then mtc will cause the program to count the
|
|
number of times each event is executed, and to write out that data
|
|
to a file. Otherwise, mtc will execute the command line as if the
|
|
mtc prefix weren't there.
|
|
|
|
Options:
|
|
-c, --coverage-test
|
|
Ordinarily, the generated trace count file contains only
|
|
nonzero trace counts. This option causes even zero counts
|
|
to be written out, since coverage testing needs to know
|
|
which parts of the code are not executed.
|
|
|
|
-o <filename>, --output-file <filename>
|
|
Save the generated trace counts to <filename>.
|
|
|
|
-s <basename>, --summary-file=<basename>
|
|
If this option is given, the trace counts are put into a new
|
|
file whose name is <basename>.N for a small integer N, choosing
|
|
N to be the smallest integer for which <basename>.N doesn't yet
|
|
exist. If this is not initially possible for a small enough N
|
|
(due probably to previous runs), then the program will replace
|
|
all of the <basename>.N files with a summary named just
|
|
<basename>; if <basename> existed already, it will be included
|
|
in the summary as well. This way, at the end of a sequence of
|
|
runs of the program, the command \"mtc_union <basename>*\"
|
|
will compute a summary of all the trace counts files.
|
|
|
|
--summary-count=<maxN>
|
|
Gives the maximum value of N to use with --summary-file.
|
|
|
|
--help
|
|
Display this message.
|
|
|
|
If neither the -o nor the -s option is given, then the trace counts are put
|
|
into a file whose name is automatically generated. This name will start with
|
|
the prefix ".mercury_trace_counts", followed by a mangled version of the
|
|
name of the executable, and then the process id.
|
|
|
|
The -o and -s options are mutually exclusive.
|
|
|
|
Environment variables:
|
|
MERCURY_OPTIONS.
|
|
"
|
|
|
|
#---------------------------------------------------------------------------#
|
|
#
|
|
# process the command line options
|
|
#
|
|
|
|
coverage_test=false
|
|
output_file=""
|
|
summary_file=""
|
|
summary_limit=""
|
|
|
|
while test "$#" -gt 0
|
|
do
|
|
case "$1" in
|
|
-c|--coverage-test)
|
|
coverage_test=true
|
|
;;
|
|
|
|
--help)
|
|
echo "${Help}"
|
|
exit 0
|
|
;;
|
|
|
|
-o|--output-file)
|
|
output_file="$2";
|
|
shift
|
|
;;
|
|
|
|
-o*)
|
|
output_file="`expr $1 : '-o\(.*\)'`"
|
|
;;
|
|
|
|
--output-file=*)
|
|
output_file="`expr $1 : '--output-file=\(.*\)'`"
|
|
;;
|
|
|
|
-s|--summary-file)
|
|
summary_file="$2"
|
|
shift
|
|
;;
|
|
|
|
-s*)
|
|
summary_file="`expr $1 : '-s\(.*\)'`"
|
|
;;
|
|
|
|
--summary-file=*)
|
|
summary_file="`expr $1 : '--summary-file=\(.*\)'`"
|
|
;;
|
|
|
|
--summary-limit)
|
|
summary_limit="$2"
|
|
shift
|
|
;;
|
|
|
|
--summary-limit=*)
|
|
summary_limit="`expr $1 : '--summary-limit=\(.*\)'`"
|
|
;;
|
|
|
|
--)
|
|
shift
|
|
break
|
|
;;
|
|
|
|
-*)
|
|
echo "$0: unknown option \`$1'" 1>&2
|
|
exit 1
|
|
;;
|
|
|
|
*)
|
|
break
|
|
;;
|
|
esac
|
|
shift
|
|
done
|
|
|
|
case $# in
|
|
0)
|
|
echo "Usage: mtc [options] <executable> [<arg> ...]" 1>&2
|
|
exit 1
|
|
;;
|
|
esac
|
|
|
|
if test "${output_file}" != "" -a "${summary_file}" != ""
|
|
then
|
|
echo "The options --output-file and --summary-file are incompatible."
|
|
exit 1
|
|
fi
|
|
|
|
#---------------------------------------------------------------------------#
|
|
#
|
|
# Set the environment variables used by the Mercury runtime to the appropriate
|
|
# values to enable the gathering of trace counts, and then finally use
|
|
# ${invoke_cmd} to invoke the command.
|
|
#
|
|
|
|
MERCURY_OPTIONS="${MERCURY_OPTIONS} --trace-count"
|
|
|
|
if "${coverage_test}"
|
|
then
|
|
MERCURY_OPTIONS="${MERCURY_OPTIONS} --coverage-test"
|
|
fi
|
|
|
|
if test "${summary_file}" != ""
|
|
then
|
|
MERCURY_OPTIONS="${MERCURY_OPTIONS} --trace-count-summary-file=${summary_file}"
|
|
fi
|
|
|
|
if test "${summary_limit}" != ""
|
|
then
|
|
MERCURY_OPTIONS="${MERCURY_OPTIONS} --trace-count-summary-limit=${summary_limit}"
|
|
fi
|
|
|
|
if test "${output_file}" != ""
|
|
then
|
|
MERCURY_OPTIONS="${MERCURY_OPTIONS} --tc-output-file ${output_file}"
|
|
fi
|
|
|
|
export MERCURY_OPTIONS
|
|
exec "$@"
|
|
|
|
#---------------------------------------------------------------------------#
|