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