package goblint-cil

  1. Overview
  2. Docs
Legend:
Page
Library
Module
Module type
Parameter
Class
Class type
Source

Module GoblintCil.DominatorsSource

Compute dominators using data flow analysis

Author: George Necula 5/28/2004 *

Sourceval computeIDom : ?doCFG:bool -> Cil.fundec -> Cil.stmt option Inthash.t

Invoke on a code after filling in the CFG info and it computes the immediate dominator information. We map each statement to its immediate dominator (None for the start statement, and for the unreachable statements).

Sourcetype tree
Sourceval computeDomTree : ?doCFG:bool -> Cil.fundec -> Cil.stmt option Inthash.t * tree

returns the IDoms and a map from statement ids to the set of statements that are dominated

Sourceval getIdom : Cil.stmt option Inthash.t -> Cil.stmt -> Cil.stmt option

This is like Inthash.find but gives an error if the information is Not_found

Sourceval dominates : Cil.stmt option Inthash.t -> Cil.stmt -> Cil.stmt -> bool

Check whether one statement dominates another.

Sourceval children : tree -> Cil.stmt -> Cil.stmt list

Return a list of statements dominated by the argument

Sourcetype order =
  1. | PreOrder
  2. | PostOrder
Sourceval domTreeIter : (Cil.stmt -> unit) -> order -> tree -> unit

Iterate over a dominator tree

Sourceval findNaturalLoops : Cil.fundec -> Cil.stmt option Inthash.t -> (Cil.stmt * Cil.stmt list) list

Compute the start of the natural loops. This assumes that the "idom" field has been computed. For each start, keep a list of origin of a back edge. The loop consists of the loop start and all predecessors of the origins of back edges, up to and including the loop start

OCaml

Innovation. Community. Security.