mirror of
https://github.com/Mercury-Language/mercury.git
synced 2026-04-21 04:13:46 +00:00
Estimated hours taken: 4.5 Remove support for --args simple. We don't use it, we won't use it even for experiments, and it is unnecessary complication. If anybody were using --args simple, this would need bootstrapping, but since nobody does, there is no need, and this can be committed as an ordinary change. compiler/options.m: doc/user_guide.texi: scripts/*.in: scripts/*.sh-subr: Remove the --args option. compiler/globals.m: Remove the args_method global and its access predicates. compiler/handle_options.m: Don't set the args_method global from the option. compiler/arg_info.m: Remove support for --args simple. This allows us to remove a now redundant argument from an exported predicate. compiler/mercury_compile.m: Remove the code for passing -DCOMPACT_ARGS to the C compiler. compiler/bytecode_gen.m: compiler/fact_table.m: compiler/follow_vars.m: compiler/live_vars.m: compiler/call_gen.m: Don't pass the unnecessary argument to arg_info. compiler/call_gen.m: compiler/unify_gen.m: Remove now unnecessary assertions. compiler/hlds_pred.m: Don't include an args_method in proc_infos; instead, include a slot that says whether the procedure's address is taken or not. (In most cases, this determined whether the args_method was simple or compact.) We will need this bool in the near future (when we generate layout structures for procedures whose address is taken). Modify the signatures of exported predicates to accommodate this change to the data structure. compiler/hlds_out.m: Print the new slot, not the args_method. compiler/lambda.m: When creating procedures from lambdas, set the address-taken slot to address_is_taken instead of setting up its args_method. compiler/make_hlds.m: Minor changes to conform to the changes in the signatures of the predicates exported from hlds_pred.m. compiler/check_typeclass.m: compiler/clause_to_proc.m: compiler/dnf.m: compiler/magic.m: compiler/magic_util.m: compiler/modecheck_call.m: compiler/pd_info.m: compiler/post_typecheck.m: compiler/unify_gen.m: Minor changes to conform to the changes in the signatures of the predicates exported from hlds_pred.m and make_hlds.m. runtime/mercury_type_info.h: Remove the conditional definition of the macros that provided an argument-method-independent way of referring to the registers holding the inputs and outputs of e.g. unification procedures. We don't need the independence anymore, and using registers instead of macros in the code ensures that maintainers are aware of register reuse issues (e.g. they copy an input from r1 before overwriting it with an output). runtime/mercury_conf_param.h: runtime/mercury_grade.h: Remove support for the args method component of the grade. runtime/mercury_ho_call.c: runtime/mercury_tabling.c: library/*.m: Conform to the changes in runtime/mercury_type_info.h by effectively applying the #defines appropriate to compact args by hand. Remove code and data structures only needed for simple args. Remove comments needed only in the presence of uncertainty about the args method.
186 lines
4.6 KiB
Bash
Executable File
186 lines
4.6 KiB
Bash
Executable File
#! /bin/sh
|
|
# @configure_input@
|
|
#---------------------------------------------------------------------------#
|
|
# Copyright (C) 1995-1999 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.
|
|
#---------------------------------------------------------------------------#
|
|
|
|
# C2INIT - Convert *.c to *_init.c
|
|
#
|
|
# This script outputs an appropriate init.c, given the .c files.
|
|
# Type `c2init --help' for usage message.
|
|
#
|
|
|
|
# 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: c2init - Create Mercury initialization file.
|
|
Usage: c2init [options] *.c *.init ...
|
|
Options:
|
|
-a, --aditi
|
|
Generate a function to upload Aditi-RL data to a database.
|
|
-c <n>, --max-calls <n>
|
|
Break up the initialization into groups of at most <n> function
|
|
calls. (Default value of <n> is 40.)
|
|
-i, --include-initialization-code
|
|
Always include code that calls the initialization functions
|
|
of the various modules. With this option, the debugger can use
|
|
information from any modules that were compiled with execution
|
|
tracing to print (partial) stack traces, and to print the
|
|
values of variables in ancestors of the current call, even
|
|
in grades in which this not normally possible.
|
|
-t, --trace
|
|
Enable execution tracing in the generated executable.
|
|
Implies -i.
|
|
-l, --library
|
|
Don't generate a \`main()' function.
|
|
Instead, generate a function
|
|
mercury_main(int argc, char **argv);
|
|
(declared in \"init.h\") that can be called from C code.
|
|
(A more fine-grained interface is also available;
|
|
see \"init.h\" for details.)
|
|
-w <label>, --entry-point <label>
|
|
Set entry point to <label>.
|
|
(Default value is \`mercury__main_2_0'.)
|
|
-x, --extra-inits
|
|
Search \`.c' files for extra initialization functions.
|
|
(This may be necessary if the C files contain
|
|
hand-coded C code with \`INIT' comments, rather than
|
|
containing only C code that was automatically generated
|
|
by the Mercury compiler.)
|
|
-s <grade>, --grade <grade>
|
|
--asm-labels
|
|
--gcc-non-local-gotos
|
|
--gcc-global-registers
|
|
--gc {conservative, accurate, none}
|
|
-p, --profiling
|
|
--profile-calls
|
|
--profile-time
|
|
--profile-memory
|
|
--debug
|
|
--use-trail
|
|
--pic-reg
|
|
See the documentation in the \"Invocation\" section
|
|
of the Mercury User's Guide.
|
|
|
|
Environment variables:
|
|
MERCURY_MOD_LIB_DIR, MERCURY_MOD_LIB_MODS, MERCURY_MKINIT.
|
|
"
|
|
|
|
# If you change these, you will also need to change Mmake.common.in,
|
|
# scripts/ml.in, tools/bootcheck, tools/binary, tools/binary_step and
|
|
# tools/linear.
|
|
RT_LIB_NAME=mer_rt
|
|
STD_LIB_NAME=mer_std
|
|
TRACE_LIB_NAME=mer_trace
|
|
BROWSER_LIB_NAME=mer_browser
|
|
|
|
MERCURY_MOD_LIB_DIR=${MERCURY_MOD_LIB_DIR=@LIBDIR@/modules}
|
|
MKINIT=${MERCURY_MKINIT=mkinit}
|
|
|
|
# maximum number of calls to put in a single function
|
|
maxcalls=40
|
|
defentry=mercury__main_2_0
|
|
init_opt=""
|
|
trace_opt=""
|
|
library_opt=""
|
|
extra_inits_opt=""
|
|
aditi_opt=""
|
|
|
|
# include the file `init_grade_options.sh-subr'
|
|
@INIT_GRADE_OPTIONS@
|
|
|
|
while true; do
|
|
case "$1" in
|
|
-a|--aditi)
|
|
aditi_opt="-a"; shift;;
|
|
-a-|--no-aditi)
|
|
aditi_opt=""; shift;;
|
|
-c|--max-calls)
|
|
maxcalls="$2"; shift;;
|
|
|
|
-i|--include-initialization-code)
|
|
init_opt="-i";;
|
|
|
|
-t|--trace)
|
|
trace_opt="-t";;
|
|
|
|
-l|--library)
|
|
library_opt="-l";;
|
|
|
|
-l-|--no-library)
|
|
library_opt="";;
|
|
|
|
-w|--entry-point)
|
|
defentry="$2"; shift;;
|
|
|
|
-x|--extra-inits)
|
|
extra_inits_opt="-x";;
|
|
|
|
-x-|--no-extra-inits)
|
|
extra_inits_opt="";;
|
|
|
|
-h|--help|"-?")
|
|
echo "$Help"
|
|
exit 0;;
|
|
|
|
# include the file `parse_grade_options.sh-subr'
|
|
@PARSE_GRADE_OPTIONS@
|
|
|
|
--)
|
|
break;;
|
|
|
|
-*)
|
|
echo "`basename $0`: invalid option \`$1'" 1>&2;
|
|
echo "Try \`$0 --help' for help." 1>&2;
|
|
exit 1;;
|
|
|
|
*)
|
|
break;;
|
|
esac
|
|
shift
|
|
done
|
|
|
|
# include the file `final_grade_options.sh-subr'
|
|
@FINAL_GRADE_OPTIONS@
|
|
|
|
case $require_tracing in
|
|
true)
|
|
trace_opt="-t" ;;
|
|
esac
|
|
|
|
case $stack_trace in
|
|
true)
|
|
init_opt="-i" ;;
|
|
esac
|
|
|
|
case "$trace_opt" in
|
|
-t)
|
|
init_opt="-i"
|
|
MERCURY_MOD_LIB_MODS=${MERCURY_MOD_LIB_MODS="\
|
|
$MERCURY_MOD_LIB_DIR/$RT_LIB_NAME.init \
|
|
$MERCURY_MOD_LIB_DIR/$STD_LIB_NAME.init \
|
|
$MERCURY_MOD_LIB_DIR/$BROWSER_LIB_NAME.init \
|
|
"}
|
|
;;
|
|
*)
|
|
MERCURY_MOD_LIB_MODS=${MERCURY_MOD_LIB_MODS="\
|
|
$MERCURY_MOD_LIB_DIR/$RT_LIB_NAME.init \
|
|
$MERCURY_MOD_LIB_DIR/$STD_LIB_NAME.init \
|
|
"}
|
|
;;
|
|
esac
|
|
|
|
case $# in
|
|
0) exec $MKINIT $aditi_opt -c"$maxcalls" $init_opt $trace_opt \
|
|
$library_opt -w"$defentry" $extra_inits_opt \
|
|
$MERCURY_MOD_LIB_MODS
|
|
;;
|
|
*) exec $MKINIT $aditi_opt -c"$maxcalls" $init_opt $trace_opt \
|
|
$library_opt -w"$defentry" $extra_inits_opt "$@" \
|
|
$MERCURY_MOD_LIB_MODS
|
|
;;
|
|
esac
|