From 441bf7131a9fd04f27f22412964e77dfb4d4ec95 Mon Sep 17 00:00:00 2001 From: Jeremy Dubreil Date: Mon, 22 May 2017 18:52:34 -0700 Subject: [PATCH] [infer][CLI] remove the Tracing analyzer option and only rely on the --tracing option for the biabduction analysis Summary: Remove the `Tracing` analyzer option Reviewed By: sblackshear Differential Revision: D5108036 fbshipit-source-id: 460bc57 --- infer/src/backend/InferAnalyze.re | 4 +--- infer/src/backend/InferPrint.re | 3 +-- infer/src/backend/infer.ml | 2 +- infer/src/base/Config.ml | 15 +++++---------- infer/src/base/Config.mli | 3 +-- infer/src/integration/Buck.ml | 2 +- infer/tests/codetoanalyze/java/tracing/Makefile | 4 ++-- 7 files changed, 12 insertions(+), 21 deletions(-) diff --git a/infer/src/backend/InferAnalyze.re b/infer/src/backend/InferAnalyze.re index f02fcb01b..a6e26b8d8 100644 --- a/infer/src/backend/InferAnalyze.re +++ b/infer/src/backend/InferAnalyze.re @@ -21,9 +21,7 @@ let analyze_exe_env_tasks cluster exe_env :Tasks.t => { L.log_progress_file (); Specs.clear_spec_tbl (); Random.self_init (); - let biabduction_only = - Config.equal_analyzer Config.analyzer Config.BiAbduction || - Config.equal_analyzer Config.analyzer Config.Tracing; + let biabduction_only = Config.equal_analyzer Config.analyzer Config.BiAbduction; if biabduction_only { /* run the biabduction analysis only */ Tasks.create diff --git a/infer/src/backend/InferPrint.re b/infer/src/backend/InferPrint.re index fae1d5928..911ffd069 100644 --- a/infer/src/backend/InferPrint.re +++ b/infer/src/backend/InferPrint.re @@ -263,8 +263,7 @@ let should_report (issue_kind: Exceptions.err_kind) issue_type error_desc eclass } else { let analyzer_is_whitelisted = switch Config.analyzer { - | Eradicate - | Tracing => true + | Eradicate => true | BiAbduction | CaptureOnly | Checkers diff --git a/infer/src/backend/infer.ml b/infer/src/backend/infer.ml index 7f407a91c..3b8e74263 100644 --- a/infer/src/backend/infer.ml +++ b/infer/src/backend/infer.ml @@ -375,7 +375,7 @@ let analyze driver_mode = false, false | _, (CaptureOnly | CompileOnly) -> false, false - | _, (BiAbduction | Checkers | Crashcontext | Eradicate | Tracing) -> + | _, (BiAbduction | Checkers | Crashcontext | Eradicate) -> true, true | _, Linters -> false, true in diff --git a/infer/src/base/Config.ml b/infer/src/base/Config.ml index 72b7d2de7..b492619f4 100644 --- a/infer/src/base/Config.ml +++ b/infer/src/base/Config.ml @@ -18,8 +18,7 @@ module CLOpt = CommandLineOption module F = Format type analyzer = - | BiAbduction | CaptureOnly | CompileOnly | Eradicate | Checkers | Tracing | Crashcontext - | Linters + | BiAbduction | CaptureOnly | CompileOnly | Eradicate | Checkers | Crashcontext | Linters [@@deriving compare] let equal_analyzer = [%compare.equal : analyzer] @@ -27,7 +26,6 @@ let equal_analyzer = [%compare.equal : analyzer] let string_to_analyzer = [ "capture", CaptureOnly; "checkers", Checkers; "compile", CompileOnly; "crashcontext", Crashcontext; "eradicate", Eradicate; "infer", BiAbduction; "linters", Linters; - "tracing", Tracing; ] let string_of_analyzer a = @@ -487,7 +485,7 @@ and analyzer = let () = match BiAbduction with (* NOTE: if compilation fails here, it means you have added a new analyzer without updating the documentation of this option *) - | BiAbduction | CaptureOnly | CompileOnly | Eradicate | Checkers | Tracing | Crashcontext + | BiAbduction | CaptureOnly | CompileOnly | Eradicate | Checkers | Crashcontext | Linters -> () in CLOpt.mk_symbol_opt ~deprecated:["analyzer"] ~long:"analyzer" ~short:'a' ~in_help:CLOpt.[Analyze, manual_generic; Run, manual_generic] @@ -1416,11 +1414,10 @@ and trace_rearrange = CLOpt.mk_bool ~deprecated:["trace_rearrange"] ~long:"trace-rearrange" "Detailed tracing information during prop re-arrangement operations" -(** Report error traces for runtime exceptions (Java only): generate preconditions for runtime - exceptions in Java and report errors for public methods which throw runtime exceptions *) and tracing = CLOpt.mk_bool ~deprecated:["tracing"] ~long:"tracing" - "" + "Report error traces for runtime exceptions (Java only): generate preconditions for runtime\ + exceptions in Java and report errors for public methods which throw runtime exceptions" and type_size = CLOpt.mk_bool ~deprecated:["type_size"] ~long:"type-size" @@ -1612,7 +1609,6 @@ let post_parsing_initialization command_opt = | Some BiAbduction -> biabduction := true | Some Crashcontext -> crashcontext := true | Some Eradicate -> eradicate := true - | Some Tracing -> biabduction := true; tracing := true | Some (CaptureOnly | CompileOnly | Checkers | Linters) -> () | None -> let open CLOpt in @@ -1878,8 +1874,7 @@ let clang_frontend_action_string = let dynamic_dispatch = let default_mode = match analyzer with - | BiAbduction - | Tracing -> `Lazy + | BiAbduction -> `Lazy | Checkers when quandary -> `Sound | _ -> `None in Option.value ~default:default_mode !dynamic_dispatch diff --git a/infer/src/base/Config.mli b/infer/src/base/Config.mli index 48342e183..129304eda 100644 --- a/infer/src/base/Config.mli +++ b/infer/src/base/Config.mli @@ -16,8 +16,7 @@ module CLOpt = CommandLineOption time by system calls, environment variables, or command line options *) type analyzer = - | BiAbduction | CaptureOnly | CompileOnly | Eradicate | Checkers | Tracing | Crashcontext - | Linters + | BiAbduction | CaptureOnly | CompileOnly | Eradicate | Checkers | Crashcontext | Linters [@@deriving compare] val equal_analyzer : analyzer -> analyzer -> bool diff --git a/infer/src/integration/Buck.ml b/infer/src/integration/Buck.ml index 9b6766d44..10f25be58 100644 --- a/infer/src/integration/Buck.ml +++ b/infer/src/integration/Buck.ml @@ -53,7 +53,7 @@ let add_flavor_to_target target = add "infer-capture-all" | None, (BiAbduction | Checkers) -> add "infer" - | None, (Eradicate | Tracing | Crashcontext) -> + | None, (Eradicate | Crashcontext) -> failwithf "Analyzer %s is Java-only; not supported with Buck flavors" (Config.string_of_analyzer Config.analyzer) diff --git a/infer/tests/codetoanalyze/java/tracing/Makefile b/infer/tests/codetoanalyze/java/tracing/Makefile index b72e189d2..9aa408024 100644 --- a/infer/tests/codetoanalyze/java/tracing/Makefile +++ b/infer/tests/codetoanalyze/java/tracing/Makefile @@ -7,8 +7,8 @@ TESTS_DIR = ../../.. -ANALYZER = tracing -INFER_OPTIONS = --no-filtering --debug-exceptions +ANALYZER = infer +INFER_OPTIONS = --tracing --no-filtering --debug-exceptions INFERPRINT_OPTIONS = --issues-tests SOURCES = $(wildcard *.java)