Added dataflow module

This commit is contained in:
elvis
2024-12-12 16:37:36 +01:00
parent 08a8d07422
commit 590123d988
17 changed files with 275 additions and 57 deletions

View File

@ -0,0 +1,20 @@
open Analysis
module Variable = struct
type t = string
let pp (ppf: out_channel) (v: t) : unit =
Printf.fprintf ppf "%s" v
let pplist (ppf: out_channel) (vv: t list) : unit =
List.iter (Printf.fprintf ppf "%s, ") vv
end
module RISCCfg = CfgRISC.RISCCfg
module DVCfg = Dataflow.Make (CfgRISC.RISCSimpleStatements) (Variable)
let compute_defined_variables (cfg: RISCCfg.t) : DVCfg.t =
DVCfg.from_cfg cfg
let compute_cfg (dvcfg : DVCfg.t) : RISCCfg.t =
DVCfg.to_cfg dvcfg