From de162c86ab1e861d077c5ec09fb0a8186c018635 Mon Sep 17 00:00:00 2001 From: Dulma Churchill Date: Wed, 27 Sep 2017 08:51:34 -0700 Subject: [PATCH] [cleanup] Do not create captured folders when only linting Summary: These folders are left empty when linting, so better not create them. Reviewed By: jvillard Differential Revision: D5921418 fbshipit-source-id: f6efc4f --- infer/src/clang/Capture.ml | 6 ++++-- infer/src/integration/Driver.ml | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/infer/src/clang/Capture.ml b/infer/src/clang/Capture.ml index a9d2b604f..626476f6b 100644 --- a/infer/src/clang/Capture.ml +++ b/infer/src/clang/Capture.ml @@ -34,7 +34,7 @@ let init_global_state_for_capture_and_linters source_file = L.(debug Capture Medium) "Processing %s" (Filename.basename (SourceFile.to_abs_path source_file)) ; if Config.developer_mode then register_perf_stats_report source_file ; Config.curr_language := Config.Clang ; - DB.Results_dir.init source_file ; + if Config.clang_frontend_do_capture then DB.Results_dir.init source_file ; CFrontend_config.reset_global_state () let run_clang_frontend ast_source = @@ -87,7 +87,9 @@ let run_clang_frontend ast_source = if Config.clang_frontend_do_lint then CFrontend_checkers_main.do_frontend_checks trans_unit_ctx ast_decl ; if Config.clang_frontend_do_capture then CFrontend.do_source_file trans_unit_ctx ast_decl ; - L.(debug Capture Medium) "End translation AST file %a... OK!@\n" pp_ast_filename ast_source ; + L.(debug Capture Medium) + "End %s of AST file %a... OK!@\n" Config.clang_frontend_action_string pp_ast_filename + ast_source ; print_elapsed () let run_and_validate_clang_frontend ast_source = diff --git a/infer/src/integration/Driver.ml b/infer/src/integration/Driver.ml index c0c67851a..7e171c30c 100644 --- a/infer/src/integration/Driver.ml +++ b/infer/src/integration/Driver.ml @@ -164,7 +164,7 @@ let clean_results_dir () = let check_captured_empty mode = let clean_command_opt = clean_compilation_command mode in - if Utils.directory_is_empty Config.captured_dir then ( + if Config.clang_frontend_do_capture && Utils.directory_is_empty Config.captured_dir then ( ( match clean_command_opt with | Some clean_command -> L.user_warning "@\nNothing to compile. Try running `%s` first.@." clean_command