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