Skip to content

Commit a7c8500

Browse files
committedJan 24, 2019
Construct side_effect_expr_function_callt in a non-deprecated way
The constructor requires four arguments.
1 parent 0afc778 commit a7c8500

File tree

2 files changed

+5
-12
lines changed

2 files changed

+5
-12
lines changed
 

‎src/goto-instrument/goto_program2code.cpp

+4-10
Original file line numberDiff line numberDiff line change
@@ -342,9 +342,8 @@ goto_programt::const_targett goto_program2codet::convert_assign_varargs(
342342
{this_va_list_expr});
343343
f.arguments().back().type().id(ID_gcc_builtin_va_list);
344344

345-
side_effect_expr_function_callt type_of;
346-
type_of.function() =
347-
symbol_exprt("__typeof__", code_typet({}, empty_typet()));
345+
side_effect_expr_function_callt type_of(
346+
symbol_exprt("__typeof__", code_typet({}, empty_typet())), {}, typet{}, source_locationt{});
348347

349348
// if the return value is used, the next instruction will be assign
350349
goto_programt::const_targett next=target;
@@ -486,9 +485,7 @@ goto_programt::const_targett goto_program2codet::convert_decl(
486485
{
487486
// could hack this by just erasing the first operand
488487
const code_function_callt &f=to_code_function_call(next->code);
489-
side_effect_expr_function_callt call;
490-
call.function()=f.function();
491-
call.arguments()=f.arguments();
488+
side_effect_expr_function_callt call(f.function(), f.arguments(), typet{}, source_locationt{});
492489
d.copy_to_operands(call);
493490
}
494491

@@ -1920,10 +1917,7 @@ void goto_program2codet::cleanup_expr(exprt &expr, bool no_typecast)
19201917
symbol_exprt symbol_expr(symbol.name, symbol.type);
19211918
symbol_expr.add_source_location()=expr.source_location();
19221919

1923-
side_effect_expr_function_callt call;
1924-
call.add_source_location()=expr.source_location();
1925-
call.function()=symbol_expr;
1926-
call.type()=expr.type();
1920+
side_effect_expr_function_callt call(symbol_expr, {}, expr.type(), expr.source_location());
19271921

19281922
expr.swap(call);
19291923
}

‎src/jsil/parser.y

+1-2
Original file line numberDiff line numberDiff line change
@@ -267,8 +267,7 @@ instruction: TOK_LABEL TOK_IDENTIFIER
267267
rhs: expression
268268
| proc_ident_expr '(' expressions_opt ')' with_opt
269269
{
270-
side_effect_expr_function_callt f;
271-
f.function().swap(stack($1));
270+
side_effect_expr_function_callt f(stack($1), {}, typet{}, {});
272271
if(stack($3).is_not_nil())
273272
f.arguments().swap(stack($3).operands());
274273

0 commit comments

Comments
 (0)