@@ -122,11 +122,8 @@ static codet get_monitor_call(
122
122
return code_skipt ();
123
123
124
124
// Otherwise we create a function call
125
- code_function_callt call;
126
- call.function () = symbol_exprt (symbol, it->second .type );
127
- call.lhs ().make_nil ();
128
- call.arguments ().push_back (object);
129
- return call;
125
+ return code_function_callt (
126
+ nil_exprt (), symbol_exprt (symbol, it->second .type ), {object});
130
127
}
131
128
132
129
// / Introduces a monitorexit before every return recursively.
@@ -288,11 +285,15 @@ static void instrument_start_thread(
288
285
289
286
// Create global variable __CPROVER__next_thread_id. Used as a counter
290
287
// in-order to to assign ids to new threads.
291
- const symbolt &next_symbol =
292
- add_or_get_symbol (
293
- symbol_table, next_thread_id, next_thread_id,
294
- java_int_type (),
295
- from_integer (0 , java_int_type ()), false , true );
288
+ const symbol_exprt next_symbol_expr = add_or_get_symbol (
289
+ symbol_table,
290
+ next_thread_id,
291
+ next_thread_id,
292
+ java_int_type (),
293
+ from_integer (0 , java_int_type ()),
294
+ false ,
295
+ true )
296
+ .symbol_expr ();
296
297
297
298
// Create thread-local variable __CPROVER__thread_id. Holds the id of
298
299
// the thread.
@@ -320,14 +321,11 @@ static void instrument_start_thread(
320
321
codet tmp_a (ID_start_thread);
321
322
tmp_a.set (ID_destination, lbl1);
322
323
code_gotot tmp_b (lbl2);
323
- code_labelt tmp_c (lbl1);
324
- tmp_c.op0 () = codet (ID_skip);
324
+ const code_labelt tmp_c (lbl1, code_skipt ());
325
325
326
- exprt plus (ID_plus, java_int_type ());
327
- plus.copy_to_operands (next_symbol.symbol_expr ());
328
- plus.copy_to_operands (from_integer (1 , java_int_type ()));
329
- code_assignt tmp_d (next_symbol.symbol_expr (), plus);
330
- code_assignt tmp_e (current_symbol.symbol_expr (), next_symbol.symbol_expr ());
326
+ const plus_exprt plus (next_symbol_expr, from_integer (1 , java_int_type ()));
327
+ const code_assignt tmp_d (next_symbol_expr, plus);
328
+ const code_assignt tmp_e (current_symbol.symbol_expr (), next_symbol_expr);
331
329
332
330
code_blockt block;
333
331
block.add (tmp_a);
@@ -368,8 +366,7 @@ static void instrument_end_thread(
368
366
// A: codet(id=ID_end_thread)
369
367
// B: codet(id=ID_label,label= __CPROVER_THREAD_EXIT_<ID>)
370
368
codet tmp_a (ID_end_thread);
371
- code_labelt tmp_b (lbl2);
372
- tmp_b.op0 () = codet (ID_skip);
369
+ const code_labelt tmp_b (lbl2, code_skipt ());
373
370
374
371
code_blockt block;
375
372
block.add (tmp_a);
0 commit comments