Files
mercury/scripts/final_grade_options.sh-subr
Fergus Henderson f08f93af2f Make --target il' imply --high-level-data'.
Estimated hours taken: 0.25
Branches: main

compiler/handle_options.m:
scripts/final_grade_options.sh-subr:
	Make `--target il' imply `--high-level-data'.

	This is needed to ensure that the `--il' and `--target il'
	options select the `il' grade, which uses high-level data,
	rather than the `ilc' grade, which uses low-level data and
	which is no longer documented because it is not useful;
	high-level data is better for both efficiency and
	interoperability and for IL there are no advantages to
	low-level data.
2004-02-11 03:54:04 +00:00

82 lines
2.0 KiB
Plaintext

#---------------------------------------------------------------------------#
# Copyright (C) 1998-2002, 2004 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.
#---------------------------------------------------------------------------#
#
# final_grade_options.sh-subr:
# An `sh' subroutine for handling implications between grade-related
# options. Used by the `ml', `mgnuc' and `c2init' scripts.
#
# The code here should be inserted after a script's option-parsing
# loop.
#
# IMPORTANT: any changes to the handling of grades here may also require
# changes to compiler/handle_options.m.
#
# This file should only use the shell variables initialized by
# init_grade_options.sh-subr.
#
#---------------------------------------------------------------------------#
#
# .tr grade is not compatible with .mm
# (see comment in runtime/mercury_tabling.c for rationale)
#
case $use_trail,$use_minimal_model in
true,true)
echo "trailing and minimal model tabling are not compatible" 1>&2
exit 1 ;;
esac
#
# .debug grade implies --use-trail in the absence of .mm
# (see comment in compiler/handle_options.m for rationale)
#
case $stack_trace,$require_tracing,$use_minimal_model in
true,true,false)
use_trail=true ;;
esac
#
# --decl-debug implies --debug
#
case $decl_debug in true)
require_tracing=true
stack_trace=true
;;
esac
#
# --target asm, IL or Java implies --high-level-code
#
case $target in asm|il|java)
highlevel_code=true ;;
esac
#
# --target IL or Java implies --high-level-data
#
case $target in il|java)
highlevel_data=true ;;
esac
#
# --target IL or Java implies --gc automatic
#
case $target in il|java)
gc_method=automatic ;;
esac
#
# --high-level-code disables the use of low-level gcc extensions
#
case $highlevel_code in true)
non_local_gotos=false
asm_labels=false
global_regs=false
;;
esac
#---------------------------------------------------------------------------#