Added dataflow module
This commit is contained in:
20
lib/miniImp/definedVariables.ml
Normal file
20
lib/miniImp/definedVariables.ml
Normal 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
|
||||
Reference in New Issue
Block a user