Skip to content
Snippets Groups Projects
Commit 1b0b42c7 authored by Thibault Martin's avatar Thibault Martin
Browse files

[kernel] Register extensions in early stage

parent aa1f72c2
No related branches found
No related tags found
No related merge requests found
...@@ -757,5 +757,11 @@ let unroll_typer (ctxt: Logic_typing.typing_context) (_loc:location) args = ...@@ -757,5 +757,11 @@ let unroll_typer (ctxt: Logic_typing.typing_context) (_loc:location) args =
Lenv.empty () |> append_here_label |> append_init_label |> append_pre_label Lenv.empty () |> append_here_label |> append_init_label |> append_pre_label
in Ext_terms (List.map (ctxt.type_term ctxt env) args) in Ext_terms (List.map (ctxt.type_term ctxt env) args)
let () = Acsl_extension.register_code_annot_next_loop let register_extensions () =
Acsl_extension.register_code_annot_next_loop
~plugin:"kernel" "unfold" unroll_typer false ~plugin:"kernel" "unfold" unroll_typer false
let register_once, _ =
State_builder.apply_once "Unfold_loops.register_extensions" [] register_extensions
let () = Cmdline.run_after_early_stage register_once
...@@ -250,15 +250,13 @@ let get ?bhv stmt = ...@@ -250,15 +250,13 @@ let get ?bhv stmt =
(* --- Registry --- *) (* --- Registry --- *)
(* -------------------------------------------------------------------------- *) (* -------------------------------------------------------------------------- *)
let register = let register_extensions () =
let once = ref false in Acsl_extension.register_code_annot_next_stmt ~plugin:"kernel"
fun () -> "calls" typecheck true;
if (not !once) then begin Acsl_extension.register_behavior ~plugin:"kernel"
once := true; "instanceof" typecheck true
Acsl_extension.register_code_annot_next_stmt ~plugin:"kernel"
"calls" typecheck true ; let register_once, _ =
Acsl_extension.register_behavior ~plugin:"kernel" State_builder.apply_once "Dyncall.register_extensions" [] register_extensions
"instanceof" typecheck true ;
end
let () = Cmdline.run_after_configuring_stage register let () = Cmdline.run_after_early_stage register_once
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