@@ -64,7 +64,7 @@ void jsil_typecheckt::make_type_compatible(
64
64
{
65
65
if (type.id ().empty () || type.is_nil ())
66
66
{
67
- err_location ( expr);
67
+ error (). source_location = expr. source_location ( );
68
68
error () << " make_type_compatible got empty type: " << expr.pretty () << eom;
69
69
throw 0 ;
70
70
}
@@ -80,7 +80,7 @@ void jsil_typecheckt::make_type_compatible(
80
80
{
81
81
if (jsil_incompatible_types (expr.type (), type))
82
82
{
83
- err_location ( expr);
83
+ error (). source_location = expr. source_location ( );
84
84
error () << " failed to typecheck expr "
85
85
<< expr.pretty () << " with type "
86
86
<< expr.type ().pretty ()
@@ -153,7 +153,7 @@ void jsil_typecheckt::typecheck_expr_main(exprt &expr)
153
153
{
154
154
if (expr.id ()==ID_code)
155
155
{
156
- err_location ( expr);
156
+ error (). source_location = expr. source_location ( );
157
157
error () << " typecheck_expr_main got code: " << expr.pretty () << eom;
158
158
throw 0 ;
159
159
}
@@ -259,7 +259,7 @@ void jsil_typecheckt::typecheck_expr_main(exprt &expr)
259
259
typecheck_expr_side_effect_throw (to_side_effect_expr_throw (expr));
260
260
else
261
261
{
262
- err_location ( expr);
262
+ error (). source_location = expr. source_location ( );
263
263
error () << " unexpected expression: " << expr.pretty () << eom;
264
264
throw 0 ;
265
265
}
@@ -289,7 +289,7 @@ void jsil_typecheckt::typecheck_expr_proto_field(exprt &expr)
289
289
{
290
290
if (expr.operands ().size ()!=2 )
291
291
{
292
- err_location ( expr);
292
+ error (). source_location = expr. source_location ( );
293
293
error () << " operator `" << expr.id ()
294
294
<< " ' expects two operands" << eom;
295
295
throw 0 ;
@@ -305,7 +305,7 @@ void jsil_typecheckt::typecheck_expr_proto_obj(exprt &expr)
305
305
{
306
306
if (expr.operands ().size ()!=2 )
307
307
{
308
- err_location ( expr);
308
+ error (). source_location = expr. source_location ( );
309
309
error () << " operator `" << expr.id ()
310
310
<< " ' expects two operands" ;
311
311
throw 0 ;
@@ -321,7 +321,7 @@ void jsil_typecheckt::typecheck_expr_delete(exprt &expr)
321
321
{
322
322
if (expr.operands ().size ()!=2 )
323
323
{
324
- err_location ( expr);
324
+ error (). source_location = expr. source_location ( );
325
325
error () << " operator `" << expr.id ()
326
326
<< " ' expects two operands" << eom;
327
327
throw 0 ;
@@ -337,7 +337,7 @@ void jsil_typecheckt::typecheck_expr_index(exprt &expr)
337
337
{
338
338
if (expr.operands ().size ()!=2 )
339
339
{
340
- err_location ( expr);
340
+ error (). source_location = expr. source_location ( );
341
341
error () << " operator `" << expr.id ()
342
342
<< " ' expects two operands" << eom;
343
343
throw 0 ;
@@ -357,7 +357,7 @@ void jsil_typecheckt::typecheck_expr_has_field(exprt &expr)
357
357
{
358
358
if (expr.operands ().size ()!=2 )
359
359
{
360
- err_location ( expr);
360
+ error (). source_location = expr. source_location ( );
361
361
error () << " operator `" << expr.id ()
362
362
<< " ' expects two operands" << eom;
363
363
throw 0 ;
@@ -373,7 +373,7 @@ void jsil_typecheckt::typecheck_expr_field(exprt &expr)
373
373
{
374
374
if (expr.operands ().size ()!=1 )
375
375
{
376
- err_location ( expr);
376
+ error (). source_location = expr. source_location ( );
377
377
error () << " operator `" << expr.id ()
378
378
<< " ' expects single operand" << eom;
379
379
throw 0 ;
@@ -388,7 +388,7 @@ void jsil_typecheckt::typecheck_expr_base(exprt &expr)
388
388
{
389
389
if (expr.operands ().size ()!=1 )
390
390
{
391
- err_location ( expr);
391
+ error (). source_location = expr. source_location ( );
392
392
error () << " operator `" << expr.id ()
393
393
<< " ' expects single operand" << eom;
394
394
throw 0 ;
@@ -403,7 +403,7 @@ void jsil_typecheckt::typecheck_expr_ref(exprt &expr)
403
403
{
404
404
if (expr.operands ().size ()!=3 )
405
405
{
406
- err_location ( expr);
406
+ error (). source_location = expr. source_location ( );
407
407
error () << " operator `" << expr.id ()
408
408
<< " ' expects three operands" << eom;
409
409
throw 0 ;
@@ -421,7 +421,7 @@ void jsil_typecheckt::typecheck_expr_ref(exprt &expr)
421
421
expr.type ()=jsil_variable_reference_type ();
422
422
else
423
423
{
424
- err_location ( expr);
424
+ error (). source_location = expr. source_location ( );
425
425
error () << " operator `" << expr.id ()
426
426
<< " ' expects reference type in the third parameter. Got:"
427
427
<< operand3.pretty () << eom;
@@ -433,7 +433,7 @@ void jsil_typecheckt::typecheck_expr_concatenation(exprt &expr)
433
433
{
434
434
if (expr.operands ().size ()!=2 )
435
435
{
436
- err_location ( expr);
436
+ error (). source_location = expr. source_location ( );
437
437
error () << " operator `" << expr.id ()
438
438
<< " ' expects two operands" << eom;
439
439
throw 0 ;
@@ -449,7 +449,7 @@ void jsil_typecheckt::typecheck_expr_subtype(exprt &expr)
449
449
{
450
450
if (expr.operands ().size ()!=2 )
451
451
{
452
- err_location ( expr);
452
+ error (). source_location = expr. source_location ( );
453
453
error () << " operator `" << expr.id ()
454
454
<< " ' expects two operands" << eom;
455
455
throw 0 ;
@@ -465,7 +465,7 @@ void jsil_typecheckt::typecheck_expr_binary_boolean(exprt &expr)
465
465
{
466
466
if (expr.operands ().size ()!=2 )
467
467
{
468
- err_location ( expr);
468
+ error (). source_location = expr. source_location ( );
469
469
error () << " operator `" << expr.id ()
470
470
<< " ' expects two operands" << eom;
471
471
throw 0 ;
@@ -481,7 +481,7 @@ void jsil_typecheckt::typecheck_expr_binary_arith(exprt &expr)
481
481
{
482
482
if (expr.operands ().size ()!=2 )
483
483
{
484
- err_location ( expr);
484
+ error (). source_location = expr. source_location ( );
485
485
error () << " operator `" << expr.id ()
486
486
<< " ' expects two operands" << eom;
487
487
throw 0 ;
@@ -498,7 +498,7 @@ void jsil_typecheckt::typecheck_exp_binary_equal(exprt &expr)
498
498
{
499
499
if (expr.operands ().size ()!=2 )
500
500
{
501
- err_location ( expr);
501
+ error (). source_location = expr. source_location ( );
502
502
error () << " operator `" << expr.id ()
503
503
<< " ' expects two operands" << eom;
504
504
throw 0 ;
@@ -513,7 +513,7 @@ void jsil_typecheckt::typecheck_expr_binary_compare(exprt &expr)
513
513
{
514
514
if (expr.operands ().size ()!=2 )
515
515
{
516
- err_location ( expr);
516
+ error (). source_location = expr. source_location ( );
517
517
error () << " operator `" << expr.id ()
518
518
<< " ' expects two operands" << eom;
519
519
throw 0 ;
@@ -529,7 +529,7 @@ void jsil_typecheckt::typecheck_expr_unary_boolean(exprt &expr)
529
529
{
530
530
if (expr.operands ().size ()!=1 )
531
531
{
532
- err_location ( expr);
532
+ error (). source_location = expr. source_location ( );
533
533
error () << " operator `" << expr.id ()
534
534
<< " ' expects one operand" << eom;
535
535
throw 0 ;
@@ -544,7 +544,7 @@ void jsil_typecheckt::typecheck_expr_unary_string(exprt &expr)
544
544
{
545
545
if (expr.operands ().size ()!=1 )
546
546
{
547
- err_location ( expr);
547
+ error (). source_location = expr. source_location ( );
548
548
error () << " operator `" << expr.id ()
549
549
<< " ' expects one operand" << eom;
550
550
throw 0 ;
@@ -559,7 +559,7 @@ void jsil_typecheckt::typecheck_expr_unary_num(exprt &expr)
559
559
{
560
560
if (expr.operands ().size ()!=1 )
561
561
{
562
- err_location ( expr);
562
+ error (). source_location = expr. source_location ( );
563
563
error () << " operator `" << expr.id ()
564
564
<< " ' expects one operand" << eom;
565
565
throw 0 ;
@@ -658,7 +658,7 @@ void jsil_typecheckt::typecheck_code(codet &code)
658
658
{
659
659
if (code.operands ().size ()!=1 )
660
660
{
661
- err_location ( code);
661
+ error (). source_location = code. source_location ( );
662
662
error () << " expression statement expected to have one operand"
663
663
<< eom;
664
664
throw 0 ;
@@ -688,7 +688,7 @@ void jsil_typecheckt::typecheck_code(codet &code)
688
688
}
689
689
else
690
690
{
691
- err_location ( code);
691
+ error (). source_location = code. source_location ( );
692
692
error () << " unexpected statement: " << statement << eom;
693
693
throw 0 ;
694
694
}
@@ -711,7 +711,7 @@ void jsil_typecheckt::typecheck_try_catch(code_try_catcht &code)
711
711
// A special case of try catch with one catch clause
712
712
if (code.operands ().size ()!=3 )
713
713
{
714
- err_location ( code);
714
+ error (). source_location = code. source_location ( );
715
715
error () << " try_catch expected to have three operands" << eom;
716
716
throw 0 ;
717
717
}
@@ -729,7 +729,7 @@ void jsil_typecheckt::typecheck_function_call(
729
729
{
730
730
if (call.operands ().size ()!=3 )
731
731
{
732
- err_location ( call);
732
+ error (). source_location = call. source_location ( );
733
733
error () << " function call expected to have three operands" << eom;
734
734
throw 0 ;
735
735
}
0 commit comments