From 2a191060b2f23a568c93781a5953fe9e75c14159 Mon Sep 17 00:00:00 2001 From: Jules Villard Date: Tue, 20 Oct 2020 11:06:35 -0700 Subject: [PATCH] [taskbar] print proc name earlier Summary: Don't wait until pre-analysis has completed before updating the task bar with the current procedure being analysed. Reviewed By: skcho Differential Revision: D24418609 fbshipit-source-id: afedaf687 --- infer/src/backend/ondemand.ml | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/infer/src/backend/ondemand.ml b/infer/src/backend/ondemand.ml index d3b088c79..04e89aec7 100644 --- a/infer/src/backend/ondemand.ml +++ b/infer/src/backend/ondemand.ml @@ -141,10 +141,7 @@ let restore_global_state st = (** reference to log errors only at the innermost recursive call *) let logged_error = ref false -let analyze callee_summary = - BackendStats.incr_ondemand_procs_analyzed () ; - let callee_pdesc = Summary.get_proc_desc callee_summary in - let exe_env = Option.value_exn !exe_env_ref in +let update_taskbar callee_pdesc = let proc_name = Procdesc.get_proc_name callee_pdesc in let source_file = (Procdesc.get_attributes callee_pdesc).ProcAttributes.translation_unit in let t0 = Mtime_clock.now () in @@ -156,7 +153,12 @@ let analyze callee_summary = F.asprintf "%s%a: %a" nesting SourceFile.pp source_file Procname.pp proc_name in current_taskbar_status := Some (t0, status) ; - !ProcessPoolState.update_status t0 status ; + !ProcessPoolState.update_status t0 status + + +let analyze callee_summary = + BackendStats.incr_ondemand_procs_analyzed () ; + let exe_env = Option.value_exn !exe_env_ref in Callbacks.iterate_procedure_callbacks exe_env callee_summary @@ -175,6 +177,7 @@ let run_proc_analysis ~caller_pdesc callee_pdesc = Procname.pp callee_pname ; let preprocess () = incr nesting ; + update_taskbar callee_pdesc ; Preanal.do_preanalysis (Option.value_exn !exe_env_ref) callee_pdesc ; if Config.debug_mode then DotCfg.emit_proc_desc (Procdesc.get_attributes callee_pdesc).translation_unit callee_pdesc