@@ -54,7 +54,7 @@ impl<'tcx> GotocCtx<'tcx> {
54
54
. dereference ( )
55
55
. ge ( Expr :: int_constant ( below, Type :: signed_int ( 32 ) ) )
56
56
. and ( ptr. dereference ( ) . le ( Expr :: int_constant ( above, Type :: signed_int ( 32 ) ) ) )
57
- . ret ( ) ;
57
+ . ret ( Location :: none ( ) ) ;
58
58
body. push ( exp)
59
59
} )
60
60
} ) ;
@@ -69,7 +69,7 @@ impl<'tcx> GotocCtx<'tcx> {
69
69
. dereference ( )
70
70
. eq ( Expr :: c_true ( ) )
71
71
. or ( ptr. dereference ( ) . eq ( Expr :: c_false ( ) ) )
72
- . ret ( ) ;
72
+ . ret ( Location :: none ( ) ) ;
73
73
body. push ( exp)
74
74
} )
75
75
} ) ;
@@ -221,22 +221,29 @@ impl<'tcx> GotocCtx<'tcx> {
221
221
//CHECKME: why is this 2?
222
222
let idx = tcx. gen_function_local_variable ( 2 , & fname, Type :: size_t ( ) ) . to_expr ( ) ;
223
223
body. push ( Stmt :: decl ( idx. clone ( ) , Some ( Type :: size_t ( ) . zero ( ) ) , Location :: none ( ) ) ) ;
224
- let lbody = Stmt :: block ( vec ! [
225
- data. clone( )
226
- . neq( data. typ( ) . null( ) )
227
- . implies( f. call( vec![ data. plus( idx. clone( ) ) ] ) )
228
- . not( )
229
- . if_then_else( Expr :: bool_false( ) . ret( ) , None , Location :: none( ) ) ,
230
- ] ) ;
224
+ let lbody = Stmt :: block (
225
+ vec ! [
226
+ data. clone( )
227
+ . neq( data. typ( ) . null( ) )
228
+ . implies( f. call( vec![ data. plus( idx. clone( ) ) ] ) )
229
+ . not( )
230
+ . if_then_else(
231
+ Expr :: bool_false( ) . ret( Location :: none( ) ) ,
232
+ None ,
233
+ Location :: none( ) ,
234
+ ) ,
235
+ ] ,
236
+ Location :: none ( ) ,
237
+ ) ;
231
238
body. push ( Stmt :: for_loop (
232
239
Stmt :: skip ( Location :: none ( ) ) ,
233
240
idx. clone ( ) . lt ( len) ,
234
- idx. postincr ( ) . as_stmt ( ) ,
241
+ idx. postincr ( ) . as_stmt ( Location :: none ( ) ) ,
235
242
lbody,
236
243
Location :: none ( ) ,
237
244
) ) ;
238
245
}
239
- body. push ( fold_invariants ( invariants) . ret ( ) ) ;
246
+ body. push ( fold_invariants ( invariants) . ret ( Location :: none ( ) ) ) ;
240
247
} )
241
248
}
242
249
@@ -260,7 +267,7 @@ impl<'tcx> GotocCtx<'tcx> {
260
267
if let Some ( f) = f {
261
268
invarints. push ( x. clone ( ) . neq ( x. typ ( ) . null ( ) ) . implies ( f. call ( vec ! [ x] ) ) ) ;
262
269
}
263
- body. push ( fold_invariants ( invarints) . ret ( ) ) ;
270
+ body. push ( fold_invariants ( invarints) . ret ( Location :: none ( ) ) ) ;
264
271
} )
265
272
}
266
273
@@ -296,7 +303,7 @@ impl<'tcx> GotocCtx<'tcx> {
296
303
) -> Symbol {
297
304
self . codegen_assumption_genfunc ( fname, t, |tcx, ptr, body| {
298
305
let invariants = tcx. codegen_assumption_struct_invariant ( ptr, variant, subst) ;
299
- body. push ( fold_invariants ( invariants) . ret ( ) ) ;
306
+ body. push ( fold_invariants ( invariants) . ret ( Location :: none ( ) ) ) ;
300
307
} )
301
308
}
302
309
@@ -336,7 +343,7 @@ impl<'tcx> GotocCtx<'tcx> {
336
343
) -> Symbol {
337
344
self . codegen_assumption_genfunc ( fname, t, |tcx, ptr, body| {
338
345
let invariants = tcx. codegen_assumption_struct_invariant ( ptr, variant, subst) ;
339
- body. push ( fold_invariants ( invariants) . ret ( ) ) ;
346
+ body. push ( fold_invariants ( invariants) . ret ( Location :: none ( ) ) ) ;
340
347
} )
341
348
}
342
349
@@ -382,7 +389,7 @@ impl<'tcx> GotocCtx<'tcx> {
382
389
383
390
let data_invar = tcx. codegen_assumption_struct_invariant ( ptr, variant, subst) ;
384
391
invariants. push ( fold_invariants ( data_invar) ) ;
385
- body. push ( fold_invariants_or ( invariants) . ret ( ) ) ;
392
+ body. push ( fold_invariants_or ( invariants) . ret ( Location :: none ( ) ) ) ;
386
393
} )
387
394
}
388
395
@@ -486,7 +493,7 @@ impl<'tcx> GotocCtx<'tcx> {
486
493
}
487
494
}
488
495
489
- body. push ( fold_invariants ( invariants) . ret ( ) ) ;
496
+ body. push ( fold_invariants ( invariants) . ret ( Location :: none ( ) ) ) ;
490
497
} )
491
498
}
492
499
@@ -510,25 +517,29 @@ impl<'tcx> GotocCtx<'tcx> {
510
517
let idx = tcx. gen_function_local_variable ( 2 , & fname, Type :: size_t ( ) ) ;
511
518
body. push ( Stmt :: decl ( idx. to_expr ( ) , Some ( Type :: size_t ( ) . zero ( ) ) , Location :: none ( ) ) ) ;
512
519
let idxe = idx. to_expr ( ) ;
513
- let lbody = Stmt :: block ( vec ! [
514
- f. call( vec![
515
- tcx. codegen_idx_array( ptr. clone( ) . dereference( ) , idxe. clone( ) ) . address_of( ) ,
516
- ] )
517
- . not( )
518
- . if_then_else(
519
- Expr :: bool_false( ) . ret( ) ,
520
- None ,
521
- Location :: none( ) ,
522
- ) ,
523
- ] ) ;
520
+ let lbody = Stmt :: block (
521
+ vec ! [
522
+ f. call( vec![
523
+ tcx. codegen_idx_array( ptr. clone( ) . dereference( ) , idxe. clone( ) )
524
+ . address_of( ) ,
525
+ ] )
526
+ . not( )
527
+ . if_then_else(
528
+ Expr :: bool_false( ) . ret( Location :: none( ) ) ,
529
+ None ,
530
+ Location :: none( ) ,
531
+ ) ,
532
+ ] ,
533
+ Location :: none ( ) ,
534
+ ) ;
524
535
body. push ( Stmt :: for_loop (
525
536
Stmt :: skip ( Location :: none ( ) ) ,
526
537
idxe. clone ( ) . lt ( tcx. codegen_const ( c, None ) ) ,
527
- idxe. postincr ( ) . as_stmt ( ) ,
538
+ idxe. postincr ( ) . as_stmt ( Location :: none ( ) ) ,
528
539
lbody,
529
540
Location :: none ( ) ,
530
541
) ) ;
531
- body. push ( Expr :: bool_true ( ) . ret ( ) ) ;
542
+ body. push ( Expr :: bool_true ( ) . ret ( Location :: none ( ) ) ) ;
532
543
}
533
544
} )
534
545
}
@@ -553,7 +564,7 @@ impl<'tcx> GotocCtx<'tcx> {
553
564
invariants. push ( f. call ( vec ! [ field] ) ) ;
554
565
}
555
566
}
556
- body. push ( fold_invariants ( invariants) . ret ( ) ) ;
567
+ body. push ( fold_invariants ( invariants) . ret ( Location :: none ( ) ) ) ;
557
568
} )
558
569
}
559
570
@@ -570,7 +581,7 @@ impl<'tcx> GotocCtx<'tcx> {
570
581
let mut stmts = vec ! [ ] ;
571
582
//let mut body = Stmt::block(vec![]);
572
583
f ( self , ptr, & mut stmts) ;
573
- let body = Stmt :: block ( stmts) ;
584
+ let body = Stmt :: block ( stmts, Location :: none ( ) ) ;
574
585
Symbol :: function (
575
586
fname,
576
587
Type :: code ( vec ! [ var. to_function_parameter( ) ] , Type :: bool ( ) ) ,
0 commit comments