File tree 6 files changed +23
-9
lines changed
6 files changed +23
-9
lines changed Original file line number Diff line number Diff line change @@ -126,9 +126,12 @@ class lazy_goto_functions_mapt final
126
126
driver_program_can_generate_function_body (name);
127
127
}
128
128
129
- void unload (const key_type &name) const
129
+ // / Remove the function named \p name from the function map, if it exists.
130
+ // / \return Returns 0 when \p name was not present, and 1 when \p name was
131
+ // / removed.
132
+ std::size_t unload (const key_type &name) const
130
133
{
131
- goto_functions.erase (name);
134
+ return goto_functions.erase (name);
132
135
}
133
136
134
137
void ensure_function_loaded (const key_type &name) const
Original file line number Diff line number Diff line change @@ -170,7 +170,7 @@ void lazy_goto_modelt::initialize(
170
170
set_up_custom_entry_point (
171
171
language_files,
172
172
symbol_table,
173
- [this ](const irep_idt &id) { goto_functions.unload (id); },
173
+ [this ](const irep_idt &id) { return goto_functions.unload (id); },
174
174
options,
175
175
false ,
176
176
message_handler);
Original file line number Diff line number Diff line change @@ -66,8 +66,13 @@ class goto_functionst
66
66
return *this ;
67
67
}
68
68
69
- // / Remove function from the function map
70
- void unload (const irep_idt &name) { function_map.erase (name); }
69
+ // / Remove the function named \p name from the function map, if it exists.
70
+ // / \return Returns 0 when \p name was not present, and 1 when \p name was
71
+ // / removed.
72
+ std::size_t unload (const irep_idt &name)
73
+ {
74
+ return function_map.erase (name);
75
+ }
71
76
72
77
void clear ()
73
78
{
Original file line number Diff line number Diff line change @@ -66,7 +66,13 @@ class goto_modelt : public abstract_goto_modelt
66
66
return *this ;
67
67
}
68
68
69
- void unload (const irep_idt &name) { goto_functions.unload (name); }
69
+ // / Remove the function named \p name from the function map, if it exists.
70
+ // / \return Returns 0 when \p name was not present, and 1 when \p name was
71
+ // / removed.
72
+ std::size_t unload (const irep_idt &name)
73
+ {
74
+ return goto_functions.unload (name);
75
+ }
70
76
71
77
// Implement the abstract goto model interface:
72
78
Original file line number Diff line number Diff line change @@ -120,7 +120,7 @@ void initialize_from_source_files(
120
120
void set_up_custom_entry_point (
121
121
language_filest &language_files,
122
122
symbol_tablet &symbol_table,
123
- const std::function<void (const irep_idt &)> &unload,
123
+ const std::function<std:: size_t (const irep_idt &)> &unload,
124
124
const optionst &options,
125
125
bool try_mode_lookup,
126
126
message_handlert &message_handler)
@@ -213,7 +213,7 @@ goto_modelt initialize_goto_model(
213
213
set_up_custom_entry_point (
214
214
language_files,
215
215
goto_model.symbol_table ,
216
- [&goto_model](const irep_idt &id) { goto_model. goto_functions .unload (id); },
216
+ [&goto_model](const irep_idt &id) { return goto_model.unload (id); },
217
217
options,
218
218
true ,
219
219
message_handler);
Original file line number Diff line number Diff line change @@ -51,7 +51,7 @@ void initialize_from_source_files(
51
51
void set_up_custom_entry_point (
52
52
language_filest &language_files,
53
53
symbol_tablet &symbol_table,
54
- const std::function<void (const irep_idt &)> &unload,
54
+ const std::function<std:: size_t (const irep_idt &)> &unload,
55
55
const optionst &options,
56
56
bool try_mode_lookup,
57
57
message_handlert &message_handler);
You can’t perform that action at this time.
0 commit comments