Skip to content

Commit 8f8ae2b

Browse files
author
Daniel Kroening
committed
added instructiont::turn_into_skip()
This is an implementation for the common idiom in which an existing instruction is replaced by a skip while retaining the source_location. It replaces instructiont::make_skip().
1 parent ed6796d commit 8f8ae2b

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/goto-programs/goto_program.h

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -332,6 +332,13 @@ class goto_programt
332332
code.make_nil();
333333
}
334334

335+
/// Transforms an existing instruction into a skip,
336+
/// retaining the source_location
337+
void turn_into_skip()
338+
{
339+
clear(SKIP);
340+
}
341+
335342
void make_return() { clear(RETURN); }
336343
void make_skip() { clear(SKIP); }
337344
void make_location(const source_locationt &l)

0 commit comments

Comments
 (0)