Skip to content
Snippets Groups Projects
Commit 1ac83f69 authored by David Bühler's avatar David Bühler
Browse files

Merge branch 'feature/eva/better-annotation-api' into 'master'

[Eva] Improve the annotation API

See merge request frama-c/frama-c!3544
parents 3188afb9 9a2aada8
No related branches found
No related tags found
No related merge requests found
...@@ -70,9 +70,8 @@ let add_slevel_annotation vi kind = ...@@ -70,9 +70,8 @@ let add_slevel_annotation vi kind =
| Aorai_visitors.Aux_funcs.(Pre _ | Post _) -> | Aorai_visitors.Aux_funcs.(Pre _ | Post _) ->
let kf = Globals.Functions.get vi in let kf = Globals.Functions.get vi in
let stmt = Kernel_function.find_first_stmt kf let stmt = Kernel_function.find_first_stmt kf
and loc = Kernel_function.get_location kf
and emitter = Aorai_option.emitter in and emitter = Aorai_option.emitter in
Eva.Eva_annotations.(add_slevel_annot ~emitter ~loc stmt SlevelFull) Eva.Eva_annotations.(add_slevel_annot ~emitter stmt SlevelFull)
| _ -> () | _ -> ()
let add_slevel_annotations () = let add_slevel_annotations () =
......
...@@ -99,13 +99,18 @@ module Eva_annotations: sig ...@@ -99,13 +99,18 @@ module Eva_annotations: sig
| FlowMerge of split_term | FlowMerge of split_term
(** Merge states separated by a previous split. *) (** Merge states separated by a previous split. *)
val add_slevel_annot : emitter:Emitter.t -> loc:Cil_types.location -> val get_slevel_annot : Cil_types.stmt -> slevel_annotation option
val get_unroll_annot : Cil_types.stmt -> unroll_annotation list
val get_flow_annot : Cil_types.stmt -> flow_annotation list
val get_subdivision_annot : Cil_types.stmt -> int list
val add_slevel_annot : emitter:Emitter.t ->
Cil_types.stmt -> slevel_annotation -> unit Cil_types.stmt -> slevel_annotation -> unit
val add_unroll_annot : emitter:Emitter.t -> loc:Cil_types.location -> val add_unroll_annot : emitter:Emitter.t ->
Cil_types.stmt -> unroll_annotation -> unit Cil_types.stmt -> unroll_annotation -> unit
val add_flow_annot : emitter:Emitter.t -> loc:Cil_types.location -> val add_flow_annot : emitter:Emitter.t ->
Cil_types.stmt -> flow_annotation -> unit Cil_types.stmt -> flow_annotation -> unit
val add_subdivision_annot : emitter:Emitter.t -> loc:Cil_types.location -> val add_subdivision_annot : emitter:Emitter.t ->
Cil_types.stmt -> int -> unit Cil_types.stmt -> int -> unit
end end
......
...@@ -102,7 +102,8 @@ struct ...@@ -102,7 +102,8 @@ struct
in in
List.rev (Annotations.fold_code_annot filter_add stmt []) List.rev (Annotations.fold_code_annot filter_add stmt [])
let add ~emitter ~loc stmt annot = let add ~emitter stmt annot =
let loc = Cil_datatype.Stmt.loc stmt in
let param = M.export annot in let param = M.export annot in
let extension = Logic_const.new_acsl_extension name loc false param in let extension = Logic_const.new_acsl_extension name loc false param in
let annot_node = Cil_types.AExtended ([], is_loop_annot, extension) in let annot_node = Cil_types.AExtended ([], is_loop_annot, extension) in
...@@ -261,14 +262,14 @@ let add_slevel_annot = Slevel.add ...@@ -261,14 +262,14 @@ let add_slevel_annot = Slevel.add
let add_unroll_annot = Unroll.add let add_unroll_annot = Unroll.add
let add_flow_annot ~emitter ~loc stmt flow_annotation = let add_flow_annot ~emitter stmt flow_annotation =
let f, annot = let f, annot =
match flow_annotation with match flow_annotation with
| FlowSplit (annot, Static) -> Split.add, annot | FlowSplit (annot, Static) -> Split.add, annot
| FlowSplit (annot, Dynamic) -> DynamicSplit.add, annot | FlowSplit (annot, Dynamic) -> DynamicSplit.add, annot
| FlowMerge annot -> Merge.add, annot | FlowMerge annot -> Merge.add, annot
in in
f ~emitter ~loc stmt (annot, None) f ~emitter stmt (annot, None)
module Subdivision = Register (struct module Subdivision = Register (struct
......
...@@ -56,11 +56,11 @@ val get_flow_annot : Cil_types.stmt -> flow_annotation list ...@@ -56,11 +56,11 @@ val get_flow_annot : Cil_types.stmt -> flow_annotation list
val get_subdivision_annot : Cil_types.stmt -> int list val get_subdivision_annot : Cil_types.stmt -> int list
val get_allocation: Cil_types.stmt -> allocation_kind val get_allocation: Cil_types.stmt -> allocation_kind
val add_slevel_annot : emitter:Emitter.t -> loc:Cil_types.location -> val add_slevel_annot : emitter:Emitter.t ->
Cil_types.stmt -> slevel_annotation -> unit Cil_types.stmt -> slevel_annotation -> unit
val add_unroll_annot : emitter:Emitter.t -> loc:Cil_types.location -> val add_unroll_annot : emitter:Emitter.t ->
Cil_types.stmt -> unroll_annotation -> unit Cil_types.stmt -> unroll_annotation -> unit
val add_flow_annot : emitter:Emitter.t -> loc:Cil_types.location -> val add_flow_annot : emitter:Emitter.t ->
Cil_types.stmt -> flow_annotation -> unit Cil_types.stmt -> flow_annotation -> unit
val add_subdivision_annot : emitter:Emitter.t -> loc:Cil_types.location -> val add_subdivision_annot : emitter:Emitter.t ->
Cil_types.stmt -> int -> unit Cil_types.stmt -> int -> unit
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