@@ -64,7 +64,7 @@ void jsil_typecheckt::make_type_compatible(
6464{
6565 if (type.id ().empty () || type.is_nil ())
6666 {
67- err_location ( expr);
67+ error (). source_location = expr. source_location ( );
6868 error () << " make_type_compatible got empty type: " << expr.pretty () << eom;
6969 throw 0 ;
7070 }
@@ -80,7 +80,7 @@ void jsil_typecheckt::make_type_compatible(
8080 {
8181 if (jsil_incompatible_types (expr.type (), type))
8282 {
83- err_location ( expr);
83+ error (). source_location = expr. source_location ( );
8484 error () << " failed to typecheck expr "
8585 << expr.pretty () << " with type "
8686 << expr.type ().pretty ()
@@ -153,7 +153,7 @@ void jsil_typecheckt::typecheck_expr_main(exprt &expr)
153153{
154154 if (expr.id ()==ID_code)
155155 {
156- err_location ( expr);
156+ error (). source_location = expr. source_location ( );
157157 error () << " typecheck_expr_main got code: " << expr.pretty () << eom;
158158 throw 0 ;
159159 }
@@ -259,7 +259,7 @@ void jsil_typecheckt::typecheck_expr_main(exprt &expr)
259259 typecheck_expr_side_effect_throw (to_side_effect_expr_throw (expr));
260260 else
261261 {
262- err_location ( expr);
262+ error (). source_location = expr. source_location ( );
263263 error () << " unexpected expression: " << expr.pretty () << eom;
264264 throw 0 ;
265265 }
@@ -289,7 +289,7 @@ void jsil_typecheckt::typecheck_expr_proto_field(exprt &expr)
289289{
290290 if (expr.operands ().size ()!=2 )
291291 {
292- err_location ( expr);
292+ error (). source_location = expr. source_location ( );
293293 error () << " operator `" << expr.id ()
294294 << " ' expects two operands" << eom;
295295 throw 0 ;
@@ -305,7 +305,7 @@ void jsil_typecheckt::typecheck_expr_proto_obj(exprt &expr)
305305{
306306 if (expr.operands ().size ()!=2 )
307307 {
308- err_location ( expr);
308+ error (). source_location = expr. source_location ( );
309309 error () << " operator `" << expr.id ()
310310 << " ' expects two operands" ;
311311 throw 0 ;
@@ -321,7 +321,7 @@ void jsil_typecheckt::typecheck_expr_delete(exprt &expr)
321321{
322322 if (expr.operands ().size ()!=2 )
323323 {
324- err_location ( expr);
324+ error (). source_location = expr. source_location ( );
325325 error () << " operator `" << expr.id ()
326326 << " ' expects two operands" << eom;
327327 throw 0 ;
@@ -337,7 +337,7 @@ void jsil_typecheckt::typecheck_expr_index(exprt &expr)
337337{
338338 if (expr.operands ().size ()!=2 )
339339 {
340- err_location ( expr);
340+ error (). source_location = expr. source_location ( );
341341 error () << " operator `" << expr.id ()
342342 << " ' expects two operands" << eom;
343343 throw 0 ;
@@ -357,7 +357,7 @@ void jsil_typecheckt::typecheck_expr_has_field(exprt &expr)
357357{
358358 if (expr.operands ().size ()!=2 )
359359 {
360- err_location ( expr);
360+ error (). source_location = expr. source_location ( );
361361 error () << " operator `" << expr.id ()
362362 << " ' expects two operands" << eom;
363363 throw 0 ;
@@ -373,7 +373,7 @@ void jsil_typecheckt::typecheck_expr_field(exprt &expr)
373373{
374374 if (expr.operands ().size ()!=1 )
375375 {
376- err_location ( expr);
376+ error (). source_location = expr. source_location ( );
377377 error () << " operator `" << expr.id ()
378378 << " ' expects single operand" << eom;
379379 throw 0 ;
@@ -388,7 +388,7 @@ void jsil_typecheckt::typecheck_expr_base(exprt &expr)
388388{
389389 if (expr.operands ().size ()!=1 )
390390 {
391- err_location ( expr);
391+ error (). source_location = expr. source_location ( );
392392 error () << " operator `" << expr.id ()
393393 << " ' expects single operand" << eom;
394394 throw 0 ;
@@ -403,7 +403,7 @@ void jsil_typecheckt::typecheck_expr_ref(exprt &expr)
403403{
404404 if (expr.operands ().size ()!=3 )
405405 {
406- err_location ( expr);
406+ error (). source_location = expr. source_location ( );
407407 error () << " operator `" << expr.id ()
408408 << " ' expects three operands" << eom;
409409 throw 0 ;
@@ -421,7 +421,7 @@ void jsil_typecheckt::typecheck_expr_ref(exprt &expr)
421421 expr.type ()=jsil_variable_reference_type ();
422422 else
423423 {
424- err_location ( expr);
424+ error (). source_location = expr. source_location ( );
425425 error () << " operator `" << expr.id ()
426426 << " ' expects reference type in the third parameter. Got:"
427427 << operand3.pretty () << eom;
@@ -433,7 +433,7 @@ void jsil_typecheckt::typecheck_expr_concatenation(exprt &expr)
433433{
434434 if (expr.operands ().size ()!=2 )
435435 {
436- err_location ( expr);
436+ error (). source_location = expr. source_location ( );
437437 error () << " operator `" << expr.id ()
438438 << " ' expects two operands" << eom;
439439 throw 0 ;
@@ -449,7 +449,7 @@ void jsil_typecheckt::typecheck_expr_subtype(exprt &expr)
449449{
450450 if (expr.operands ().size ()!=2 )
451451 {
452- err_location ( expr);
452+ error (). source_location = expr. source_location ( );
453453 error () << " operator `" << expr.id ()
454454 << " ' expects two operands" << eom;
455455 throw 0 ;
@@ -465,7 +465,7 @@ void jsil_typecheckt::typecheck_expr_binary_boolean(exprt &expr)
465465{
466466 if (expr.operands ().size ()!=2 )
467467 {
468- err_location ( expr);
468+ error (). source_location = expr. source_location ( );
469469 error () << " operator `" << expr.id ()
470470 << " ' expects two operands" << eom;
471471 throw 0 ;
@@ -481,7 +481,7 @@ void jsil_typecheckt::typecheck_expr_binary_arith(exprt &expr)
481481{
482482 if (expr.operands ().size ()!=2 )
483483 {
484- err_location ( expr);
484+ error (). source_location = expr. source_location ( );
485485 error () << " operator `" << expr.id ()
486486 << " ' expects two operands" << eom;
487487 throw 0 ;
@@ -498,7 +498,7 @@ void jsil_typecheckt::typecheck_exp_binary_equal(exprt &expr)
498498{
499499 if (expr.operands ().size ()!=2 )
500500 {
501- err_location ( expr);
501+ error (). source_location = expr. source_location ( );
502502 error () << " operator `" << expr.id ()
503503 << " ' expects two operands" << eom;
504504 throw 0 ;
@@ -513,7 +513,7 @@ void jsil_typecheckt::typecheck_expr_binary_compare(exprt &expr)
513513{
514514 if (expr.operands ().size ()!=2 )
515515 {
516- err_location ( expr);
516+ error (). source_location = expr. source_location ( );
517517 error () << " operator `" << expr.id ()
518518 << " ' expects two operands" << eom;
519519 throw 0 ;
@@ -529,7 +529,7 @@ void jsil_typecheckt::typecheck_expr_unary_boolean(exprt &expr)
529529{
530530 if (expr.operands ().size ()!=1 )
531531 {
532- err_location ( expr);
532+ error (). source_location = expr. source_location ( );
533533 error () << " operator `" << expr.id ()
534534 << " ' expects one operand" << eom;
535535 throw 0 ;
@@ -544,7 +544,7 @@ void jsil_typecheckt::typecheck_expr_unary_string(exprt &expr)
544544{
545545 if (expr.operands ().size ()!=1 )
546546 {
547- err_location ( expr);
547+ error (). source_location = expr. source_location ( );
548548 error () << " operator `" << expr.id ()
549549 << " ' expects one operand" << eom;
550550 throw 0 ;
@@ -559,7 +559,7 @@ void jsil_typecheckt::typecheck_expr_unary_num(exprt &expr)
559559{
560560 if (expr.operands ().size ()!=1 )
561561 {
562- err_location ( expr);
562+ error (). source_location = expr. source_location ( );
563563 error () << " operator `" << expr.id ()
564564 << " ' expects one operand" << eom;
565565 throw 0 ;
@@ -658,7 +658,7 @@ void jsil_typecheckt::typecheck_code(codet &code)
658658 {
659659 if (code.operands ().size ()!=1 )
660660 {
661- err_location ( code);
661+ error (). source_location = code. source_location ( );
662662 error () << " expression statement expected to have one operand"
663663 << eom;
664664 throw 0 ;
@@ -688,7 +688,7 @@ void jsil_typecheckt::typecheck_code(codet &code)
688688 }
689689 else
690690 {
691- err_location ( code);
691+ error (). source_location = code. source_location ( );
692692 error () << " unexpected statement: " << statement << eom;
693693 throw 0 ;
694694 }
@@ -711,7 +711,7 @@ void jsil_typecheckt::typecheck_try_catch(code_try_catcht &code)
711711 // A special case of try catch with one catch clause
712712 if (code.operands ().size ()!=3 )
713713 {
714- err_location ( code);
714+ error (). source_location = code. source_location ( );
715715 error () << " try_catch expected to have three operands" << eom;
716716 throw 0 ;
717717 }
@@ -729,7 +729,7 @@ void jsil_typecheckt::typecheck_function_call(
729729{
730730 if (call.operands ().size ()!=3 )
731731 {
732- err_location ( call);
732+ error (). source_location = call. source_location ( );
733733 error () << " function call expected to have three operands" << eom;
734734 throw 0 ;
735735 }
0 commit comments