Skip to content

Commit 58681ba

Browse files
committed
Make messaget a member
remove_function_pointerst is not a logger, but instead it now has one. This avoids a somewhat surprising shadowing of an "mstream" class member, which really just is messaget's class member.
1 parent 62280d2 commit 58681ba

File tree

1 file changed

+12
-9
lines changed

1 file changed

+12
-9
lines changed

src/goto-programs/remove_function_pointers.cpp

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ Author: Daniel Kroening, [email protected]
3030
#include "compute_called_functions.h"
3131
#include "remove_const_function_pointers.h"
3232

33-
class remove_function_pointerst:public messaget
33+
class remove_function_pointerst
3434
{
3535
public:
3636
remove_function_pointerst(
@@ -59,6 +59,7 @@ class remove_function_pointerst:public messaget
5959
const functionst &functions);
6060

6161
protected:
62+
messaget log;
6263
const namespacet ns;
6364
symbol_tablet &symbol_table;
6465
bool add_safety_assertion;
@@ -114,7 +115,7 @@ remove_function_pointerst::remove_function_pointerst(
114115
symbol_tablet &_symbol_table,
115116
bool _add_safety_assertion, bool only_resolve_const_fps,
116117
const goto_functionst &goto_functions):
117-
messaget(_message_handler),
118+
log(_message_handler),
118119
ns(_symbol_table),
119120
symbol_table(_symbol_table),
120121
add_safety_assertion(_add_safety_assertion),
@@ -304,9 +305,10 @@ void remove_function_pointerst::remove_function_pointer(
304305
const auto does_remove_const = const_removal_check();
305306
if(does_remove_const.first)
306307
{
307-
warning().source_location = does_remove_const.second;
308-
warning() << "cast from const to non-const pointer found, only worst case"
309-
<< " function pointer removal will be done." << eom;
308+
log.warning().source_location = does_remove_const.second;
309+
log.warning() << "cast from const to non-const pointer found, "
310+
<< "only worst case function pointer removal will be done."
311+
<< messaget::eom;
310312
found_functions=false;
311313
}
312314
else
@@ -455,13 +457,14 @@ void remove_function_pointerst::remove_function_pointer(
455457
target->type=OTHER;
456458

457459
// report statistics
458-
statistics().source_location=target->source_location;
459-
statistics() << "replacing function pointer by "
460-
<< functions.size() << " possible targets" << eom;
460+
log.statistics().source_location=target->source_location;
461+
log.statistics() << "replacing function pointer by "
462+
<< functions.size() << " possible targets"
463+
<< messaget::eom;
461464

462465
// list the names of functions when verbosity is at debug level
463466
conditional_output(
464-
debug(),
467+
log.debug(),
465468
[&functions](mstreamt &mstream) {
466469
mstream << "targets: ";
467470

0 commit comments

Comments
 (0)