Files
mercury/scripts/parse_grade_options.sh-subr
Zoltan Somogyi c6812299c2 Remove support for --args simple. We don't use it, we won't use it even for
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.
1999-06-01 09:46:20 +00:00

232 lines
4.6 KiB
Plaintext

#---------------------------------------------------------------------------#
# Copyright (C) 1997-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.
#---------------------------------------------------------------------------#
#
# parse_grade_options.sh-subr:
# An `sh' subroutine for parsing grade-related options.
# Used by the `ml' and `mgnuc' scripts.
#
# The code here should be inserted in the case statement in a scripts
# option-parsing loop.
#
#---------------------------------------------------------------------------#
--asm-labels)
asm_labels=true ;;
--no-asm-labels)
asm_labels=false ;;
--gcc-non-local-gotos)
non_local_gotos=true ;;
--no-gcc-non-local-gotos)
non_local_gotos=false ;;
--gcc-global-registers)
global_regs=true ;;
--no-gcc-global-registers)
global_regs=false ;;
--debug)
stack_trace=true
require_tracing=true
;;
--no-debug)
stack_trace=false
require_tracing=false
;;
# The following more fine-grained options have been omitted
# since they are not very useful and would probably only
# confuse people.
# --stack-trace)
# stack_trace=true ;;
# --no-stack-trace)
# stack_trace=false ;;
# --require-tracing)
# require_tracing=true ;;
# --no-require-tracing)
# require_tracing=false ;;
--gc)
shift
case "$1" in
accurate|conservative|none)
gc_method=$1 ;;
*)
echo "$0: invalid gc method \`$1'" 1>&2
exit 1
;;
esac
;;
--parallel)
thread_safe=true ;;
-p|--profiling|--time-profiling)
profile_time=true
profile_calls=true
profile_memory=false
;;
--memory-profiling)
profile_time=false
profile_calls=true
profile_memory=true
;;
-p-|--no-profiling)
profile_time=false
profile_calls=false
profile_memory=false
;;
--profile-time)
profile_time=true ;;
--no-profile-time)
profile_time=false ;;
--profile-calls)
profile_calls=true ;;
--no-profile-calls)
profile_calls=false ;;
--profile-memory)
profile_memory=true ;;
--no-profile-memory)
profile_memory=false ;;
--use-trail)
use_trail=true ;;
--no-use-trail)
use_trail=false ;;
--use-minimal-model)
use_minimal_model=true ;;
--no-use-minimal-model)
use_minimal_model=false ;;
--pic-reg)
pic_reg=true ;;
--no-pic-reg)
pic_reg=false ;;
-s|--grade)
shift
grade="$1";
# Convert a grade to a set of options.
#
# IMPORTANT: any changes to the handling of grades here
# may also require changes to
# runtime/mercury_grade.h
# compiler/handle_options.m
# scripts/ml.in
asm_labels=false
non_local_gotos=false
global_regs=false
gc_method=none
profile_time=false
profile_calls=false
profile_memory=false
use_trail=false
use_minimal_model=false
stack_trace=false
require_tracing=false
low_level_debug=false
thread_safe=false
grade_pieces=`echo $grade | tr '.' ' '`
for grade_piece in $grade_pieces
do
case "$grade_piece" in
debug)
stack_trace=true
require_tracing=true
;;
# The following alternatives have been omitted since
# they're not very useful and would probably just confuse people.
# trace)
# stack_trace=false
# require_tracing=true
# ;;
# strce)
# stack_trace=true
# require_tracing=false
# ;;
tr) use_trail=true
;;
mm) use_minimal_model=true
;;
memprof)
profile_time=false
profile_calls=true
profile_memory=true
;;
prof)
profile_time=true
profile_calls=true
profile_memory=false
;;
proftime)
profile_time=true
profile_calls=false
profile_memory=false
;;
profcalls)
profile_time=false
profile_calls=true
profile_memory=false
;;
profall)
profile_time=true
profile_calls=true
profile_memory=true
;;
agc) gc_method=accurate
;;
gc) gc_method=conservative
;;
nogc) gc_method=none
;;
par) thread_safe=true
;;
asm_fast)
asm_labels=true
non_local_gotos=true
global_regs=true
;;
asm_jump)
asm_labels=true
non_local_gotos=true
;;
fast)
asm_labels=false
non_local_gotos=true
global_regs=true
;;
jump)
asm_labels=false
non_local_gotos=true
global_regs=false
;;
reg)
asm_labels=false
non_local_gotos=false
global_regs=true
;;
none)
asm_labels=false
non_local_gotos=false
global_regs=false
;;
esac
done
;;
-s*)
grade="` expr $1 : '-s\(.*\)' `"
# just insert it as `--grade $grade' and then reparse it
case $# in
0) set - "x --grade $grade" ;;
0) set - "x --grade $grade" "$@" ;;
esac
;;