From 6c22ec7979b2cbaf7d963f20c99aedceb0ed68d3 Mon Sep 17 00:00:00 2001
From: Allan Blanchard <allan.blanchard@cea.fr>
Date: Thu, 25 Jan 2024 09:11:38 +0100
Subject: [PATCH] [kernel] remove deprecated function from Db

---
 doc/developer/advance.tex                      | 2 +-
 doc/developer/check_api/run.oracle             | 4 ++--
 src/kernel_services/plugin_entry_points/db.ml  | 4 ----
 src/kernel_services/plugin_entry_points/db.mli | 7 -------
 src/libraries/utils/task.mli                   | 2 +-
 5 files changed, 4 insertions(+), 15 deletions(-)

diff --git a/doc/developer/advance.tex b/doc/developer/advance.tex
index bc8c92d13ca..54830c6fdf0 100644
--- a/doc/developer/advance.tex
+++ b/doc/developer/advance.tex
@@ -4263,7 +4263,7 @@ points. The documentation of the class type
 source documentation (see Section~\ref{tut2:doc}).
 
 Besides time-consuming computations have to call the function
-\texttt{!Db.progress}\scodeidx{Db}{progress} from time to time in order to keep the GUI reactive.
+\texttt{Db.yield}\scodeidx{Db}{yield} from time to time in order to keep the GUI reactive.
 
 %Mainly that's all!
 The GUI implementation uses
diff --git a/doc/developer/check_api/run.oracle b/doc/developer/check_api/run.oracle
index ba68feb385a..4aef5e8b54b 100644
--- a/doc/developer/check_api/run.oracle
+++ b/doc/developer/check_api/run.oracle
@@ -258,7 +258,7 @@ Cil_types.logic_var//description of a logic variable/
 Cil_types.exp_node.BinOp/ of Cil_types.binop * Cil_types.exp * Cil_types.exp * Cil_types.typ/Binary operation. Includes the type of the result. The arithmetic  conversions are made explicit for the arguments./
 Log.log_channel/Log.channel -> ?kind:Log.kind -> 'a Log.pretty_printer/logging function to user-created channel./
 Cil_types.stmtkind.Loop/ of Cil_types.code_annotation list * Cil_types.block * Cil_types.location * Cil_types.stmt option * Cil_types.stmt option/A while(1) loop. The termination test is implemented in the body of a  loop using a Break statement. If Cfg.prepareCFG has been called, the  first stmt option will point to the stmt containing the continue label  for this loop and the second will point to the stmt containing the break  label for this loop./
-Db.progress/(unit -> unit) Stdlib.ref/This function should be called from time to time by all analysers taking time. In GUI mode, this will make the interface reactive./
+Db.yield/(unit -> unit) Stdlib.ref/This function should be called from time to time by all analysers taking time. In GUI mode, this will make the interface reactive./
 Kernel_function.get_definition/t -> Cil_types.fundec/Returns the list of static variables declared inside the function. raised exception: No_Definition./
 Datatype.char/char Type.t//
 Visitor_behavior.Get.stmt/Visitor_behavior.t -> Cil_types.stmt -> Cil_types.stmt/Fold operations on table of a given type of AST elements. Fold.ast_element vis f, folds f over each pair of ast_element registered in vis. The ast_element in the old AST is presented to f first (that is, f looks like: let f old_e new_e acc = .... For example for Cil_types.varinfo: Fold.varinfo vis (fun old_vi new_vi acc -> ... )./
@@ -310,4 +310,4 @@ State_builder/?prj:Project.t -> string -> 'a Type.t -> 'a * boolend end /State b
 Datatype.S_no_copy.equal/Datatype.t -> Datatype.t -> bool/Equality: same spec than Stdlib.(=)./
 Cil.cilVisitor.current_kinstr/Cil_types.kinstr/Kstmt stmt when visiting statement stmt, Kglobal when called outside  of a statement./
 Parameter_sig.Int/Parameter_sig.Int/Signature for an integer parameter./
-Visitor_behavior.Memo/Visitor_behavior.Get/Memo operations on behaviors, allows to get a binding in the new project for the given AST element, creating one if it does not already exists. Memo.ast_element vis e with e of type ast_element tries to find a binding to a e in the new project created using vis in the current state, if it does not exist this binding is created. For example for Cil_types.varinfo: Memo.varinfo vis vi./
\ No newline at end of file
+Visitor_behavior.Memo/Visitor_behavior.Get/Memo operations on behaviors, allows to get a binding in the new project for the given AST element, creating one if it does not already exists. Memo.ast_element vis e with e of type ast_element tries to find a binding to a e in the new project created using vis in the current state, if it does not exist this binding is created. For example for Cil_types.varinfo: Memo.varinfo vis vi./
diff --git a/src/kernel_services/plugin_entry_points/db.ml b/src/kernel_services/plugin_entry_points/db.ml
index f323723913f..76e276df124 100644
--- a/src/kernel_services/plugin_entry_points/db.ml
+++ b/src/kernel_services/plugin_entry_points/db.ml
@@ -233,10 +233,6 @@ let sleep ms =
       in
       wait_and_trigger ()
 
-(* ---- Deprecated old API ---- *)
-
-let progress = ref (Kernel.deprecated "!Db.progress()" ~now:"Db.yield()" yield)
-
 (* ************************************************************************* *)
 
 (*
diff --git a/src/kernel_services/plugin_entry_points/db.mli b/src/kernel_services/plugin_entry_points/db.mli
index 65434ec1c10..bd5c3f53352 100644
--- a/src/kernel_services/plugin_entry_points/db.mli
+++ b/src/kernel_services/plugin_entry_points/db.mli
@@ -147,13 +147,6 @@ end
 
 (** {3 GUI} *)
 
-(** This function should be called from time to time by all analysers taking
-    time. In GUI mode, this will make the interface reactive.
-    @see <https://frama-c.com/download/frama-c-plugin-development-guide.pdf>
-    @deprecated 21.0-Scandium *)
-val progress: (unit -> unit) ref
-[@@ deprecated "Use Db.yield instead."]
-
 (** Registered daemon on progress. *)
 type daemon
 
diff --git a/src/libraries/utils/task.mli b/src/libraries/utils/task.mli
index bcb501bb306..3cb276e9b66 100644
--- a/src/libraries/utils/task.mli
+++ b/src/libraries/utils/task.mli
@@ -272,5 +272,5 @@ val waiting : server -> int option
 val on_idle : ((unit -> bool) -> unit) ref
 (** Typically modified by GUI.
     [!on_idle f] should repeatedly calls [f] until it returns [false].
-    Default implementation rely on [Unix.sleep 1] and [Db.progress].
+    Default implementation rely on [Unix.sleep 1].
     See also [Gtk_helper] module implementation. *)
-- 
GitLab