diff --git a/infer/src/IR/Cfg.ml b/infer/src/IR/Cfg.ml index 950a8f8c3..cd807dd24 100644 --- a/infer/src/IR/Cfg.ml +++ b/infer/src/IR/Cfg.ml @@ -75,7 +75,8 @@ let save_attributes source_file cfg = let loc' = if Location.equal loc Location.dummy then {loc with file= source_file} else loc in {attributes with loc= loc'; translation_unit= source_file} in - Attributes.store attributes' + Attributes.store attributes' ; + Procdesc.set_attributes pdesc attributes' in Typ.Procname.Hash.iter save_proc cfg diff --git a/infer/src/IR/Procdesc.ml b/infer/src/IR/Procdesc.ml index 36e2c99ff..8b1c96dc4 100644 --- a/infer/src/IR/Procdesc.ml +++ b/infer/src/IR/Procdesc.ml @@ -393,7 +393,7 @@ module IdMap = Node.IdMap (** procedure description *) type t = - { attributes: ProcAttributes.t (** attributes of the procedure *) + { mutable attributes: ProcAttributes.t (** attributes of the procedure *) ; mutable nodes: Node.t list (** list of nodes of this procedure *) ; mutable nodes_num: int (** number of nodes *) ; mutable start_node: Node.t (** start node of this procedure *) @@ -433,6 +433,8 @@ let signal_did_preanalysis pdesc = (pdesc.attributes).did_preanalysis <- true let get_attributes pdesc = pdesc.attributes +let set_attributes pdesc attributes = pdesc.attributes <- attributes + let get_exit_node pdesc = pdesc.exit_node (** Return name and type of formal parameters *) diff --git a/infer/src/IR/Procdesc.mli b/infer/src/IR/Procdesc.mli index 623c0e3cb..24ba67545 100644 --- a/infer/src/IR/Procdesc.mli +++ b/infer/src/IR/Procdesc.mli @@ -202,6 +202,8 @@ val get_access : t -> PredSymb.access val get_attributes : t -> ProcAttributes.t (** Get the attributes of the procedure. *) +val set_attributes : t -> ProcAttributes.t -> unit + val get_captured : t -> (Mangled.t * Typ.t) list (** Return name and type of block's captured variables *)