[Uninit][2/13] Move summary type

Reviewed By: jeremydubreil

Differential Revision: D10250040

fbshipit-source-id: 12e02cb32
master
Mehdi Bouaziz 6 years ago committed by Facebook Github Bot
parent 8cac7df447
commit f639906496

@ -19,7 +19,7 @@ type t =
; resources: ResourceLeakDomain.summary option ; resources: ResourceLeakDomain.summary option
; siof: SiofDomain.Summary.astate option ; siof: SiofDomain.Summary.astate option
; typestate: TypeState.t option ; typestate: TypeState.t option
; uninit: UninitDomain.summary option ; uninit: UninitDomain.Summary.t option
; cost: CostDomain.summary option ; cost: CostDomain.summary option
; starvation: StarvationDomain.summary option ; starvation: StarvationDomain.summary option
; purity: PurityDomain.summary option } ; purity: PurityDomain.summary option }
@ -59,7 +59,7 @@ let pp pe fmt
buffer_overrun buffer_overrun
(pp_opt "AnnotationReachability" AnnotReachabilityDomain.pp) (pp_opt "AnnotationReachability" AnnotReachabilityDomain.pp)
annot_map annot_map
(pp_opt "Uninitialised" UninitDomain.pp_summary) (pp_opt "Uninitialised" UninitDomain.Summary.pp)
uninit uninit
(pp_opt "Cost" CostDomain.pp_summary) (pp_opt "Cost" CostDomain.pp_summary)
cost cost

@ -19,7 +19,7 @@ type t =
; resources: ResourceLeakDomain.summary option ; resources: ResourceLeakDomain.summary option
; siof: SiofDomain.Summary.astate option ; siof: SiofDomain.Summary.astate option
; typestate: TypeState.t option ; typestate: TypeState.t option
; uninit: UninitDomain.summary option ; uninit: UninitDomain.Summary.t option
; cost: CostDomain.summary option ; cost: CostDomain.summary option
; starvation: StarvationDomain.summary option ; starvation: StarvationDomain.summary option
; purity: PurityDomain.summary option } ; purity: PurityDomain.summary option }

@ -17,7 +17,7 @@ module AliasedVars = AbstractDomain.FiniteSet (UninitDomain.VarPair)
module RecordDomain = UninitDomain.Record (UninitVars) (AliasedVars) (D) module RecordDomain = UninitDomain.Record (UninitVars) (AliasedVars) (D)
module Payload = SummaryPayload.Make (struct module Payload = SummaryPayload.Make (struct
type t = UninitDomain.summary type t = UninitDomain.Summary.t
let update_payloads sum (payloads : Payloads.t) = {payloads with uninit= Some sum} let update_payloads sum (payloads : Payloads.t) = {payloads with uninit= Some sum}

@ -13,20 +13,12 @@ module Domain = AbstractDomain.InvertedSet (AccessExpression)
type 'a prepost = {pre: 'a; post: 'a} type 'a prepost = {pre: 'a; post: 'a}
(* pre = set of parameters initialized inside the procedure;
post = set of uninit local variables of the procedure *)
type summary = Domain.t prepost
module VarPair = struct module VarPair = struct
type t = Var.t * Var.t [@@deriving compare] type t = Var.t * Var.t [@@deriving compare]
let pp fmt pair = F.fprintf fmt " (%a, %a)" Var.pp (fst pair) Var.pp (snd pair) let pp fmt pair = F.fprintf fmt " (%a, %a)" Var.pp (fst pair) Var.pp (snd pair)
end end
let pp_summary fmt {pre; post} =
F.fprintf fmt "@\n Pre: %a @\nPost: %a @\n" Domain.pp pre Domain.pp post
module Record module Record
(Domain1 : AbstractDomain.S) (Domain1 : AbstractDomain.S)
(Domain2 : AbstractDomain.S) (Domain2 : AbstractDomain.S)
@ -82,3 +74,11 @@ struct
F.fprintf fmt "@\n uninit_vars: %a @\n aliased_vars: %a @\n prepost: (%a, %a)" Domain1.pp uv F.fprintf fmt "@\n uninit_vars: %a @\n aliased_vars: %a @\n prepost: (%a, %a)" Domain1.pp uv
Domain2.pp av Domain3.pp pre Domain3.pp post Domain2.pp av Domain3.pp pre Domain3.pp post
end end
module Summary = struct
(* pre = set of parameters initialized inside the procedure;
post = set of uninit local variables of the procedure *)
type t = Domain.t prepost
let pp fmt {pre; post} = F.fprintf fmt "@\n Pre: %a @\nPost: %a @\n" Domain.pp pre Domain.pp post
end

Loading…
Cancel
Save