30
30
#include " compute_called_functions.h"
31
31
#include " remove_const_function_pointers.h"
32
32
33
- class remove_function_pointerst : public messaget
33
+ class remove_function_pointerst
34
34
{
35
35
public:
36
36
remove_function_pointerst (
@@ -59,6 +59,7 @@ class remove_function_pointerst:public messaget
59
59
const functionst &functions);
60
60
61
61
protected:
62
+ messaget log;
62
63
const namespacet ns;
63
64
symbol_tablet &symbol_table;
64
65
bool add_safety_assertion;
@@ -112,13 +113,14 @@ class remove_function_pointerst:public messaget
112
113
remove_function_pointerst::remove_function_pointerst (
113
114
message_handlert &_message_handler,
114
115
symbol_tablet &_symbol_table,
115
- bool _add_safety_assertion, bool only_resolve_const_fps,
116
- const goto_functionst &goto_functions):
117
- messaget(_message_handler),
118
- ns(_symbol_table),
119
- symbol_table(_symbol_table),
120
- add_safety_assertion(_add_safety_assertion),
121
- only_resolve_const_fps(only_resolve_const_fps)
116
+ bool _add_safety_assertion,
117
+ bool only_resolve_const_fps,
118
+ const goto_functionst &goto_functions)
119
+ : log(_message_handler),
120
+ ns(_symbol_table),
121
+ symbol_table(_symbol_table),
122
+ add_safety_assertion(_add_safety_assertion),
123
+ only_resolve_const_fps(only_resolve_const_fps)
122
124
{
123
125
compute_address_taken_in_symbols (address_taken);
124
126
compute_address_taken_functions (goto_functions, address_taken);
@@ -304,15 +306,16 @@ void remove_function_pointerst::remove_function_pointer(
304
306
const auto does_remove_const = const_removal_check ();
305
307
if (does_remove_const.first )
306
308
{
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;
309
+ log .warning ().source_location = does_remove_const.second ;
310
+ log .warning () << " cast from const to non-const pointer found, "
311
+ << " only worst case function pointer removal will be done."
312
+ << messaget::eom;
310
313
found_functions=false ;
311
314
}
312
315
else
313
316
{
314
317
remove_const_function_pointerst fpr (
315
- get_message_handler (), ns, symbol_table);
318
+ log . get_message_handler (), ns, symbol_table);
316
319
317
320
found_functions=fpr (pointer, functions);
318
321
@@ -455,14 +458,13 @@ void remove_function_pointerst::remove_function_pointer(
455
458
target->type =OTHER;
456
459
457
460
// report statistics
458
- statistics ().source_location = target->source_location ;
459
- statistics () << " replacing function pointer by "
460
- << functions. size () << " possible targets" << eom;
461
+ log . statistics ().source_location = target->source_location ;
462
+ log . statistics () << " replacing function pointer by " << functions. size ()
463
+ << " possible targets" << messaget:: eom;
461
464
462
465
// list the names of functions when verbosity is at debug level
463
- conditional_output (
464
- debug (),
465
- [&functions](mstreamt &mstream) {
466
+ log .conditional_output (
467
+ log .debug (), [&functions](messaget::mstreamt &mstream) {
466
468
mstream << " targets: " ;
467
469
468
470
bool first = true ;
@@ -475,7 +477,7 @@ void remove_function_pointerst::remove_function_pointer(
475
477
first = false ;
476
478
}
477
479
478
- mstream << eom;
480
+ mstream << messaget:: eom;
479
481
});
480
482
}
481
483
0 commit comments