Skip to content

Commit 6642254

Browse files
author
Remi Delmas
committed
Adding a diagram to the doc of goto_programt::insert_before_swap to illustrate "preserves jumps to target".
1 parent 956e2ba commit 6642254

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

src/goto-programs/goto_program.h

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -625,6 +625,22 @@ class goto_programt
625625

626626
/// Insertion that preserves jumps to "target".
627627
/// The instruction is destroyed.
628+
///
629+
/// Turns:
630+
/// ```
631+
/// ...->[a]->...
632+
/// ^
633+
/// target
634+
/// ```
635+
///
636+
/// Into:
637+
/// ```
638+
/// ...->[i]->[a]->...
639+
/// ^
640+
/// target
641+
/// ```
642+
///
643+
/// So that jumps to `a` now jump to the newly inserted `i`.
628644
void insert_before_swap(targett target, instructiont &instruction)
629645
{
630646
insert_before_swap(target);

0 commit comments

Comments
 (0)