File tree 2 files changed +16
-6
lines changed
2 files changed +16
-6
lines changed Original file line number Diff line number Diff line change @@ -845,6 +845,11 @@ void goto_instrument_parse_optionst::do_indirect_call_and_rtti_removal(
845
845
remove_exceptions (goto_model);
846
846
status () << " Java instanceof removal" << eom;
847
847
remove_instanceof (goto_model);
848
+ status () << " Cleaning inline assembler statements" << eom;
849
+ remove_asm (goto_model);
850
+
851
+ goto_model.goto_functions .update ();
852
+ goto_model.goto_functions .compute_loop_numbers ();
848
853
}
849
854
850
855
// / Remove function pointers that can be resolved by analysing const variables
@@ -1220,12 +1225,6 @@ void goto_instrument_parse_optionst::instrument_goto_program()
1220
1225
1221
1226
if (cmdline.isset (" mm" ))
1222
1227
{
1223
- // TODO: move to wmm/weak_mem, and copy goto_functions AFTER some of the
1224
- // modifications. Do the analysis on the copy, after remove_asm, and
1225
- // instrument the original (without remove_asm)
1226
- remove_asm (goto_model);
1227
- goto_model.goto_functions .update ();
1228
-
1229
1228
std::string mm=cmdline.get_value (" mm" );
1230
1229
memory_modelt model;
1231
1230
Original file line number Diff line number Diff line change @@ -22,6 +22,8 @@ Date: December 2014
22
22
23
23
#include < assembler/assembler_parser.h>
24
24
25
+ #include " remove_skip.h"
26
+
25
27
class remove_asmt
26
28
{
27
29
public:
@@ -281,20 +283,29 @@ void remove_asmt::process_instruction(
281
283
void remove_asmt::process_function (
282
284
goto_functionst::goto_functiont &goto_function)
283
285
{
286
+ bool did_something=false ;
287
+
284
288
Forall_goto_program_instructions (it, goto_function.body )
285
289
{
286
290
if (it->is_other () && it->code .get_statement ()==ID_asm)
287
291
{
288
292
goto_programt tmp_dest;
289
293
process_instruction (*it, tmp_dest);
290
294
it->make_skip ();
295
+ did_something=true ;
291
296
292
297
goto_programt::targett next=it;
293
298
next++;
294
299
295
300
goto_function.body .destructive_insert (next, tmp_dest);
296
301
}
297
302
}
303
+
304
+ if (did_something)
305
+ {
306
+ remove_skip (goto_function.body );
307
+ goto_function.body .update ();
308
+ }
298
309
}
299
310
300
311
// / removes assembler
You can’t perform that action at this time.
0 commit comments