Goblint_lib.DeadCode
Dead code elimination transformation (remove_dead_code
).
val filter_map_block :
?unchecked_condition:(unit -> GoblintCil.exp) ->
(GoblintCil.stmt -> bool) ->
GoblintCil.block ->
bool
Filter statements out of a block (recursively). CFG fields (prev/next, Loop continue/break) are no longer valid after calling. Returns true if anything is left in block, false if the block is now empty. Invariants:
Is it possible for this statement to begin executing normally, but not finish?
val find_live_statements :
(MyCFG.node -> bool) ->
(MyCFG.node -> MyCFG.edges -> MyCFG.node -> GoblintCil.stmt list) ->
MyCFG.cfg ->
MyCFG.node ->
BatSet.Int.t
Perform a depth first search over the CFG. Record the IDs of live statements; for each traversed edge, record the skipped statements along the edge as live, if the nodes on both ends of the edge are live. Record live statements in the nodes themselves as well.
module RemoveDeadCode : Transform.S