Remove support for the reserve tag (.rt) grades.

Estimated hours taken: 1
Branches: main

Remove support for the reserve tag (.rt) grades.
These were only ever needed to support the implementation of Herbrand
variables in (older versions of) HAL.

NOTE: this change removes the .rt grade, the undocumented
reserve_tag pragma is unchanged.

runtime/mercury_grade.h:
	Do not handle the .rt component.  Rather than renumbering the
	grade parts here I have documented that grade part 8 (formerly .rt)
	is unused.

runtime/mercury_tags.h:
runtime/mercury_type_info.h:
runtime/mercury_conf_param.h:
	Conform to the above change.

compiler/compile_target_code.m:
compiler/handle_options.m:
compiler/options.m:
compiler/make_tags.m:
compiler/prog_type.m:
	Remove the `--reserve-tag' option and modify any code
	that relied upon it.  Such code is largely unchanged
	since it is still required for the implementation of the
	reserve_tag pragma.

doc/user_guide.texi:
	Delete documentation for `--reserve-tag'.

scripts/canonical_grade.sh-subr:
scripts/init_grade_otpions.sh-subr:
scripts/mgnuc.in:
scripts/parse_grade_options.sh-subr:
	Remove support for the `.rt' grade component.

NEWS:
	Announce that .rt grades are no longer supported.

extras/trailed_update/var.m:
extras/trailed_update/samples/Mmakefile:
extras/trailed_update/tests/Mmakefile:
	Update some documentation.

tests/debugger/Mmakefile:
tests/tabling/Mmakefile:
	Delete special handling for .rt grades.
This commit is contained in:
Julien Fischer
2007-07-31 07:59:23 +00:00
parent e33ca246a5
commit 64b6c216dc
20 changed files with 38 additions and 190 deletions

2
NEWS
View File

@@ -182,6 +182,8 @@ Changes to the Mercury standard library:
Changes to the Mercury compiler:
* Support for the reserve tag grades has been removed.
* We have added an Erlang back-end.
* In parallel grades we now support thread-local trailing.

View File

@@ -619,14 +619,6 @@ compile_c_file(ErrorStream, PIC, C_File, O_File, Succeeded, !IO) :-
UseTrail = no,
UseTrailOpt = ""
),
globals.io_lookup_bool_option(reserve_tag, ReserveTag, !IO),
(
ReserveTag = yes,
ReserveTagOpt = "-DMR_RESERVE_TAG "
;
ReserveTag = no,
ReserveTagOpt = ""
),
globals.io_lookup_bool_option(use_minimal_model_stack_copy,
MinimalModelStackCopy, !IO),
globals.io_lookup_bool_option(use_minimal_model_own_stacks,
@@ -764,7 +756,6 @@ compile_c_file(ErrorStream, PIC, C_File, O_File, Succeeded, !IO) :-
ExtendOpt,
Target_DebugOpt, LL_DebugOpt, DeclDebugOpt, ExecTraceOpt,
UseTrailOpt,
ReserveTagOpt,
MinimalModelOpt,
SinglePrecFloatOpt,
UseRegionsOpt,

View File

@@ -2170,7 +2170,6 @@ long_usage(!IO) :-
; comp_prof % what profiling options to use
; comp_term_size % whether or not to record term sizes
; comp_trail % whether or not to use trailing
; comp_tag % whether or not to reserve a tag
; comp_minimal_model % whether we set up for minimal model tabling
; comp_single_prec_float
% whether or not to use single precision
@@ -2455,9 +2454,6 @@ grade_component_table("tsc", comp_term_size,
% Trailing components.
grade_component_table("tr", comp_trail, [use_trail - bool(yes)], no, yes).
% Tag reservation components.
grade_component_table("rt", comp_tag, [reserve_tag - bool(yes)], no, yes).
% Minimal model tabling components.
% NOTE: we do not include `.mm' and `.dmm' in grade strings
% because they are just synonyms for `.mmsc' and `.dmmsc'.
@@ -2540,7 +2536,6 @@ grade_start_values(profile_time - bool(no)).
grade_start_values(profile_calls - bool(no)).
grade_start_values(profile_memory - bool(no)).
grade_start_values(use_trail - bool(no)).
grade_start_values(reserve_tag - bool(no)).
grade_start_values(use_minimal_model_stack_copy - bool(no)).
grade_start_values(use_minimal_model_own_stacks - bool(no)).
grade_start_values(minimal_model_debug - bool(no)).

