module CtrlDpds:Compute the PDB(A,B) set used in the control dependencies algorithm. Roughly speaking, it givessig
..end
({B} U postdom(B))-postdom(A). It means that if S is in the result, it postdominates B but not A. As B is usually a successor of A, it means that S is reached if the B-branch is chosen, but not necessary for the other branches. Then, S should depend on A. (see the document to know more about the applied algorithm)
Compute some information on the function in order to be able to compute
the control dependencies later on
module IH: Inthash
module S:sig
..end
type
t_info =
| |
ToReturn of |
| |
ToInfinity of |
| |
Init |
module State:sig
..end
module States:sig
..end
typet =
Lexical_successors.t * States.t
module Computer:
val go : States.t -> Cil_types.stmt -> unit
val compute_on_infinite_traces : State.t IH.t -> Cil_types.stmt list -> unit
val compute_infos : Kernel_function.t -> State.t IH.t
val compute : Kernel_function.t ->
Cil_types.stmt Inthash.t * State.t IH.t
val get_postdoms : t_info IH.t ->
without:bool -> Cil_datatype.Stmt.Set.elt -> bool * S.t
val pd_b_but_not_a : t_info IH.t ->
Cil_datatype.Stmt.Set.elt -> Cil_datatype.Stmt.Set.elt -> S.t
({B} U postdom(B))-postdom(A). It means that if S is in the result, it postdominates B but not A. As B is usually a successor of A, it means that S is reached if the B-branch is chosen, but not necessary for the other branches. Then, S should depend on A. (see the document to know more about the applied algorithm)
val get_if_controled_stmts : 'a * t_info IH.t ->
Cil_datatype.Stmt.Set.elt -> Cil_datatype.Stmt.Set.elt list
= U (PDB (if, succs(if))(see the document to know more about the applied algorithm).
val get_jump_controled_stmts : Cil_datatype.Stmt.Set.elt Inthash.t * t_info IH.t ->
Cil_datatype.Stmt.Set.elt -> Cil_datatype.Stmt.Set.elt list
PDB(jump,lex_suc) U (PDB(lex_suc,label) - lex_suc)(see the document to know more about the applied algorithm).
Compute the list of the statements that should have a control dependency
on the given jump statement. This statement can be a goto
of course,
but also a break
, a continue
, or even a loop because CIL transformations
make them of the form
while(true) body;which is equivalent to
L : body ; goto L;
val display : Format.formatter -> t_info IH.t -> unit