let annotate_kf_with kf new_gen_opts new_other_opts =
let do_annotate_kf kf =
match kf.fundec with
| Declaration _ -> ()
| Definition (f,_) ->
remove_annotations_kf kf ;
let vis = new rte_annot_visitor kf
in let _nkf = Visitor.visitFramacFunction vis f in
assert(_nkf == f)
in
let old_gen_opts = StateManager.find_current_gen_options kf
and old_other_opts = StateManager.find_current_other_options kf
in
if
Parameter_map.compare old_gen_opts new_gen_opts <> 0
||
(Parameter_map.is_one_true ~except:None new_gen_opts &&
Parameter_map.compare old_other_opts new_other_opts <> 0)
then begin
debug "Options have changed: something to do for function %s"
(Kernel_function.get_name kf) ;
StateManager.FuncOptionTbl.replace kf (new_gen_opts, new_other_opts) ;
if Parameter_map.is_one_true ~except:None new_gen_opts then begin
feedback "annotating function %s" (Kernel_function.get_name kf) ;
do_annotate_kf kf ;
List.iter
(fun (opt_name, _opt_get, _, property_set) ->
property_set kf (Parameter_map.is_true opt_name new_gen_opts))
Parameter_map.generating_opts
end else begin
feedback "unannotating function %s" (Kernel_function.get_name kf) ;
List.iter
(fun (_opt_name, _opt_get, _, property_set) ->
property_set kf false)
Parameter_map.generating_opts;
remove_annotations_kf kf
end
end