@@ -315,33 +315,31 @@ goto_programt::const_targett goto_program2codet::convert_assign_varargs(
315
315
const exprt this_va_list_expr=assign.lhs ();
316
316
const exprt &r=skip_typecast (assign.rhs ());
317
317
318
- // we don't bother setting the type
319
- code_function_callt f;
320
- f.lhs ().make_nil ();
321
-
322
318
if (r.id ()==ID_constant &&
323
319
(r.is_zero () || to_constant_expr (r).get_value ()==ID_NULL))
324
320
{
325
- f.function () = symbol_exprt (" va_end" , code_typet ({}, empty_typet ()));
326
- f.arguments ().push_back (this_va_list_expr);
321
+ code_function_callt f (
322
+ symbol_exprt (" va_end" , code_typet ({}, empty_typet ())),
323
+ {this_va_list_expr});
327
324
f.arguments ().back ().type ().id (ID_gcc_builtin_va_list);
328
325
329
326
dest.add_to_operands (std::move (f));
330
327
}
331
328
else if (r.id ()==ID_address_of)
332
329
{
333
- f. function () = symbol_exprt ( " va_start " , code_typet ({}, empty_typet ()));
334
- f. arguments (). push_back (this_va_list_expr);
335
- f. arguments (). back (). type (). id (ID_gcc_builtin_va_list );
336
- f.arguments ().push_back ( to_address_of_expr (r). object () );
330
+ code_function_callt f (
331
+ symbol_exprt ( " va_start " , code_typet ({}, empty_typet ())),
332
+ {this_va_list_expr, to_address_of_expr (r). object ()} );
333
+ f.arguments ().front (). type (). id (ID_gcc_builtin_va_list );
337
334
338
335
dest.add_to_operands (std::move (f));
339
336
}
340
337
else if (r.id ()==ID_side_effect &&
341
338
to_side_effect_expr (r).get_statement ()==ID_gcc_builtin_va_arg_next)
342
339
{
343
- f.function () = symbol_exprt (" va_arg" , code_typet ({}, empty_typet ()));
344
- f.arguments ().push_back (this_va_list_expr);
340
+ code_function_callt f (
341
+ symbol_exprt (" va_arg" , code_typet ({}, empty_typet ())),
342
+ {this_va_list_expr});
345
343
f.arguments ().back ().type ().id (ID_gcc_builtin_va_list);
346
344
347
345
side_effect_expr_function_callt type_of;
@@ -388,10 +386,10 @@ goto_programt::const_targett goto_program2codet::convert_assign_varargs(
388
386
}
389
387
else
390
388
{
391
- f. function () = symbol_exprt ( " va_copy " , code_typet ({}, empty_typet ()));
392
- f. arguments (). push_back (this_va_list_expr);
393
- f. arguments (). back (). type (). id (ID_gcc_builtin_va_list );
394
- f.arguments ().push_back (r );
389
+ code_function_callt f (
390
+ symbol_exprt ( " va_copy " , code_typet ({}, empty_typet ())),
391
+ {this_va_list_expr, r} );
392
+ f.arguments ().front (). type (). id (ID_gcc_builtin_va_list );
395
393
396
394
dest.add_to_operands (std::move (f));
397
395
}
0 commit comments