[inferbo] Rename Allocsite.Param to Allocsite.Symbol

Reviewed By: ezgicicek

Differential Revision: D13359966

fbshipit-source-id: b4678eb4b
master
Sungkeun Cho 6 years ago committed by Facebook Github Bot
parent 69af58506d
commit a37d85dddc

@ -13,7 +13,7 @@ module F = Format
module Allocsite = struct
type t =
| Unknown
| Param of Symb.SymbolPath.partial
| Symbol of Symb.SymbolPath.partial
| Known of
{ proc_name: string
; node_hash: int
@ -26,7 +26,7 @@ module Allocsite = struct
match (as1, as2) with
| Unknown, _ | _, Unknown ->
Boolean.Top
| Param _, Param _ ->
| Symbol _, Symbol _ ->
(* parameters may alias *) Boolean.Top
| Known {path= Some p1}, Known {path= Some p2} ->
Boolean.of_bool (Symb.SymbolPath.equal_partial p1 p2)
@ -34,14 +34,14 @@ module Allocsite = struct
Boolean.False
| Known {path= None}, Known {path= None} ->
Boolean.of_bool ([%compare.equal: t] as1 as2)
| Known _, Param _ | Param _, Known _ ->
| Known _, Symbol _ | Symbol _, Known _ ->
Boolean.False
let pp_paren ~paren fmt = function
| Unknown ->
F.fprintf fmt "Unknown"
| Param path ->
| Symbol path ->
Symb.SymbolPath.pp_partial_paren ~paren fmt path
| Known {path= Some path} when Config.bo_debug < 1 ->
Symb.SymbolPath.pp_partial_paren ~paren fmt path
@ -53,7 +53,7 @@ module Allocsite = struct
let pp = pp_paren ~paren:false
let is_pretty = function Param _ | Known {path= Some _} -> true | _ -> false
let is_pretty = function Symbol _ | Known {path= Some _} -> true | _ -> false
let to_string x = F.asprintf "%a" pp x
@ -68,11 +68,11 @@ module Allocsite = struct
Known {proc_name= Typ.Procname.to_string proc_name; node_hash; inst_num; dimension; path}
let make_param path = Param path
let make_symbol path = Symbol path
let unknown = Unknown
let get_path = function Unknown -> None | Param path -> Some path | Known {path} -> path
let get_path = function Unknown -> None | Symbol path -> Some path | Known {path} -> path
end
module Loc = struct
@ -98,7 +98,7 @@ module Loc = struct
else F.pp_print_string fmt s
| Allocsite a ->
Allocsite.pp_paren ~paren fmt a
| Field (Allocsite (Allocsite.Param (SP.Deref (SP.Deref_CPointer, p))), f)
| Field (Allocsite (Allocsite.Symbol (SP.Deref (SP.Deref_CPointer, p))), f)
| Field (Allocsite (Allocsite.Known {path= Some (SP.Deref (SP.Deref_CPointer, p))}), f) ->
F.fprintf fmt "%a->%s" (SP.pp_partial_paren ~paren:true) p (Typ.Fieldname.to_flat_string f)
| Field (l, f) ->

@ -153,7 +153,7 @@ module Exec = struct
)
in
let deref_path = Itv.SymbolPath.deref ~deref_kind path in
let allocsite = Allocsite.make_param deref_path in
let allocsite = Allocsite.make_symbol deref_path in
let mem =
let arr =
let traces = Trace.(Set.singleton location (Parameter loc)) in
@ -180,7 +180,7 @@ module Exec = struct
-> Dom.Mem.t
-> Dom.Mem.t =
fun ~decl_sym_val pname path tenv location ~depth loc typ mem ->
let allocsite = Allocsite.make_param path in
let allocsite = Allocsite.make_symbol path in
let alloc_loc = Loc.of_allocsite allocsite in
let v =
let represents_multiple_values = Itv.SymbolPath.represents_multiple_values path in

Loading…
Cancel
Save