diff --git a/infer/man/man1/infer-analyze.txt b/infer/man/man1/infer-analyze.txt index 2624c1bed..3037a73b3 100644 --- a/infer/man/man1/infer-analyze.txt +++ b/infer/man/man1/infer-analyze.txt @@ -54,11 +54,11 @@ OPTIONS Activates: Enable --class-loads and disable all other checkers (Conversely: --no-class-loads-only) - --continue - Activates: Continue the capture for the reactive analysis, - increasing the changed files/procedures. (If a procedure was - changed beforehand, keep the changed marking.) (Conversely: - --no-continue) + --continue-analysis + Activates: Continue the analysis after more targets are captured + by --continue. The other analysis options should be given the same + before. Not compatible with --reanalyze and + --incremental-analysis. (Conversely: --no-continue-analysis) --cost Activates: checker for performance cost analysis (Conversely: diff --git a/infer/man/man1/infer-capture.txt b/infer/man/man1/infer-capture.txt index 25740983e..066442ec6 100644 --- a/infer/man/man1/infer-capture.txt +++ b/infer/man/man1/infer-capture.txt @@ -24,6 +24,12 @@ DESCRIPTION OPTIONS + --continue + Activates: Continue the capture for the reactive analysis, + increasing the changed files/procedures. (If a procedure was + changed beforehand, keep the changed marking.) (Conversely: + --no-continue) + --debug,-g Activates: Debug mode (also sets --debug-level 2, --developer-mode, --print-buckets, --print-types, diff --git a/infer/man/man1/infer-full.txt b/infer/man/man1/infer-full.txt index 6e35fd1dd..23df6ef4a 100644 --- a/infer/man/man1/infer-full.txt +++ b/infer/man/man1/infer-full.txt @@ -250,7 +250,14 @@ OPTIONS Activates: Continue the capture for the reactive analysis, increasing the changed files/procedures. (If a procedure was changed beforehand, keep the changed marking.) (Conversely: - --no-continue) See also infer-analyze(1). + --no-continue) See also infer-capture(1). + + --continue-analysis + Activates: Continue the analysis after more targets are captured + by --continue. The other analysis options should be given the same + before. Not compatible with --reanalyze and + --incremental-analysis. (Conversely: --no-continue-analysis) + See also infer-analyze(1). --cost Activates: checker for performance cost analysis (Conversely: @@ -1441,8 +1448,8 @@ INTERNAL OPTIONS --incremental-analysis Activates: [EXPERIMENTAL] Use incremental analysis for changed - files. Not compatible with --reanalyze. (Conversely: - --no-incremental-analysis) + files. Not compatible with --reanalyze and --continue-analysis. + (Conversely: --no-incremental-analysis) --iphoneos-target-sdk-version-path-regex-reset Set --iphoneos-target-sdk-version-path-regex to the empty list. @@ -1664,7 +1671,8 @@ INTERNAL OPTIONS --reanalyze Activates: Rerun the analysis. Not compatible with - --incremental-analysis. (Conversely: --no-reanalyze) + --incremental-analysis and --continue-analysis. (Conversely: + --no-reanalyze) --report-blacklist-files-containing-reset Set --report-blacklist-files-containing to the empty list. diff --git a/infer/man/man1/infer.txt b/infer/man/man1/infer.txt index c7b50cb1e..76cf94ef3 100644 --- a/infer/man/man1/infer.txt +++ b/infer/man/man1/infer.txt @@ -250,7 +250,14 @@ OPTIONS Activates: Continue the capture for the reactive analysis, increasing the changed files/procedures. (If a procedure was changed beforehand, keep the changed marking.) (Conversely: - --no-continue) See also infer-analyze(1). + --no-continue) See also infer-capture(1). + + --continue-analysis + Activates: Continue the analysis after more targets are captured + by --continue. The other analysis options should be given the same + before. Not compatible with --reanalyze and + --incremental-analysis. (Conversely: --no-continue-analysis) + See also infer-analyze(1). --cost Activates: checker for performance cost analysis (Conversely: diff --git a/infer/src/backend/InferAnalyze.ml b/infer/src/backend/InferAnalyze.ml index 6912ef705..259fb43ff 100644 --- a/infer/src/backend/InferAnalyze.ml +++ b/infer/src/backend/InferAnalyze.ml @@ -196,11 +196,12 @@ let invalidate_changed_procedures changed_files = let main ~changed_files = let time0 = Mtime_clock.counter () in register_active_checkers () ; - if Config.reanalyze then ( - L.progress "Invalidating procedures to be reanalyzed@." ; - Summary.OnDisk.reset_all ~filter:(Lazy.force Filtering.procedures_filter) () ; - L.progress "Done@." ) - else if not Config.incremental_analysis then DB.Results_dir.clean_specs_dir () ; + if not Config.continue_analysis then + if Config.reanalyze then ( + L.progress "Invalidating procedures to be reanalyzed@." ; + Summary.OnDisk.reset_all ~filter:(Lazy.force Filtering.procedures_filter) () ; + L.progress "Done@." ) + else if not Config.incremental_analysis then DB.Results_dir.clean_specs_dir () ; let source_files = get_source_files_to_analyze ~changed_files in (* empty all caches to minimize the process heap to have less work to do when forking *) clear_caches () ; diff --git a/infer/src/base/Config.ml b/infer/src/base/Config.ml index ac43eb31d..1f6f0b34f 100644 --- a/infer/src/base/Config.ml +++ b/infer/src/base/Config.ml @@ -1084,11 +1084,19 @@ and compute_analytics = marking. *) and continue = CLOpt.mk_bool ~deprecated:["continue"] ~long:"continue" - ~in_help:InferCommand.[(Analyze, manual_generic)] + ~in_help:InferCommand.[(Capture, manual_generic)] "Continue the capture for the reactive analysis, increasing the changed files/procedures. (If \ a procedure was changed beforehand, keep the changed marking.)" +and continue_analysis = + CLOpt.mk_bool ~long:"continue-analysis" + ~in_help:InferCommand.[(Analyze, manual_generic)] + "Continue the analysis after more targets are captured by $(b,--continue). The other analysis \ + options should be given the same before. Not compatible with $(b,--reanalyze) and \ + $(b,--incremental-analysis)." + + and costs_current = CLOpt.mk_path_opt ~long:"costs-current" ~in_help:InferCommand.[(ReportDiff, manual_generic)] @@ -2036,7 +2044,8 @@ and reactive_capture = and reanalyze = CLOpt.mk_bool ~long:"reanalyze" - "Rerun the analysis. Not compatible with $(b,--incremental-analysis)." + "Rerun the analysis. Not compatible with $(b,--incremental-analysis) and \ + $(b,--continue-analysis)." and relative_path_backtrack = @@ -2439,7 +2448,7 @@ and use_cost_threshold = and incremental_analysis = CLOpt.mk_bool ~long:"incremental-analysis" ~default:false "[EXPERIMENTAL] Use incremental analysis for changed files. Not compatible with \ - $(b,--reanalyze)." + $(b,--reanalyze) and $(b,--continue-analysis)." and version = @@ -2827,6 +2836,8 @@ and class_loads_roots = String.Set.of_list !class_loads_roots and compute_analytics = !compute_analytics +and continue_analysis = !continue_analysis + and continue_capture = !continue and cost = !cost diff --git a/infer/src/base/Config.mli b/infer/src/base/Config.mli index b39520d6d..637adeb5e 100644 --- a/infer/src/base/Config.mli +++ b/infer/src/base/Config.mli @@ -290,6 +290,8 @@ val command : InferCommand.t val compute_analytics : bool +val continue_analysis : bool + val continue_capture : bool val cost : bool