Delete unused string formatting predicates.

library/string.format.m:
    Delete the old predicates for formatting ints as unsigned values;
    these are now unused.

configure.ac:
    Require the use of a compiler that does not generate references
    to the deleted predicates.

compiler/introduced_call_table.m:
    Delete the above predicates from the introduced call table.
This commit is contained in:
Julien Fischer
2023-02-09 10:39:58 +11:00
parent 500d125f03
commit 2c8ada3dcc
3 changed files with 1 additions and 62 deletions

View File

@@ -427,10 +427,6 @@ mict_string_format("format_unsigned_int64_component_nowidth_noprec", 4).
mict_string_format("format_unsigned_int64_component_nowidth_prec", 5).
mict_string_format("format_unsigned_int64_component_width_noprec", 5).
mict_string_format("format_unsigned_int64_component_width_prec", 6).
mict_string_format("format_unsigned_int_component_nowidth_noprec", 4).
mict_string_format("format_unsigned_int_component_nowidth_prec", 5).
mict_string_format("format_unsigned_int_component_width_noprec", 5).
mict_string_format("format_unsigned_int_component_width_prec", 6).
:- pred mict_table_builtin(string::in, int::in) is semidet.
:- pragma inline(pred(mict_table_builtin/2)).

View File

@@ -574,7 +574,7 @@ EOF
$BOOTSTRAP_MC \
--verbose \
$link_static_opt conftest \
--trans-opt-deps-spec dummy \
--format-2023-01-27 \
--no-ssdb \
</dev/null >&AS_MESSAGE_LOG_FD 2>&1 &&
test "`./conftest 2>&1 | tr -d '\015'`" = "Hello, world" &&

View File

@@ -59,15 +59,6 @@
:- pred format_signed_int_component_width_prec(string_format_flags::in,
int::in, int::in, int::in, string::out) is det.
:- pred format_unsigned_int_component_nowidth_noprec(string_format_flags::in,
string_format_int_base::in, int::in, string::out) is det.
:- pred format_unsigned_int_component_nowidth_prec(string_format_flags::in,
int::in, string_format_int_base::in, int::in, string::out) is det.
:- pred format_unsigned_int_component_width_noprec(string_format_flags::in,
int::in, string_format_int_base::in, int::in, string::out) is det.
:- pred format_unsigned_int_component_width_prec(string_format_flags::in,
int::in, int::in, string_format_int_base::in, int::in, string::out) is det.
:- pred format_uint_component_nowidth_noprec(string_format_flags::in,
string_format_int_base::in, uint::in, string::out) is det.
:- pred format_uint_component_nowidth_prec(string_format_flags::in,
@@ -317,33 +308,6 @@ format_signed_int_component_width_prec(Flags, Width, Prec, Int, String) :-
%---------------------------------------------------------------------------%
format_unsigned_int_component_nowidth_noprec(Flags, Base, Int, String) :-
MaybeWidth = no_specified_width,
MaybePrec = no_specified_prec,
format_unsigned_int_component(Flags, MaybeWidth, MaybePrec, Base, Int,
String).
format_unsigned_int_component_nowidth_prec(Flags, Prec, Base, Int, String) :-
MaybeWidth = no_specified_width,
MaybePrec = specified_prec(Prec),
format_unsigned_int_component(Flags, MaybeWidth, MaybePrec, Base, Int,
String).
format_unsigned_int_component_width_noprec(Flags, Width, Base, Int, String) :-
MaybeWidth = specified_width(Width),
MaybePrec = no_specified_prec,
format_unsigned_int_component(Flags, MaybeWidth, MaybePrec, Base, Int,
String).
format_unsigned_int_component_width_prec(Flags, Width, Prec, Base, Int,
String) :-
MaybeWidth = specified_width(Width),
MaybePrec = specified_prec(Prec),
format_unsigned_int_component(Flags, MaybeWidth, MaybePrec, Base, Int,
String).
%---------------------------------------------------------------------------%
format_uint_component_nowidth_noprec(Flags, Base, UInt, String) :-
MaybeWidth = no_specified_width,
MaybePrec = no_specified_prec,
@@ -524,27 +488,6 @@ format_signed_int_component(Flags, MaybeWidth, MaybePrec, Int, String) :-
String = format_signed_int(Flags, MaybeWidth, MaybePrec, Int)
).
:- pred format_unsigned_int_component(string_format_flags::in,
string_format_maybe_width::in, string_format_maybe_prec::in,
string_format_int_base::in, int::in, string::out) is det.
format_unsigned_int_component(Flags, MaybeWidth, MaybePrec, Base, Int,
String) :-
( if using_sprintf then
( Base = base_octal, SpecChar = "o"
; Base = base_decimal, SpecChar = "u"
; Base = base_hex_lc, SpecChar = "x"
; Base = base_hex_uc, SpecChar = "X"
; Base = base_hex_p, SpecChar = "p"
),
FormatStr = make_format_sprintf(Flags, MaybeWidth, MaybePrec,
int_length_modifier, SpecChar),
String = native_format_int(FormatStr, Int)
else
UInt = cast_from_int(Int),
String = format_uint(Flags, MaybeWidth, MaybePrec, Base, UInt)
).
:- pred format_uint_component(string_format_flags::in,
string_format_maybe_width::in, string_format_maybe_prec::in,
string_format_int_base::in, uint::in, string::out) is det.