Skip to content

Commit 0a2c43e

Browse files
Add DEPRECATED to functions documented as \deprecated
1 parent 116fffd commit 0a2c43e

9 files changed

+34
-3
lines changed

src/goto-instrument/cover.cpp

+5
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ Date: May 2016
1818
#include <util/make_unique.h>
1919
#include <util/cmdline.h>
2020
#include <util/options.h>
21+
#include <util/deprecate.h>
2122

2223
#include "cover_basic_blocks.h"
2324

@@ -51,6 +52,10 @@ void instrument_cover_goals(
5152
/// \deprecated use instrument_cover_goals(goto_programt &goto_program,
5253
/// const cover_instrumenterst &instrumenters,
5354
/// message_handlert &message_handler, const irep_idt mode) instead
55+
DEPRECATED(
56+
"use instrument_cover_goals(goto_programt &goto_program,"
57+
"const cover_instrumenterst &instrumenters,"
58+
"message_handlert &message_handler, const irep_idt mode) instead")
5459
void instrument_cover_goals(
5560
const symbol_tablet &symbol_table,
5661
goto_programt &goto_program,

src/solvers/refinement/string_constraint_generator.h

+2
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ Author: Romain Brenguier, [email protected]
2525
#include <util/replace_expr.h>
2626
#include <util/refined_string_type.h>
2727
#include <util/constexpr.def>
28+
#include <util/deprecate.h>
2829
#include <solvers/refinement/string_constraint.h>
2930

3031
/// Generation of fresh symbols of a given type
@@ -351,6 +352,7 @@ class string_constraint_generatort final
351352
/// \todo This function is underspecified, we do not compute the exact value
352353
/// but over approximate it.
353354
/// \deprecated This is Java specific and should be implemented in Java.
355+
DEPRECATED("This is Java specific and should be implemented in Java")
354356
exprt add_axioms_for_code_point_count(const function_application_exprt &f);
355357

356358
/// Add axioms corresponding the String.offsetByCodePointCount java function

src/solvers/refinement/string_constraint_generator_comparison.cpp

+2
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ Author: Romain Brenguier, [email protected]
1212
/// equals, equalsIgnoreCase, compareTo, hashCode, intern
1313

1414
#include <solvers/refinement/string_constraint_generator.h>
15+
#include <util/deprecate.h>
1516

1617
/// Equality of the content of two strings
1718
///
@@ -267,6 +268,7 @@ exprt string_constraint_generatort::add_axioms_for_compare_to(
267268
/// \deprecated never tested
268269
/// \param f: function application with one string argument
269270
/// \return a string expression
271+
DEPRECATED("never tested")
270272
symbol_exprt string_constraint_generatort::add_axioms_for_intern(
271273
const function_application_exprt &f)
272274
{

src/solvers/refinement/string_constraint_generator_insert.cpp

+6-1
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ Author: Romain Brenguier, [email protected]
1111

1212
#include <solvers/refinement/string_refinement_invariant.h>
1313
#include <solvers/refinement/string_constraint_generator.h>
14+
#include <util/deprecate.h>
1415

1516
/// Add axioms ensuring the result `res` corresponds to `s1` where we
1617
/// inserted `s2` at position `offset`.
@@ -126,10 +127,11 @@ exprt string_constraint_generatort::add_axioms_for_insert(
126127
}
127128

128129
/// add axioms corresponding to the StringBuilder.insert(I) java function
129-
/// \deprecated
130+
/// \deprecated should convert the value to string and call insert
130131
/// \param f: function application with three arguments: a string, an
131132
/// integer offset, and an integer
132133
/// \return an expression
134+
DEPRECATED("should convert the value to string and call insert")
133135
exprt string_constraint_generatort::add_axioms_for_insert_int(
134136
const function_application_exprt &f)
135137
{
@@ -150,6 +152,7 @@ exprt string_constraint_generatort::add_axioms_for_insert_int(
150152
/// \param f: function application with three arguments: a string, an
151153
/// integer offset, and a Boolean
152154
/// \return a new string expression
155+
DEPRECATED("should convert the value to string and call insert")
153156
exprt string_constraint_generatort::add_axioms_for_insert_bool(
154157
const function_application_exprt &f)
155158
{
@@ -190,6 +193,7 @@ exprt string_constraint_generatort::add_axioms_for_insert_char(
190193
/// \param f: function application with three arguments: a string, an
191194
/// integer offset, and a double
192195
/// \return a string expression
196+
DEPRECATED("should convert the value to string and call insert")
193197
exprt string_constraint_generatort::add_axioms_for_insert_double(
194198
const function_application_exprt &f)
195199
{
@@ -211,6 +215,7 @@ exprt string_constraint_generatort::add_axioms_for_insert_double(
211215
/// \param f: function application with three arguments: a string, an
212216
/// integer offset, and a float
213217
/// \return a new string expression
218+
DEPRECATED("should convert the value to string and call insert")
214219
exprt string_constraint_generatort::add_axioms_for_insert_float(
215220
const function_application_exprt &f)
216221
{

src/solvers/refinement/string_constraint_generator_main.cpp

+2
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ Author: Romain Brenguier, [email protected]
2626
#include <util/pointer_predicates.h>
2727
#include <util/ssa_expr.h>
2828
#include <util/string_constant.h>
29+
#include <util/deprecate.h>
2930

3031
string_constraint_generatort::string_constraint_generatort(
3132
const string_constraint_generatort::infot &info,
@@ -581,6 +582,7 @@ exprt string_constraint_generatort::add_axioms_for_function_application(
581582
/// \param f: function application with one argument, which is a string,
582583
/// or three arguments: string, integer offset and count
583584
/// \return a new string expression
585+
DEPRECATED("should use substring instead")
584586
exprt string_constraint_generatort::add_axioms_for_copy(
585587
const function_application_exprt &f)
586588
{

src/solvers/refinement/string_constraint_generator_testing.cpp

+2
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ Author: Romain Brenguier, [email protected]
1212

1313
#include <solvers/refinement/string_refinement_invariant.h>
1414
#include <solvers/refinement/string_constraint_generator.h>
15+
#include <util/deprecate.h>
1516

1617
/// Add axioms stating that the returned expression is true exactly when the
1718
/// first string is a prefix of the second one, starting at position offset.
@@ -97,6 +98,7 @@ exprt string_constraint_generatort::add_axioms_for_is_prefix(
9798
/// \deprecated should use `string_length(s)==0` instead
9899
/// \param f: function application with a string argument
99100
/// \return a Boolean expression
101+
DEPRECATED("should use `string_length(s)==0` instead")
100102
exprt string_constraint_generatort::add_axioms_for_is_empty(
101103
const function_application_exprt &f)
102104
{

src/solvers/refinement/string_constraint_generator_valueof.cpp

+7-2
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ Author: Romain Brenguier, [email protected]
1414
#include <solvers/refinement/string_refinement_invariant.h>
1515
#include <solvers/refinement/string_constraint_generator.h>
1616
#include <util/simplify_expr.h>
17+
#include <util/deprecate.h>
1718

1819
#include <cmath>
1920
#include <solvers/floatbv/float_bv.h>
@@ -40,6 +41,7 @@ exprt string_constraint_generatort::add_axioms_from_int(
4041
/// \deprecated should use add_axioms_from_int instead
4142
/// \param f: function application with one long argument
4243
/// \return a new string expression
44+
DEPRECATED("should use add_axioms_from_int instead")
4345
exprt string_constraint_generatort::add_axioms_from_long(
4446
const function_application_exprt &f)
4547
{
@@ -54,9 +56,10 @@ exprt string_constraint_generatort::add_axioms_from_long(
5456
}
5557

5658
/// Add axioms corresponding to the String.valueOf(Z) java function.
57-
/// \deprecated this is specific to Java
59+
/// \deprecated This is Java specific and should be implemented in Java instead
5860
/// \param f: function application with a Boolean argument
5961
/// \return a new string expression
62+
DEPRECATED("This is Java specific and should be implemented in Java instead")
6063
exprt string_constraint_generatort::add_axioms_from_bool(
6164
const function_application_exprt &f)
6265
{
@@ -68,10 +71,11 @@ exprt string_constraint_generatort::add_axioms_from_bool(
6871

6972
/// Add axioms stating that the returned string equals "true" when the Boolean
7073
/// expression is true and "false" when it is false.
71-
/// \deprecated This is language dependent
74+
/// \deprecated This is Java specific and should be implemented in Java instead
7275
/// \param res: string expression for the result
7376
/// \param b: Boolean expression
7477
/// \return code 0 on success
78+
DEPRECATED("This is Java specific and should be implemented in Java instead")
7579
exprt string_constraint_generatort::add_axioms_from_bool(
7680
const array_string_exprt &res,
7781
const exprt &b)
@@ -200,6 +204,7 @@ exprt string_constraint_generatort::int_of_hex_char(const exprt &chr)
200204
/// \param res: string expression for the result
201205
/// \param i: an integer argument
202206
/// \return code 0 on success
207+
DEPRECATED("use add_axioms_from_int which takes a radix argument instead")
203208
exprt string_constraint_generatort::add_axioms_from_int_hex(
204209
const array_string_exprt &res,
205210
const exprt &i)

src/util/arith_tools.h

+4
Original file line numberDiff line numberDiff line change
@@ -14,17 +14,21 @@ Author: Daniel Kroening, [email protected]
1414
#include "optional.h"
1515
#include "invariant.h"
1616

17+
#include "deprecate.h"
18+
1719
class exprt;
1820
class constant_exprt;
1921
class typet;
2022

2123
// this one will go away
2224
// returns 'true' on error
2325
/// \deprecated: use the constant_exprt version instead
26+
DEPRECATED("Use the constant_exprt version instead")
2427
bool to_integer(const exprt &expr, mp_integer &int_value);
2528

2629
// returns 'true' on error
2730
/// \deprecated: use numeric_cast<mp_integer> instead
31+
DEPRECATED("Use numeric_cast<mp_integer> instead")
2832
bool to_integer(const constant_exprt &expr, mp_integer &int_value);
2933

3034
// returns 'true' on error

src/util/mp_arith.h

+4
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ Author: Daniel Kroening, [email protected]
1616

1717
#include "big-int/bigint.hh"
1818
#include "optional.h"
19+
#include "deprecate.h"
1920

2021
// NOLINTNEXTLINE(readability/identifiers)
2122
typedef BigInt mp_integer;
@@ -52,12 +53,15 @@ const std::string integer2binary(const mp_integer &, std::size_t width);
5253
const mp_integer binary2integer(const std::string &, bool is_signed);
5354

5455
/// \deprecated use numeric_cast<unsigned long long> instead
56+
DEPRECATED("Use numeric_cast<unsigned long long> instead")
5557
mp_integer::ullong_t integer2ulong(const mp_integer &);
5658

5759
/// \deprecated use numeric_cast<std::size_t> instead
60+
DEPRECATED("Use numeric_cast<std::size_t> instead")
5861
std::size_t integer2size_t(const mp_integer &);
5962

6063
/// \deprecated use numeric_cast<unsigned> instead
64+
DEPRECATED("Use numeric_cast<unsigned> instead")
6165
unsigned integer2unsigned(const mp_integer &);
6266

6367
const mp_integer mp_zero=string2integer("0");

0 commit comments

Comments
 (0)