diff --git a/infer/src/backend/prop.ml b/infer/src/backend/prop.ml index acaafc5b2..bb31d0781 100644 --- a/infer/src/backend/prop.ml +++ b/infer/src/backend/prop.ml @@ -1761,11 +1761,11 @@ end = struct let stack = Stack.create () let init es = Stack.clear stack; - IList.iter (fun e -> Stack.push e stack) (IList.rev es) + IList.iter (fun e -> Stack.push stack e) (IList.rev es) let final () = Stack.clear stack let is_empty () = Stack.is_empty stack - let push e = Stack.push e stack - let pop () = Stack.pop stack + let push e = Stack.push stack e + let pop () = Stack.pop_exn stack end let sigma_get_start_lexps_sort sigma = diff --git a/infer/src/base/Process.ml b/infer/src/base/Process.ml index dd0181968..583f4c62a 100644 --- a/infer/src/base/Process.ml +++ b/infer/src/base/Process.ml @@ -78,8 +78,8 @@ let run_jobs_in_parallel jobs_stack gen_prog prog_to_string = let run_job () = let jobs_map = ref PidMap.empty in let current_jobs_count = start_current_jobs_count () in - while not (Caml.Stack.is_empty jobs_stack) do - let job_prog = Caml.Stack.pop jobs_stack in + while not (Stack.is_empty jobs_stack) do + let job_prog = Stack.pop_exn jobs_stack in let (dir_opt, prog, args, env) = gen_prog job_prog in Pervasives.incr current_jobs_count; match Unix.fork () with @@ -90,7 +90,7 @@ let run_jobs_in_parallel jobs_stack gen_prog prog_to_string = |> never_returns | `In_the_parent pid_child -> jobs_map := PidMap.add pid_child (prog_to_string job_prog) !jobs_map; - if Caml.Stack.length jobs_stack = 0 || !current_jobs_count >= Config.jobs then + if Stack.length jobs_stack = 0 || !current_jobs_count >= Config.jobs then wait_for_child (pid_to_program !jobs_map) current_jobs_count jobs_map done in run_job (); diff --git a/infer/src/base/Utils.ml b/infer/src/base/Utils.ml index dec99b376..a4c68f08f 100644 --- a/infer/src/base/Utils.ml +++ b/infer/src/base/Utils.ml @@ -30,7 +30,11 @@ module Nativeint = Core.Std.Nativeint module Option = Core.Std.Option module Pid = Core.Std.Pid module Printexc = Core.Std.Printexc +module Printf = Core.Std.Printf +module Queue = Core.Std.Queue +module Random = Core.Std.Random module Signal = Core.Std.Signal +module Stack = Core.Std.Stack module String = Core.Std.String module Sys = struct include Core.Std.Sys diff --git a/infer/src/base/Utils.mli b/infer/src/base/Utils.mli index 733c1c777..18de67fda 100644 --- a/infer/src/base/Utils.mli +++ b/infer/src/base/Utils.mli @@ -30,7 +30,11 @@ module Nativeint = Core.Std.Nativeint module Option = Core.Std.Option module Pid = Core.Std.Pid module Printexc = Core.Std.Printexc +module Printf = Core.Std.Printf +module Queue = Core.Std.Queue +module Random = Core.Std.Random module Signal = Core.Std.Signal +module Stack = Core.Std.Stack module String = Core.Std.String module Sys : module type of Core.Std.Sys module Unix = Core.Std.Unix diff --git a/infer/src/clang/cTL.ml b/infer/src/clang/cTL.ml index 19ca86922..28ea73720 100644 --- a/infer/src/clang/cTL.ml +++ b/infer/src/clang/cTL.ml @@ -136,7 +136,7 @@ module Debug = struct let node = {id = t.next_id; content} in let create_subtree root = Tree (root, []) in let subtree' = create_subtree node in - Stack.push subtree' t.eval_stack; + Stack.push t.eval_stack subtree'; {t with next_id = t.next_id + 1} let eval_end t result = @@ -145,16 +145,16 @@ module Debug = struct | false -> Eval_false in if Stack.is_empty t.eval_stack then raise (Empty_stack "Unbalanced number of eval_begin/eval_end invocations"); - let evaluated_tree = match Stack.pop t.eval_stack with + let evaluated_tree = match Stack.pop_exn t.eval_stack with | Tree ({id = _; content} as node, children) -> let content' = {content with eval_result = eval_result_of_bool result} in Tree ({node with content = content'}, children) in let forest' = if Stack.is_empty t.eval_stack then evaluated_tree :: t.forest else - let parent = match Stack.pop t.eval_stack with + let parent = match Stack.pop_exn t.eval_stack with Tree (node, children) -> Tree (node, evaluated_tree :: children) in - Stack.push parent t.eval_stack; + Stack.push t.eval_stack parent; t.forest in {t with forest = forest'} diff --git a/infer/src/integration/CaptureCompilationDatabase.ml b/infer/src/integration/CaptureCompilationDatabase.ml index c32c4db75..1c325f354 100644 --- a/infer/src/integration/CaptureCompilationDatabase.ml +++ b/infer/src/integration/CaptureCompilationDatabase.ml @@ -50,7 +50,7 @@ let add_flavor_to_targets args = let create_files_stack compilation_database should_capture_file = let stack = Stack.create () in let add_to_stack file _ = if should_capture_file file then - Stack.push file stack in + Stack.push stack file in CompilationDatabase.iter compilation_database add_to_stack; stack