@@ -104,6 +104,8 @@ void remove_virtual_functionst::remove_virtual_function(
104
104
const code_function_callt &code=
105
105
to_code_function_call (target->code );
106
106
107
+ const auto &vcall_source_loc=target->source_location ;
108
+
107
109
const exprt &function=code.function ();
108
110
assert (function.id ()==ID_virtual_function);
109
111
assert (!code.arguments ().empty ());
@@ -133,6 +135,8 @@ void remove_virtual_functionst::remove_virtual_function(
133
135
goto_programt final_skip;
134
136
135
137
goto_programt::targett t_final=final_skip.add_instruction ();
138
+ t_final->source_location =vcall_source_loc;
139
+
136
140
t_final->make_skip ();
137
141
138
142
// build the calls and gotos
@@ -161,6 +165,7 @@ void remove_virtual_functionst::remove_virtual_function(
161
165
if (insertit.second )
162
166
{
163
167
goto_programt::targett t1=new_code_calls.add_instruction ();
168
+ t1->source_location =vcall_source_loc;
164
169
if (!fun.symbol_expr .get_identifier ().empty ())
165
170
{
166
171
// call function
@@ -179,6 +184,7 @@ void remove_virtual_functionst::remove_virtual_function(
179
184
insertit.first ->second =t1;
180
185
// goto final
181
186
goto_programt::targett t3=new_code_calls.add_instruction ();
187
+ t3->source_location =vcall_source_loc;
182
188
t3->make_goto (t_final, true_exprt ());
183
189
}
184
190
@@ -188,6 +194,7 @@ void remove_virtual_functionst::remove_virtual_function(
188
194
{
189
195
exprt c_id1=constant_exprt (fun.class_id , string_typet ());
190
196
goto_programt::targett t4=new_code_gotos.add_instruction ();
197
+ t4->source_location =vcall_source_loc;
191
198
t4->make_goto (insertit.first ->second , equal_exprt (c_id1, c_id2));
192
199
}
193
200
}
0 commit comments