View File

@@ -1,7 +1,7 @@
%-----------------------------------------------------------------------------%
% vim: ft=mercury ts=4 sw=4 et
%-----------------------------------------------------------------------------%
% Copyright (C) 1994-1996, 1998-2006 The University of Melbourne.
% Copyright (C) 1994-1996, 1998-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.
%-----------------------------------------------------------------------------%
@@ -109,14 +109,11 @@ assign_constructor_tags(Ctors, UserEqCmp, TypeCtor, ReservedTagPragma, Globals,
% Determine if we need to reserve a tag for use by HAL's Herbrand
% constraint solver. (This also disables enumerations and no_tag types.)
globals.lookup_bool_option(Globals, reserve_tag, GlobalReserveTag),
ReserveTag = GlobalReserveTag `or` ReservedTagPragma,
(
ReserveTag = yes,
ReservedTagPragma = yes,
InitTag = 1
;
ReserveTag = no,
ReservedTagPragma = no,
InitTag = 0
),
@@ -127,7 +124,7 @@ assign_constructor_tags(Ctors, UserEqCmp, TypeCtor, ReservedTagPragma, Globals,
% must be constant, and we must be allowed to make unboxed enums.
globals.lookup_bool_option(Globals, unboxed_enums, yes),
ctors_are_all_constants(Ctors),
ReserveTag = no
ReservedTagPragma = no
->
( Ctors = [_] ->
EnumDummy = is_dummy
@@ -140,7 +137,7 @@ assign_constructor_tags(Ctors, UserEqCmp, TypeCtor, ReservedTagPragma, Globals,
(
% Try representing it as a no-tag type.
type_with_constructors_should_be_no_tag(Globals, TypeCtor,
ReserveTag, Ctors, UserEqCmp, SingleFunc, SingleArg, _)
ReservedTagPragma, Ctors, UserEqCmp, SingleFunc, SingleArg, _)
->
SingleConsId = make_cons_id_from_qualified_sym_name(SingleFunc,
[SingleArg]),
@@ -149,12 +146,12 @@ assign_constructor_tags(Ctors, UserEqCmp, TypeCtor, ReservedTagPragma, Globals,
NumTagBits = 0
->
(
ReserveTag = yes,
ReservedTagPragma = yes,
% XXX Need to fix this.
% This occurs for the .NET and Java backends.
sorry("make_tags", "--reserve-tag with num_tag_bits = 0")
;
ReserveTag = no
ReservedTagPragma = no
),
% Assign reserved addresses to the constants, if possible.
separate_out_constants(Ctors, Constants, Functors),

View File

@@ -314,7 +314,6 @@
; use_regions
% Data representation compilation model options
; reserve_tag
; tags
; num_tag_bits
; num_reserved_addresses
@@ -1122,7 +1121,6 @@ option_defaults_2(compilation_model_option, [
type_layout - bool(yes),
% Data representation compilation model options
reserve_tag - bool(no),
pic_reg - bool(no),
tags - string("low"),
num_tag_bits - int(-1),
@@ -1907,7 +1905,6 @@ long_option("extend-stacks-when-needed", extend_stacks_when_needed).
long_option("stack-segments", stack_segments).
long_option("use-regions", use_regions).
% Data representation options
long_option("reserve-tag", reserve_tag).
long_option("use-minimal-model-stack_copy", use_minimal_model_stack_copy).
long_option("use-minimal-model-own-stacks", use_minimal_model_own_stacks).
long_option("minimal-model-debug", minimal_model_debug).
@@ -3947,15 +3944,7 @@ options_help_compilation_model -->
"--num-reserved-objects <n> (This option is not for general use.)",
"\tAllocate up to <n> global objects per type,",
"\tfor representing nullary constructors",
"\t(constants) of discriminated union types.",
"--reserve-tag\t\t\t(grade modifier: `.rt')",
"\tReserve a tag in the data representation of the generated ",
"\tcode. This tag is intended to be used to give an explicit",
"\trepresentation to free variables.",
"\tThis is necessary for a seamless Herbrand constraint solver -",
"\tfor use with HAL."
"\t(constants) of discriminated union types."
% The --conf-low-tag-bits option is reserved for use
% by the `mmc' script; it is deliberately not documented.

View File

@@ -1032,7 +1032,6 @@ type_with_constructors_should_be_no_tag(Globals, TypeCtor, ReserveTagPragma,
MaybeArgName),
(
ReserveTagPragma = no,
globals.lookup_bool_option(Globals, reserve_tag, no),
globals.lookup_bool_option(Globals, unboxed_no_tag_types, yes)
;
% Dummy types always need to be treated as no-tag types as the

View File

@@ -7146,9 +7146,6 @@ The set of aspects and their alternatives are:
@item Whether to enable the trail:
@samp{tr} (the default is no trailing).
@item Whether or not to reserve a tag in the data representation of the generated code:
@samp{rt} (the default is no reserved tag)
@item Whether to use single-precision representation of floating point values:
@samp{spf} (the default is to use double-precision floats)
@@ -7271,9 +7268,6 @@ and grade modifier; they are followed by descriptions of those options.
@item @samp{.tsc}
@code{--record-term-sizes-as-cells}.
@item @samp{.rt}
@code{--reserve-tag}.
@item @samp{.spf}
@code{--single-prec-float}
@@ -7640,17 +7634,6 @@ Note that reserved objects will only be used if reserved addresses
(see @code{--num-reserved-addresses}) are not available, since the
latter are more efficient.
@sp 1
@item @code{--reserve-tag} (grades: any grade containing @samp{.rt})
@findex --reserve-tag
@cindex Tags
@cindex Data representation
Reserve a tag in the data representation of the generated
code. This tag is intended to be used to give an explicit
representation to free variables.
This is necessary for a seamless Herbrand constraint solver ---
for use with HAL.
@sp 1
@item @code{--no-type-layout}
@findex --no-type-layout

View File

@@ -1,5 +1,5 @@
#-----------------------------------------------------------------------------#
# Copyright (C) 1997-2002 The University of Melbourne.
# Copyright (C) 1997-2002, 2007 The University of Melbourne.
# This file may only be copied under the terms of the GNU Library General
# Public License - see the file COPYING.LIB in the Mercury distribution.
#-----------------------------------------------------------------------------#
@@ -36,17 +36,7 @@ DIFF_OPTS=-c
#-----------------------------------------------------------------------------#
# The "vqueens" program does not work in ".rt" grades,
# since it uses the "var" module which does not work in ".rt" grades.
# The "interpreter" program does not work in ".rt" grades either,
# due to a bug with unification of values of type "store__mutvar" in ".rt"
# grades.
ifeq "$(findstring .rt,$(GRADE))" ".rt"
PROGS =
else
PROGS = interpreter vqueens
endif
DEPENDS = $(PROGS:%=%.depend)
CS = $(PROGS:%=%.c)
RESS = $(PROGS:%=%.res)

View File

@@ -1,5 +1,5 @@
#-----------------------------------------------------------------------------#
# Copyright (C) 1997-2002, 2006 The University of Melbourne.
# Copyright (C) 1997-2002, 2006-2007 The University of Melbourne.
# This file may only be copied under the terms of the GNU Library General
# Public License - see the file COPYING.LIB in the Mercury distribution.
#-----------------------------------------------------------------------------#
@@ -32,14 +32,7 @@ C2INITARGS = ../trailed_update.init
#-----------------------------------------------------------------------------#
# The "var_test" program does not work in ".rt" grades,
# since it uses the "var" module which does not work in ".rt" grades.
ifeq "$(findstring .rt,$(GRADE))" ".rt"
PROGS =
else
PROGS = var_test
endif
DEPENDS = $(PROGS:%=%.depend)
CS = $(PROGS:%=%.c)
RESS = $(PROGS:%=%.res)

View File

@@ -1,7 +1,7 @@
%-----------------------------------------------------------------------------%
% vim: ft=mercury ts=4 sw=4 et wm=0 tw=0
%-----------------------------------------------------------------------------%
% Copyright (C) 1998-2000, 2002-2003, 2005-2006 The University of Melbourne.
% Copyright (C) 1998-2000, 2002-2003, 2005-2007 The University of Melbourne.
% This file may only be copied under the terms of the GNU Library General
% Public License - see the file COPYING.LIB in the Mercury distribution.
%-----------------------------------------------------------------------------%
@@ -167,8 +167,6 @@
%
% Note that the way we use setarg assumes that the alias/1 functor of the
% var_rep/1 type is represented using only a primary tag, not a secondary tag.
% This assumption is false for .rt (--reserve-tag) grades, so this module
% doesn't work in .rt grades.
%
%---------------------------------------------------------------------------%

View File

@@ -52,7 +52,6 @@
** MR_NO_TYPE_LAYOUT
** MR_BOXED_FLOAT
** MR_USE_TRAIL
** MR_RESERVE_TAG
** MR_USE_MINIMAL_MODEL_STACK_COPY
** MR_USE_MINIMAL_MODEL_OWN_STACKS
** MR_MINIMAL_MODEL_DEBUG

View File

@@ -217,13 +217,12 @@
#define MR_GRADE_OPT_PART_7 MR_GRADE_OPT_PART_6
#endif
#ifdef MR_RESERVE_TAG
#define MR_GRADE_PART_8 MR_PASTE2(MR_GRADE_PART_7, _rt)
#define MR_GRADE_OPT_PART_8 MR_GRADE_OPT_PART_7 ".rt"
#else
#define MR_GRADE_PART_8 MR_GRADE_PART_7
#define MR_GRADE_OPT_PART_8 MR_GRADE_OPT_PART_7
#endif
/*
** Grade component 8 used to be used for the .rt (reserve tag) grades.
** It is currently unused.
*/
#define MR_GRADE_PART_8 MR_GRADE_PART_7
#define MR_GRADE_OPT_PART_8 MR_GRADE_OPT_PART_7
#ifdef MR_USE_MINIMAL_MODEL_STACK_COPY
#ifdef MR_USE_MINIMAL_MODEL_OWN_STACKS

View File

@@ -1,5 +1,5 @@
/*
** Copyright (C) 1993-2001, 2003-2006 The University of Melbourne.
** Copyright (C) 1993-2001, 2003-2007 The University of Melbourne.
** This file may only be copied under the terms of the GNU Library General
** Public License - see the file COPYING.LIB in the Mercury distribution.
*/
@@ -102,12 +102,7 @@
** representation scheme used by compiler/make_tags.m.
*/
#ifdef MR_RESERVE_TAG
#define MR_RAW_TAG_VAR 0 /* for Prolog-style variables */
#define MR_FIRST_UNRESERVED_RAW_TAG 1
#else
#define MR_FIRST_UNRESERVED_RAW_TAG 0
#endif
#define MR_FIRST_UNRESERVED_RAW_TAG 0
#if MR_TAGBITS == 0 && \
(MR_NUM_RESERVED_ADDRESSES > 0 || MR_NUM_RESERVED_OBJECTS > 0)
@@ -126,10 +121,6 @@
#define MR_TAG_NIL MR_mktag(MR_RAW_TAG_NIL)
#define MR_TAG_CONS MR_mktag(MR_RAW_TAG_CONS)
#ifdef MR_RESERVE_TAG
#define MR_TAG_VAR MR_mktag(MR_RAW_TAG_VAR)
#endif
#define MR_UNIV_TAG MR_mktag(MR_RAW_UNIV_TAG)
#if MR_TAGBITS > 0 || (MR_TAGBITS == 0 && \
@@ -303,37 +294,11 @@
** be defined.
*/
#ifdef MR_RESERVE_TAG
#define MR_CONVERT_C_ENUM_CONSTANT(x) (x)
#define MR_CONVERT_C_ENUM_CONSTANT(x) \
MR_mkword(MR_mktag(MR_FIRST_UNRESERVED_RAW_TAG), MR_mkbody(x))
#define MR_DEFINE_MERCURY_ENUM_CONST(x) x
/*
** We generate three enumeration constants:
** - the first one, with '_val' pasted at the end of its
** name, to give us a name for the current *unconverted*
** enumeration value
** - the converted enumeration value
** - a '_dummy' value to reset the unconverted enumeration
** value
*/
#define MR_DEFINE_MERCURY_ENUM_CONST(x) \
MR_PASTE2(x, _val), \
x = MR_CONVERT_C_ENUM_CONSTANT(MR_PASTE2(x, _val)), \
MR_PASTE2(x, _dummy) = MR_PASTE2(x, _val)
/* This is the inverse of MR_CONVERT_C_ENUM_CONSTANT */
#define MR_GET_ENUM_VALUE(x) \
MR_body((x), MR_mktag(MR_FIRST_UNRESERVED_RAW_TAG))
#else
#define MR_CONVERT_C_ENUM_CONSTANT(x) (x)
#define MR_DEFINE_MERCURY_ENUM_CONST(x) x
#define MR_GET_ENUM_VALUE(x) (x)
#endif
#define MR_GET_ENUM_VALUE(x) (x)
/*
** For each enumeration constant defined in the runtime (not in Mercury)

View File

@@ -421,34 +421,14 @@ typedef MR_PseudoTypeInfo *MR_PseudoTypeInfoParams;
** Definitions for handwritten code, mostly for mercury_compare_typeinfo.
*/
#ifdef MR_RESERVE_TAG
/*
** In reserve-tag grades, enumerations are disabled, so the
** representation of the 'comparison_result' type is quite different.
** The enumeration constants (for (<), (=) and (>)) wind up sharing
** the same primary tag (1), and are all allocated secondary tags
** starting from 0.
*/
#define MR_ENUM_TAG MR_mktag(MR_FIRST_UNRESERVED_RAW_TAG)
#define MR_COMPARE_EQUAL 0
#define MR_COMPARE_LESS 1
#define MR_COMPARE_GREATER 2
#define MR_COMPARE_EQUAL ((MR_Word) MR_mkword(MR_ENUM_TAG, MR_mkbody(0)))
#define MR_COMPARE_LESS ((MR_Word) MR_mkword(MR_ENUM_TAG, MR_mkbody(1)))
#define MR_COMPARE_GREATER ((MR_Word) MR_mkword(MR_ENUM_TAG, MR_mkbody(2)))
#define MR_BOOL_NO 0
#define MR_BOOL_YES 1
#define MR_BOOL_NO ((MR_Word) MR_mkword(MR_ENUM_TAG, MR_mkbody(0)))
#define MR_BOOL_YES ((MR_Word) MR_mkword(MR_ENUM_TAG, MR_mkbody(1)))
#define MR_UNBOUND ((MR_Word) MR_mkword(MR_ENUM_TAG, MR_mkbody(0)))
#else
#define MR_COMPARE_EQUAL 0
#define MR_COMPARE_LESS 1
#define MR_COMPARE_GREATER 2
#define MR_BOOL_NO 0
#define MR_BOOL_YES 1
#define MR_UNBOUND 0
#endif
#define MR_UNBOUND 0
/*---------------------------------------------------------------------------*/

View File

@@ -121,11 +121,6 @@ case $use_trail in
false) ;;
esac
case $reserve_tag in
true) GRADE="$GRADE.rt" ;;
false) ;;
esac
case $use_minimal_model_stack_copy,$use_minimal_model_own_stacks,$minimal_model_debug in
true,false,false) GRADE="$GRADE.mmsc" ;;
true,false,true) GRADE="$GRADE.dmmsc" ;;

View File

@@ -76,7 +76,6 @@ profile_deep=false
record_term_sizes_as_words=false
record_term_sizes_as_cells=false
use_trail=false
reserve_tag=false
use_minimal_model_stack_copy=false
use_minimal_model_own_stacks=false
minimal_model_debug=false

View File

@@ -354,11 +354,6 @@ case $use_trail in
false) TRAIL_OPTS="" ;;
esac
case $reserve_tag in
true) RESERVE_TAG_OPTS="-DMR_RESERVE_TAG" ;;
false) RESERVE_TAG_OPTS="" ;;
esac
case $use_minimal_model_stack_copy,$use_minimal_model_own_stacks in
true,true) progname=`basename $0`
echo "$progname: can't enable both forms of minimal model tabling at once"
@@ -609,7 +604,6 @@ ALL_CC_OPTS="$MERC_ALL_C_INCL_DIRS\
$INLINE_ALLOC_OPTS\
$TRAIL_OPTS\
$RECORD_TERM_SIZE_OPTS\
$RESERVE_TAG_OPTS\
$MINIMAL_MODEL_OPTS\
$SINGLE_PREC_FLOAT_OPTS\
$SPLIT_OPTS\

View File

@@ -150,11 +150,6 @@
--no-use-trail)
use_trail=false ;;
--reserve-tag)
reserve_tag=true ;;
--no-reserve-tag)
reserve_tag=false ;;
--use-minimal-model-stack-copy)
use_minimal_model_stack_copy=true ;;
--no-use-minimal-model-stack-copy)
@@ -236,7 +231,6 @@
record_term_sizes_as_words=false
record_term_sizes_as_cells=false
use_trail=false
reserve_tag=false
use_minimal_model_stack_copy=false
use_minimal_model_own_stacks=false
minimal_model_debug=false
@@ -441,10 +435,6 @@
use_trail=true
;;
rt)
reserve_tag=true
;;
mm)
use_minimal_model_stack_copy=true
minimal_model_debug=false

View File

@@ -144,12 +144,8 @@ else
endif
# The uci test matches its expected output only if the grade supports
# enumerated types. Reserved tag grades do not.
ifeq "$(findstring .rt,$(GRADE))" ""
ENUM_PROGS = uci
else
ENUM_PROGS =
endif
# enumerated types. Currently all grades do support enumerated types.
ENUM_PROGS = uci
# The tests term_size_words and term_size_cells are each meant to be used
# in their respective grades only.

View File

@@ -121,20 +121,14 @@ ALL_SIMPLE_PROGS = $(SIMPLE_NONLOOP_PROGS) \
ALL_MINIMAL_PROGS = $(MINIMAL_NONLOOP_PROGS)
# Tabling does not yet work in .rt grades
ifneq "$(findstring .gc,$(GRADE))" ""
ifneq "$(findstring .rt,$(GRADE))" ""
PROGS0=
NONLOOP_PROGS=
else
ifneq "$(findstring mm,$(GRADE))" ""
PROGS0=$(ALL_SIMPLE_PROGS) $(ALL_MINIMAL_PROGS)
NONLOOP_PROGS=$(SIMPLE_NONLOOP_PROGS) \
ifneq "$(findstring mm,$(GRADE))" ""
PROGS0=$(ALL_SIMPLE_PROGS) $(ALL_MINIMAL_PROGS)
NONLOOP_PROGS=$(SIMPLE_NONLOOP_PROGS) \
$(MINIMAL_NONLOOP_PROGS)
else
PROGS0=$(ALL_SIMPLE_PROGS)
NONLOOP_PROGS=$(SIMPLE_NONLOOP_PROGS)
endif
else
PROGS0=$(ALL_SIMPLE_PROGS)
NONLOOP_PROGS=$(SIMPLE_NONLOOP_PROGS)
endif
else
PROGS0=