@@ -274,10 +274,27 @@ class goto_symext
274
274
// / \param expr: The expression to clean up
275
275
// / \param state
276
276
// / \param write
277
+ // / \return owning object for any let-bound variables created as part of
278
+ // / cleaning this expression, and which will be killed when the object is
279
+ // / allowed to die. The caller should store it or move or return it to an
280
+ // / appropriate scope such that it dies only when no new references to a
281
+ // / let-bound variable could be created (usually, when the enclosing
282
+ // / instruction is done executing)
277
283
symex_live_let_variablest clean_expr (exprt &expr, statet &state, bool write);
278
284
279
285
void trigger_auto_object (const exprt &, statet &);
280
286
void initialize_auto_object (const exprt &, statet &);
287
+
288
+ // / Given an expression, find the root object and the offset into it.
289
+ // /
290
+ // / The extra complication to be considered here is that the expression may
291
+ // / have any number of ternary expressions mixed with type casts.
292
+ // / \return owning object for any let-bound variables created as part of
293
+ // / cleaning this expression, and which will be killed when the object is
294
+ // / allowed to die. The caller should store it or move or return it to an
295
+ // / appropriate scope such that it dies only when no new references to a
296
+ // / let-bound variable could be created (usually, when the enclosing
297
+ // / instruction is done executing)
281
298
symex_live_let_variablest process_array_expr (statet &, exprt &);
282
299
exprt make_auto_object (const typet &, statet &);
283
300
virtual void dereference (exprt &, statet &, bool write);
@@ -497,7 +514,21 @@ class goto_symext
497
514
498
515
typedef symex_targett::assignment_typet assignment_typet;
499
516
500
- symex_live_let_variablest lift_lets (statet &, exprt &);
517
+ // / Execute any let expressions in \p expr using \ref symex_assign_symbol.
518
+ // / The assignments will be made in bottom-up topological but otherwise
519
+ // / arbitrary order (i.e. in `(let x = let y = 0 in x + y) + (let z = 0 in z)
520
+ // / we will define `y` before `x`, but `z` and `x` could come in either order)
521
+ // / \return owning object for any let-bound variables created, and which will
522
+ // / be killed when the object is allowed to die. The caller should store it
523
+ // / or move or return it to an appropriate scope such that it dies only when
524
+ // / no new references to a let-bound variable could be created (usually,
525
+ // / when the enclosing instruction is done executing)
526
+ symex_live_let_variablest lift_lets (statet &, exprt &expr);
527
+
528
+ // / Execute a single let expression, which should not have any nested let
529
+ // / expressions (use \ref lift_lets instead if there might be).
530
+ // / The caller is responsible for killing the newly-defined variable when
531
+ // / appropriate.
501
532
void lift_let (statet &state, const let_exprt &let_expr);
502
533
503
534
void symex_assign_rec (
0 commit comments