mirror of
https://github.com/Mercury-Language/mercury.git
synced 2025-12-12 20:34:19 +00:00
Estimated hours taken: 2 Branches: main Allow the specification of RBMM debugging and profiling via grades. runtime/mercury_grade.h: Add rbmmd and rbmmp as grade components denoting RBMM with debugging and profiling respectively, while rbmmdp is RBMM with both. compiler/options.m: Add --use-regions-debug and --use-regions-profiling as the Mercury compiler options specifying RBMM debugging and profiling. compiler/handle_options.m: compiler/compile_target_code.m: runtime/mercury_conf_param.h: scripts/canonical_grade.sh-subr: scripts/final_grade_options.sh-subr: scripts/init_grade_options.sh-subr: scripts/mgnuc.in: scripts/parse_grade_options.sh-subr: Handle the new grade components. configure.in: Add the new option --enable-rbmm-grades, for use by Quan and me for now, that causes the installation of all four RBMM grades. Once RBMM is ready for use by non-implementors, we can change this to install only the rbmm grade, and not the rbmmd/rbmmp/rbmmdp grades.
109 lines
2.6 KiB
Plaintext
109 lines
2.6 KiB
Plaintext
#---------------------------------------------------------------------------#
|
|
# Copyright (C) 1998-2002, 2004-2007 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.
|
|
#
|
|
#---------------------------------------------------------------------------#
|
|
|
|
use_minimal_model=false
|
|
case $use_minimal_model_stack_copy in
|
|
true)
|
|
use_minimal_model=true
|
|
;;
|
|
esac
|
|
case $use_minimal_model_own_stacks in
|
|
true)
|
|
use_minimal_model=true
|
|
;;
|
|
esac
|
|
|
|
#
|
|
# .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
|
|
|
|
#
|
|
# .exts grade is not compatible with .stseg
|
|
# (they are alternative ways of doing the same thing)
|
|
#
|
|
case $extend_stacks,$stack_segments in true,true)
|
|
echo "--extend-stacks-when-needed and --stack-segments are not compatible" 1>&2
|
|
exit 1 ;;
|
|
esac
|
|
|
|
#
|
|
# .debug grade (but not .decldebug) implies --use-trail in the absence of .*mm*
|
|
# (see comment in compiler/handle_options.m for rationale)
|
|
#
|
|
case $debug,$decl_debug,$use_minimal_model in true,false,false)
|
|
use_trail=true ;;
|
|
esac
|
|
|
|
#
|
|
# --decl-debug implies --debug
|
|
#
|
|
case $decl_debug in true)
|
|
debug=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 or Erlang implies --gc automatic
|
|
#
|
|
case $target in il|java|erlang)
|
|
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
|
|
|
|
#
|
|
# --use-regions-debug and --use-regions-profiling aren't meaningful
|
|
# without --use-regions
|
|
#
|
|
case $use_regions in false)
|
|
use_regions_debug=false
|
|
use_regions_profiling=false
|
|
;;
|
|
esac
|
|
|
|
#---------------------------------------------------------------------------#
|