Skip to content
Snippets Groups Projects
Commit 6676f750 authored by Allan Blanchard's avatar Allan Blanchard
Browse files

[kernel] Query to know if a kf is the entry point

parent 1c0c5b42
No related branches found
No related tags found
No related merge requests found
......@@ -847,6 +847,13 @@ let set_entry_point name lib =
Kernel.LibEntry.unsafe_set lib;
end
let is_entry_point ?when_lib_entry kf =
match when_lib_entry with
| Some value when Kernel.LibEntry.get () -> value
| _ ->
try Cil_datatype.Kf.equal kf @@ fst @@ entry_point ()
with No_such_entry_point _ -> false
(* ************************************************************************* *)
(** {2 Global Comments} *)
(* ************************************************************************* *)
......
......@@ -293,6 +293,14 @@ val set_entry_point : string -> bool -> unit
[Kernel.MainFunction] or [Kernel.LibEntry].
@plugin development guide *)
val is_entry_point : ?when_lib_entry:bool -> kernel_function -> bool
(** @return [true] iff the given kernel function is the entry point.
The optional parameter [when_lib_entry] overrides the result if we are
in -lib-entry mode.
@since Frama-C+dev
*)
(* ************************************************************************* *)
(** {2 Comments} *)
(* ************************************************************************* *)
......
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