let compute_pragmas () =
Ast.compute ();
let pragmas = ref [] in
let visitor = object
inherit Visitor.generic_frama_c_visitor
(Project.current ()) (inplace_visit ())
method vstmt_aux s =
pragmas :=
List.map
(fun a -> s, a)
(Annotations.get_filter Logic_utils.is_impact_pragma s)
@ !pragmas;
DoChildren
end in
Pragma.iter
(fun s ->
try
match (Globals.Functions.find_def_by_name s).fundec with
| Definition(f, _) -> ignore (visitFramacFunction visitor f)
| Declaration _ -> assert false
with Not_found ->
abort "function %s not found." s);
let res = on_pragma (fun acc s -> compute_one_stmt s @ acc) [] !pragmas in
if Options.Slicing.get () then ignore (slice res)