@@ -673,7 +673,8 @@ static void instantiate_atomic_fetch_op(
673
673
block.add (code_frontend_assignt{deref_ptr, std::move (op_expr)});
674
674
675
675
block.add (code_expressiont{side_effect_expr_function_callt{
676
- symbol_exprt::typeless (" __atomic_thread_fence" ),
676
+ symbol_exprt::typeless (" __atomic_thread_fence" )
677
+ .with_source_location <symbol_exprt>(source_location),
677
678
{parameter_exprs[2 ]},
678
679
typet{},
679
680
source_location}});
@@ -736,7 +737,8 @@ static void instantiate_atomic_op_fetch(
736
737
737
738
// this instruction implies an mfence, i.e., WRfence
738
739
block.add (code_expressiont{side_effect_expr_function_callt{
739
- symbol_exprt::typeless (" __atomic_thread_fence" ),
740
+ symbol_exprt::typeless (" __atomic_thread_fence" )
741
+ .with_source_location <symbol_exprt>(source_location),
740
742
{parameter_exprs[2 ]},
741
743
typet{},
742
744
source_location}});
@@ -767,11 +769,12 @@ static void instantiate_sync_fetch(
767
769
parameter_exprs[1 ],
768
770
from_integer (std::memory_order_seq_cst, signed_int_type ())};
769
771
770
- block.add (code_returnt{
771
- side_effect_expr_function_callt{symbol_exprt::typeless (atomic_name),
772
- std::move (arguments),
773
- typet{},
774
- source_location}});
772
+ block.add (code_returnt{side_effect_expr_function_callt{
773
+ symbol_exprt::typeless (atomic_name)
774
+ .with_source_location <symbol_exprt>(source_location),
775
+ std::move (arguments),
776
+ typet{},
777
+ source_location}});
775
778
}
776
779
777
780
static void instantiate_sync_bool_compare_and_swap (
@@ -790,7 +793,8 @@ static void instantiate_sync_bool_compare_and_swap(
790
793
// _Bool __sync_bool_compare_and_swap(type *ptr, type old, type new, ...)
791
794
792
795
block.add (code_returnt{side_effect_expr_function_callt{
793
- symbol_exprt::typeless (ID___atomic_compare_exchange),
796
+ symbol_exprt::typeless (ID___atomic_compare_exchange)
797
+ .with_source_location <symbol_exprt>(source_location),
794
798
{parameter_exprs[0 ],
795
799
address_of_exprt{parameter_exprs[1 ]},
796
800
address_of_exprt{parameter_exprs[2 ]},
@@ -968,7 +972,8 @@ static void instantiate_atomic_load(
968
972
dereference_exprt{parameter_exprs[0 ]}});
969
973
970
974
block.add (code_expressiont{side_effect_expr_function_callt{
971
- symbol_exprt::typeless (" __atomic_thread_fence" ),
975
+ symbol_exprt::typeless (" __atomic_thread_fence" )
976
+ .with_source_location <symbol_exprt>(source_location),
972
977
{parameter_exprs[2 ]},
973
978
typet{},
974
979
source_location}});
@@ -999,7 +1004,8 @@ static void instantiate_atomic_load_n(
999
1004
block.add (codet{ID_decl_block, {code_frontend_declt{result}}});
1000
1005
1001
1006
block.add (code_expressiont{side_effect_expr_function_callt{
1002
- symbol_exprt::typeless (ID___atomic_load),
1007
+ symbol_exprt::typeless (ID___atomic_load)
1008
+ .with_source_location <symbol_exprt>(source_location),
1003
1009
{parameter_exprs[0 ], address_of_exprt{result}, parameter_exprs[1 ]},
1004
1010
typet{},
1005
1011
source_location}});
@@ -1028,7 +1034,8 @@ static void instantiate_atomic_store(
1028
1034
dereference_exprt{parameter_exprs[1 ]}});
1029
1035
1030
1036
block.add (code_expressiont{side_effect_expr_function_callt{
1031
- symbol_exprt::typeless (" __atomic_thread_fence" ),
1037
+ symbol_exprt::typeless (" __atomic_thread_fence" )
1038
+ .with_source_location <symbol_exprt>(source_location),
1032
1039
{parameter_exprs[2 ]},
1033
1040
typet{},
1034
1041
source_location}});
@@ -1051,13 +1058,14 @@ static void instantiate_atomic_store_n(
1051
1058
// This built-in function implements an atomic store operation. It writes
1052
1059
// val into *ptr.
1053
1060
1054
- block.add (code_expressiont{
1055
- side_effect_expr_function_callt{symbol_exprt::typeless (ID___atomic_store),
1056
- {parameter_exprs[0 ],
1057
- address_of_exprt{parameter_exprs[1 ]},
1058
- parameter_exprs[2 ]},
1059
- typet{},
1060
- source_location}});
1061
+ block.add (code_expressiont{side_effect_expr_function_callt{
1062
+ symbol_exprt::typeless (ID___atomic_store)
1063
+ .with_source_location <symbol_exprt>(source_location),
1064
+ {parameter_exprs[0 ],
1065
+ address_of_exprt{parameter_exprs[1 ]},
1066
+ parameter_exprs[2 ]},
1067
+ typet{},
1068
+ source_location}});
1061
1069
}
1062
1070
1063
1071
static void instantiate_atomic_exchange (
@@ -1083,7 +1091,8 @@ static void instantiate_atomic_exchange(
1083
1091
dereference_exprt{parameter_exprs[1 ]}});
1084
1092
1085
1093
block.add (code_expressiont{side_effect_expr_function_callt{
1086
- symbol_exprt::typeless (" __atomic_thread_fence" ),
1094
+ symbol_exprt::typeless (" __atomic_thread_fence" )
1095
+ .with_source_location <symbol_exprt>(source_location),
1087
1096
{parameter_exprs[3 ]},
1088
1097
typet{},
1089
1098
source_location}});
@@ -1114,7 +1123,8 @@ static void instantiate_atomic_exchange_n(
1114
1123
block.add (codet{ID_decl_block, {code_frontend_declt{result}}});
1115
1124
1116
1125
block.add (code_expressiont{side_effect_expr_function_callt{
1117
- symbol_exprt::typeless (ID___atomic_exchange),
1126
+ symbol_exprt::typeless (ID___atomic_exchange)
1127
+ .with_source_location <symbol_exprt>(source_location),
1118
1128
{parameter_exprs[0 ],
1119
1129
address_of_exprt{parameter_exprs[1 ]},
1120
1130
address_of_exprt{result},
@@ -1171,7 +1181,8 @@ static void instantiate_atomic_compare_exchange(
1171
1181
dereference_exprt{parameter_exprs[2 ]}};
1172
1182
assign.add_source_location () = source_location;
1173
1183
code_expressiont success_fence{side_effect_expr_function_callt{
1174
- symbol_exprt::typeless (" __atomic_thread_fence" ),
1184
+ symbol_exprt::typeless (" __atomic_thread_fence" )
1185
+ .with_source_location <symbol_exprt>(source_location),
1175
1186
{parameter_exprs[4 ]},
1176
1187
typet{},
1177
1188
source_location}};
@@ -1181,7 +1192,8 @@ static void instantiate_atomic_compare_exchange(
1181
1192
deref_ptr};
1182
1193
assign_not_equal.add_source_location () = source_location;
1183
1194
code_expressiont failure_fence{side_effect_expr_function_callt{
1184
- symbol_exprt::typeless (" __atomic_thread_fence" ),
1195
+ symbol_exprt::typeless (" __atomic_thread_fence" )
1196
+ .with_source_location <symbol_exprt>(source_location),
1185
1197
{parameter_exprs[5 ]},
1186
1198
typet{},
1187
1199
source_location}};
@@ -1212,7 +1224,8 @@ static void instantiate_atomic_compare_exchange_n(
1212
1224
// desired, bool weak, int success_memorder, int failure_memorder)
1213
1225
1214
1226
block.add (code_returnt{side_effect_expr_function_callt{
1215
- symbol_exprt::typeless (ID___atomic_compare_exchange),
1227
+ symbol_exprt::typeless (ID___atomic_compare_exchange)
1228
+ .with_source_location <symbol_exprt>(source_location),
1216
1229
{parameter_exprs[0 ],
1217
1230
parameter_exprs[1 ],
1218
1231
address_of_exprt{parameter_exprs[2 ]},
0 commit comments