let get_all_annots cfg =
let kf = Cil2cfg.cfg_kf cfg in
Wp_parameters.feedback "get annotations in function '%a'"
Kernel_function.pretty_name kf;
let spec = get_spec kf in
let _ = match spec.spec_variant with None -> ()
| Some v -> Wp_parameters.warning "ignored 'decrease' specification : %a@."
Cil.d_decreases v
in
let _ = match spec.spec_terminates with None -> ()
| Some p -> Wp_parameters.warning
"ignored 'terminates' specification : %a@."
!Ast_printer.d_predicate_named
(Logic_const.pred_of_id_pred p)
in
let rec get_named_bhv_annots lb = match lb with [] -> []
| b::tlb ->
if b.b_name = Macros.name_of_default_behavior
then get_named_bhv_annots tlb
else
let ab = get_bhv_annots (Some b) cfg in
let atlb = get_named_bhv_annots tlb in
ab::atlb
in
let def_bhv_annots = get_bhv_annots None cfg in
let annots_fct = get_named_bhv_annots spec.spec_behavior in
def_bhv_annots::annots_fct