Skip to content
Snippets Groups Projects
Commit 297cc069 authored by Valentin Perrelle's avatar Valentin Perrelle Committed by David Bühler
Browse files

[Dive] Add command dive.clear

parent d28a290b
No related branches found
No related tags found
No related merge requests found
......@@ -161,10 +161,10 @@ module BaseSet = Cil_datatype.Varinfo.Set
module FunctionMap = Kernel_function.Map
type t = {
graph: Graph.t;
node_table: node NodeTable.t;
file_table: node FileTable.t;
callstack_table: node CallstackTable.t;
mutable graph: Graph.t;
mutable node_table: node NodeTable.t;
mutable file_table: node FileTable.t;
mutable callstack_table: node CallstackTable.t;
mutable unfolded_bases: BaseSet.t;
mutable hidden_bases: BaseSet.t;
mutable focus: bool FunctionMap.t;
......@@ -411,7 +411,6 @@ let build_node_deps context node =
| Cluster -> ()
(* --- Graph initialization --- *)
let create () =
......@@ -427,6 +426,14 @@ let create () =
roots = [];
}
let clear context =
context.graph <- Graph.create ();
context.node_table <- NodeTable.create 13;
context.file_table <- FileTable.create 13;
context.callstack_table <- CallstackTable.create 13;
context.focus <- FunctionMap.empty;
context.roots <- []
(* --- Accessors --- *)
......
......@@ -23,6 +23,8 @@
type t
val create : unit -> t
val clear : t -> unit (* reset to almost an empty context,
but keeps folded and hidden bases *)
val get_graph : t -> Imprecision_graph.t
val get_roots : t -> Graph_types.node list
......
......@@ -103,6 +103,12 @@ let () = Request.register ~page
~input:(module Data.Junit) ~output:(module Graph)
(fun () -> Build.get_graph (get_graph ()))
let () = Request.register ~page
~kind:`EXEC ~name:"dive.clear"
~descr:(Markdown.rm "Erase the graph and start over with an empty one")
~input:(module Data.Junit) ~output:(module Data.Junit)
(fun () -> Build.clear (get_graph ()))
let () = Request.register ~page
~kind:`EXEC ~name:"dive.add_var"
~descr:(Markdown.rm "Add a variable to the graph")
......
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