Skip to content

Commit 71a4d6d

Browse files
authored
Merge pull request #5620 from tautschnig/messaget-string_abstraction
string_abstractiont isn't a messaget
2 parents 942f55b + e700484 commit 71a4d6d

File tree

2 files changed

+15
-11
lines changed

2 files changed

+15
-11
lines changed

src/goto-programs/string_abstraction.cpp

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ Author: Daniel Kroening, [email protected]
1717
#include <util/c_types.h>
1818
#include <util/exception_utils.h>
1919
#include <util/expr_util.h>
20+
#include <util/message.h>
2021
#include <util/pointer_predicates.h>
2122
#include <util/string_constant.h>
2223

@@ -44,8 +45,9 @@ bool string_abstractiont::build_wrap(
4445
!(dest.type().id() == ID_array && a_t.id() == ID_pointer &&
4546
dest.type().subtype() == a_t.subtype()))
4647
{
47-
warning() << "warning: inconsistent abstract type for "
48-
<< object.pretty() << eom;
48+
messaget log{message_handler};
49+
log.warning() << "warning: inconsistent abstract type for "
50+
<< object.pretty() << messaget::eom;
4951
return true;
5052
}
5153

@@ -92,13 +94,13 @@ void string_abstraction(
9294

9395
string_abstractiont::string_abstractiont(
9496
symbol_tablet &_symbol_table,
95-
message_handlert &_message_handler):
96-
messaget(_message_handler),
97-
arg_suffix("#strarg"),
98-
sym_suffix("#str$fcn"),
99-
symbol_table(_symbol_table),
100-
ns(_symbol_table),
101-
temporary_counter(0)
97+
message_handlert &_message_handler)
98+
: arg_suffix("#strarg"),
99+
sym_suffix("#str$fcn"),
100+
symbol_table(_symbol_table),
101+
ns(_symbol_table),
102+
temporary_counter(0),
103+
message_handler(_message_handler)
102104
{
103105
struct_typet s({{"is_zero", build_type(whatt::IS_ZERO)},
104106
{"length", build_type(whatt::LENGTH)},

src/goto-programs/string_abstraction.h

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,18 +13,19 @@ Author: Daniel Kroening, [email protected]
1313
#define CPROVER_GOTO_PROGRAMS_STRING_ABSTRACTION_H
1414

1515
#include <util/symbol_table.h>
16-
#include <util/message.h>
1716
#include <util/config.h>
1817
#include <util/std_expr.h>
1918

2019
#include "goto_model.h"
2120

21+
class message_handlert;
22+
2223
/// Replace all uses of `char *` by a struct that carries that string, and also
2324
/// the underlying allocation and the C string length.
2425
/// This will become useful (with some modifications) for supporting strings in
2526
/// the C frontend, as the string solver expects a struct that bundles the
2627
/// string length and the underlying character array.
27-
class string_abstractiont:public messaget
28+
class string_abstractiont
2829
{
2930
public:
3031
string_abstractiont(
@@ -40,6 +41,7 @@ class string_abstractiont:public messaget
4041
symbol_tablet &symbol_table;
4142
namespacet ns;
4243
unsigned temporary_counter;
44+
message_handlert &message_handler;
4345

4446
typedef ::std::map< typet, typet > abstraction_types_mapt;
4547
abstraction_types_mapt abstraction_types_map;

0 commit comments

Comments
 (0)