@@ -1065,15 +1065,14 @@ void goto_convertt::do_function_call_symbol(
1065
1065
throw 0 ;
1066
1066
}
1067
1067
1068
- goto_programt::targett t=dest.add_instruction (OTHER);
1069
- t->source_location =function.source_location ();
1070
- t->code .set (ID_statement, ID_fence);
1071
-
1068
+ codet fence (ID_fence);
1072
1069
forall_expr (it, arguments)
1073
1070
{
1074
1071
const irep_idt kind=get_string_constant (*it);
1075
- t-> code .set (kind, true );
1072
+ fence .set (kind, true );
1076
1073
}
1074
+
1075
+ dest.add (goto_programt::make_other (fence, function.source_location ()));
1077
1076
}
1078
1077
else if (identifier==" __builtin_prefetch" )
1079
1078
{
@@ -1268,10 +1267,9 @@ void goto_convertt::do_function_call_symbol(
1268
1267
t3->code =code_assignt (deref_ptr, op_expr);
1269
1268
1270
1269
// this instruction implies an mfence, i.e., WRfence
1271
- goto_programt::targett t4=dest.add_instruction (OTHER);
1272
- t4->source_location =function.source_location ();
1273
- t4->code =codet (ID_fence);
1274
- t4->code .set (ID_WRfence, true );
1270
+ codet fence (ID_fence);
1271
+ fence.set (ID_WRfence, true );
1272
+ dest.add (goto_programt::make_other (fence, function.source_location ()));
1275
1273
1276
1274
goto_programt::targett t5=dest.add_instruction (ATOMIC_END);
1277
1275
t5->source_location =function.source_location ();
@@ -1339,10 +1337,9 @@ void goto_convertt::do_function_call_symbol(
1339
1337
}
1340
1338
1341
1339
// this instruction implies an mfence, i.e., WRfence
1342
- goto_programt::targett t4=dest.add_instruction (OTHER);
1343
- t4->source_location =function.source_location ();
1344
- t4->code =codet (ID_fence);
1345
- t4->code .set (ID_WRfence, true );
1340
+ codet fence (ID_fence);
1341
+ fence.set (ID_WRfence, true );
1342
+ dest.add (goto_programt::make_other (fence, function.source_location ()));
1346
1343
1347
1344
goto_programt::targett t5=dest.add_instruction (ATOMIC_END);
1348
1345
t5->source_location =function.source_location ();
@@ -1410,10 +1407,9 @@ void goto_convertt::do_function_call_symbol(
1410
1407
t3->code =code_assignt (deref_ptr, if_expr);
1411
1408
1412
1409
// this instruction implies an mfence, i.e., WRfence
1413
- goto_programt::targett t4=dest.add_instruction (OTHER);
1414
- t4->source_location =function.source_location ();
1415
- t4->code =codet (ID_fence);
1416
- t4->code .set (ID_WRfence, true );
1410
+ codet fence (ID_fence);
1411
+ fence.set (ID_WRfence, true );
1412
+ dest.add (goto_programt::make_other (fence, function.source_location ()));
1417
1413
1418
1414
goto_programt::targett t5=dest.add_instruction (ATOMIC_END);
1419
1415
t5->source_location =function.source_location ();
@@ -1471,10 +1467,9 @@ void goto_convertt::do_function_call_symbol(
1471
1467
t3->code =code_assignt (deref_ptr, if_expr);
1472
1468
1473
1469
// this instruction implies an mfence, i.e., WRfence
1474
- goto_programt::targett t4=dest.add_instruction (OTHER);
1475
- t4->source_location =function.source_location ();
1476
- t4->code =codet (ID_fence);
1477
- t4->code .set (ID_WRfence, true );
1470
+ codet fence (ID_fence);
1471
+ fence.set (ID_WRfence, true );
1472
+ dest.add (goto_programt::make_other (fence, function.source_location ()));
1478
1473
1479
1474
goto_programt::targett t5=dest.add_instruction (ATOMIC_END);
1480
1475
t5->source_location =function.source_location ();
0 commit comments