diff --git a/infer/src/backend/RestartScheduler.ml b/infer/src/backend/RestartScheduler.ml index 1f737789c..d9322b6f5 100644 --- a/infer/src/backend/RestartScheduler.ml +++ b/infer/src/backend/RestartScheduler.ml @@ -17,24 +17,15 @@ let of_list (lst : 'a list) : 'a ProcessPool.TaskGenerator.t = {remaining_tasks; is_empty; finished; next} -let make_with_procs_from sources = - let gen = +let make sources = + let pnames = List.map sources ~f:SourceFiles.proc_names_of_source |> List.concat |> List.rev_map ~f:(fun procname -> SchedulerTypes.Procname procname) - |> List.permute ~random_state:(Random.State.make (Array.create ~len:1 0)) - |> of_list - in - let next x = - let res = gen.next x in - (* see defn of gen above to see why res should never match Some (File _) *) - match res with None -> None | Some (File _) -> assert false | Some (Procname _) as v -> v in - {gen with next} - - -let make sources = - ProcessPool.TaskGenerator.chain (make_with_procs_from sources) (FileScheduler.make sources) + let files = List.map sources ~f:(fun file -> SchedulerTypes.File file) in + let permute = List.permute ~random_state:(Random.State.make (Array.create ~len:1 0)) in + permute pnames @ permute files |> of_list let if_restart_scheduler f = diff --git a/infer/src/backend/ondemand.ml b/infer/src/backend/ondemand.ml index a8f78e321..b9f813a4e 100644 --- a/infer/src/backend/ondemand.ml +++ b/infer/src/backend/ondemand.ml @@ -373,13 +373,13 @@ let analyze_proc_name_no_caller callee_pname = let analyze_procedures exe_env procs_to_analyze source_file_opt = let saved_language = !Language.curr_language in - Option.iter source_file_opt ~f:(fun source_file -> - if Config.dump_duplicate_symbols then dump_duplicate_procs source_file procs_to_analyze ) ; set_exe_env exe_env ; let analyze_proc_name_call pname = ignore (analyze_proc_name_no_caller pname : Summary.t option) in List.iter ~f:analyze_proc_name_call procs_to_analyze ; + Option.iter source_file_opt ~f:(fun source_file -> + if Config.dump_duplicate_symbols then dump_duplicate_procs source_file procs_to_analyze ) ; Option.iter source_file_opt ~f:(fun source_file -> Callbacks.iterate_cluster_callbacks procs_to_analyze exe_env source_file ; create_perf_stats_report source_file ) ;