Tighten up checks for invalid grades in mgnuc script etc.

scripts/final_grade_options.sh-subr:
	Print an error and exit with a non-zero exit status for
	various invalid grade component combinations.

	Implicitly disable the .par component for the non-C backends.
	This doesn't affect the support for threads in grades that
	use these backends.
This commit is contained in:
Julien Fischer
2015-04-22 13:30:39 +10:00
parent 48b1f0d860
commit f452a61728

View File

@@ -49,6 +49,57 @@ case $extend_stacks,$stack_segments in true,true)
exit 1 ;;
esac
#
# stack segments not compatible with high-level code
#
case $highlevel_code,$stack_segments in true,true)
echo "--high-level-code and --stack-segments are not compatible" 1>&2
exit 1 ;;
esac
#
# .debug grades are not compatible with high-level code
#
case $highlevel_code,$debug in true,true)
echo "--high-level-code and --debug are not compatible" 1>&2
exit 1 ;;
esac
#
# .decldebug grades are not compatible with high-level code
#
case $highlevel_code,$decl_debug in true,true)
echo "--high-level-code and --decl-debug are not compatible" 1>&2
exit 1 ;;
esac
#
# .profdeep grades are not compatible with high-level code
#
case $highlevel_code,$profile_deep in true,true)
echo "--high-level-code and --deep-profiling are not compatible" 1>&2
exit 1 ;;
esac
#
# The none-C backends do not support single-precision floats, time profiling or
# memory profiling.
#
case $target in il|csharp|java|erlang)
case $single_prec_float in true)
echo "--single-prec-float and --target $target are not compatible" 1>&2
exit 1 ;;
esac
case $profile_time in true)
echo "--profile-time and --target $target are not compatible" 1>&2
exit 1 ;;
esac
case $profile_memory in true)
echo "--profile-memory and --target $target are not compatible" 1>&2
exit 1 ;;
esac
esac
#
# --decl-debug implies --debug
#
@@ -71,10 +122,15 @@ case $target in il|csharp|java|erlang)
esac
#
# --target IL, C#, Java, Erlang implies --gc automatic
# --target IL, C#, Java, Erlang implies --gc automatic.
# NOTE: the .par grade component is meaningless for the non-C backends,
# so we set it to false if they are being used. This avoids having to
# deal with grades like "java.par".
#
case $target in il|csharp|java|erlang)
gc_method=automatic ;;
gc_method=automatic
thread_safe=false
;;
esac
#