From eb3252b50fffb88de17c327f570a77d69cb85ad6 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?David=20B=C3=BChler?= <david.buhler@cea.fr>
Date: Wed, 2 Aug 2023 15:14:26 +0200
Subject: [PATCH] [Eva] Removes unused callstack from Inout callback
 [Record_Inout_Callbacks].

---
 src/kernel_services/plugin_entry_points/db.ml  | 4 +---
 src/kernel_services/plugin_entry_points/db.mli | 6 ++----
 src/plugins/eva/engine/transfer_stmt.ml        | 3 +--
 src/plugins/inout/operational_inputs.ml        | 2 +-
 4 files changed, 5 insertions(+), 10 deletions(-)

diff --git a/src/kernel_services/plugin_entry_points/db.ml b/src/kernel_services/plugin_entry_points/db.ml
index 7d2158054e0..4266f7dd127 100644
--- a/src/kernel_services/plugin_entry_points/db.ml
+++ b/src/kernel_services/plugin_entry_points/db.ml
@@ -126,9 +126,7 @@ module Operational_inputs = struct
       failwith ("Db.Operational_inputs.get_internal_precise not implemented"))
   let get_external = mk_fun "Operational_inputs.get_external"
 
-  module Record_Inout_Callbacks =
-    Hook.Build (struct type t = Eva_types.Callstack.t * Inout_type.t end)
-  [@@alert "-db_deprecated"]
+  module Record_Inout_Callbacks = Hook.Build (struct type t = Inout_type.t end)
 
   let pretty fmt x =
     Format.fprintf fmt "@[<v>";
diff --git a/src/kernel_services/plugin_entry_points/db.mli b/src/kernel_services/plugin_entry_points/db.mli
index 8228f31cab7..7867a74f246 100644
--- a/src/kernel_services/plugin_entry_points/db.mli
+++ b/src/kernel_services/plugin_entry_points/db.mli
@@ -319,10 +319,8 @@ module Operational_inputs : sig
 
   (**/**)
   (* Internal use *)
-  module Record_Inout_Callbacks:
-    Hook.Iter_hook with type param = Eva_types.Callstack.t * Inout_type.t
-    [@@alert "-db_deprecated"]
-    (**/**)
+  module Record_Inout_Callbacks: Hook.Iter_hook with type param = Inout_type.t
+  (**/**)
 end
 
 
diff --git a/src/plugins/eva/engine/transfer_stmt.ml b/src/plugins/eva/engine/transfer_stmt.ml
index 78ab84bc972..3ff6e2ac1d4 100644
--- a/src/plugins/eva/engine/transfer_stmt.ml
+++ b/src/plugins/eva/engine/transfer_stmt.ml
@@ -56,8 +56,7 @@ module InOutCallback =
     end)
 
 let register_callback () =
-  Db.Operational_inputs.Record_Inout_Callbacks.extend_once
-    (fun (_stack, inout) -> InOutCallback.set inout)
+  Db.Operational_inputs.Record_Inout_Callbacks.extend_once InOutCallback.set
 
 let () = Cmdline.run_after_configuring_stage register_callback
 
diff --git a/src/plugins/inout/operational_inputs.ml b/src/plugins/inout/operational_inputs.ml
index fd6ac739038..8f658d124e1 100644
--- a/src/plugins/inout/operational_inputs.ml
+++ b/src/plugins/inout/operational_inputs.ml
@@ -580,7 +580,7 @@ module Callwise = struct
     | [] -> Inout_parameters.fatal "callwise: internal stack is empty"
 
   let end_record callstack kf inout =
-    Db.Operational_inputs.Record_Inout_Callbacks.apply (callstack, inout);
+    Db.Operational_inputs.Record_Inout_Callbacks.apply inout;
     let callsite = Eva.Callstack.top_callsite callstack in
     match callsite, !call_inout_stack with
     | Kstmt _, (_caller, table) :: _ ->
-- 
GitLab