Skip to content
Snippets Groups Projects
Commit 211dc770 authored by Loïc Correnson's avatar Loïc Correnson Committed by Loïc Correnson
Browse files

[region] statement annotations

parent d4af1830
No related branches found
No related tags found
No related merge requests found
...@@ -222,15 +222,15 @@ let rec parse_named_lpath (env:env) p = ...@@ -222,15 +222,15 @@ let rec parse_named_lpath (env:env) p =
let kspec = ref 0 let kspec = ref 0
let registry = Hashtbl.create 0 let registry = Hashtbl.create 0
let of_extid = Hashtbl.find registry let of_extid id = try Hashtbl.find registry id with Not_found -> []
let of_extrev = function let of_extension = function
| { ext_name="region" ; ext_kind = Ext_id k } -> of_extid k | { ext_name="region" ; ext_kind = Ext_id k } -> of_extid k
| _ -> raise Not_found | _ -> []
let of_extension e = List.rev (of_extrev e) let of_code_annot = function
let of_behavior bhv = | { annot_content = AExtended(_,_,e) } -> of_extension e
List.fold_left | _ -> []
(fun acc e -> List.rev_append (try of_extrev e with Not_found -> []) acc)
[] bhv.Cil_types.b_extended let of_behavior bhv = List.concat_map of_extension bhv.b_extended
let typecheck typing_context _loc ps = let typecheck typing_context _loc ps =
let env = { let env = {
...@@ -251,7 +251,12 @@ let printer _pp fmt = function ...@@ -251,7 +251,12 @@ let printer _pp fmt = function
| _ -> () | _ -> ()
let () = let () =
Acsl_extension.register_behavior begin
~plugin:"region" "alias" typecheck ~printer false Acsl_extension.register_behavior
~plugin:"region" "region" typecheck ~printer false ;
Acsl_extension.register_code_annot
~plugin:"region" "region" typecheck ~printer false ;
end
(* -------------------------------------------------------------------------- *) (* -------------------------------------------------------------------------- *)
...@@ -50,4 +50,5 @@ val pp_region : Format.formatter -> region -> unit ...@@ -50,4 +50,5 @@ val pp_region : Format.formatter -> region -> unit
val pp_regions : Format.formatter -> region list -> unit val pp_regions : Format.formatter -> region list -> unit
val of_extension : acsl_extension -> region list val of_extension : acsl_extension -> region list
val of_code_annot : code_annotation -> region list
val of_behavior : behavior -> region list val of_behavior : behavior -> region list
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment