diff --git a/infer/src/backend/InferPrint.re b/infer/src/backend/InferPrint.re index fe65d6a1f..75e49d10a 100644 --- a/infer/src/backend/InferPrint.re +++ b/infer/src/backend/InferPrint.re @@ -276,8 +276,7 @@ let should_report (issue_kind: Exceptions.err_kind) issue_type error_desc eclass | Compile | Crashcontext | Infer - | Linters - | Quandary => false + | Linters => false }; if analyzer_is_whitelisted { true diff --git a/infer/src/backend/infer.ml b/infer/src/backend/infer.ml index 8f61ada15..f525aee7a 100644 --- a/infer/src/backend/infer.ml +++ b/infer/src/backend/infer.ml @@ -375,7 +375,7 @@ let analyze driver_mode = false, false | _, (Capture | Compile) -> false, false - | _, (Infer | Eradicate | Checkers | Tracing | Crashcontext | Quandary) -> + | _, (Infer | Eradicate | Checkers | Tracing | Crashcontext) -> true, true | _, Linters -> false, true in diff --git a/infer/src/base/CommandLineOption.ml b/infer/src/base/CommandLineOption.ml index b74c6e973..3af5763bf 100644 --- a/infer/src/base/CommandLineOption.ml +++ b/infer/src/base/CommandLineOption.ml @@ -56,12 +56,12 @@ let to_arg_spec_triple (x, spec, y) = (x, to_arg_spec spec, y) let to_arg_speclist = List.map ~f:to_arg_spec_triple type section = - Analysis | BufferOverrun | Checkers | Clang | Crashcontext | Driver | Java | Print | Quandary + Analysis | BufferOverrun | Checkers | Clang | Crashcontext | Driver | Java | Print [@@deriving compare] let equal_section = [%compare.equal : section ] let all_sections = - [ Analysis; BufferOverrun; Checkers; Clang; Crashcontext; Driver; Java; Print; Quandary ] + [ Analysis; BufferOverrun; Checkers; Clang; Crashcontext; Driver; Java; Print ] (* NOTE: All variants must be also added to `all_parse_tags` below *) type 'a parse = Differential | Infer of 'a | Javac | NoParse [@@deriving compare] @@ -89,7 +89,7 @@ let to_parse_tag parse = let accept_unknown_args = function | Infer Print | Javac | NoParse -> true - | Infer (Analysis | BufferOverrun | Checkers | Clang | Crashcontext | Driver | Java | Quandary) + | Infer (Analysis | BufferOverrun | Checkers | Clang | Crashcontext | Driver | Java) | Differential -> false type desc = { @@ -657,7 +657,6 @@ let set_curr_speclist_for_parse_action ~usage ?(parse_all=false) parse_action = add_to_curr_speclist ~header:"Checkers options" (Infer Checkers); add_to_curr_speclist ~header:"Clang-specific options" (Infer Clang); add_to_curr_speclist ~header:"Java-specific options" (Infer Java); - add_to_curr_speclist ~header:"Quandary checker options" (Infer Quandary) ) else add_to_curr_speclist ~add_help:true parse_action ; diff --git a/infer/src/base/CommandLineOption.mli b/infer/src/base/CommandLineOption.mli index 3bfbabfc9..bd8ebf05e 100644 --- a/infer/src/base/CommandLineOption.mli +++ b/infer/src/base/CommandLineOption.mli @@ -16,7 +16,7 @@ val warnf : ('a, Format.formatter, unit) format -> 'a (** a section is a part of infer that can be affected by an infer option *) type section = - Analysis | BufferOverrun | Checkers | Clang | Crashcontext | Driver | Java | Print | Quandary + Analysis | BufferOverrun | Checkers | Clang | Crashcontext | Driver | Java | Print [@@deriving compare] val all_sections : section list diff --git a/infer/src/base/Config.ml b/infer/src/base/Config.ml index e56771cfb..75e8dad78 100644 --- a/infer/src/base/Config.ml +++ b/infer/src/base/Config.ml @@ -34,7 +34,7 @@ let exe_name = fun exe -> List.Assoc.find_exn ~equal:equal_exe exe_to_name exe type analyzer = - | Capture | Compile | Infer | Eradicate | Checkers | Tracing | Crashcontext | Linters | Quandary + | Capture | Compile | Infer | Eradicate | Checkers | Tracing | Crashcontext | Linters [@@deriving compare] let equal_analyzer = [%compare.equal : analyzer] @@ -42,8 +42,7 @@ let equal_analyzer = [%compare.equal : analyzer] let string_to_analyzer = [("capture", Capture); ("compile", Compile); ("infer", Infer); ("eradicate", Eradicate); ("checkers", Checkers); - ("tracing", Tracing); ("crashcontext", Crashcontext); ("linters", Linters); - ("quandary", Quandary)] + ("tracing", Tracing); ("crashcontext", Crashcontext); ("linters", Linters);] let string_of_analyzer a = List.find_exn ~f:(fun (_, a') -> equal_analyzer a a') string_to_analyzer |> fst @@ -478,12 +477,11 @@ and analyzer = let () = match Infer with (* NOTE: if compilation fails here, it means you have added a new analyzer without updating the documentation of this option *) - | Capture | Compile | Infer | Eradicate | Checkers | Tracing | Crashcontext | Linters - | Quandary -> () in + | Capture | Compile | Infer | Eradicate | Checkers | Tracing | Crashcontext | Linters -> () in CLOpt.mk_symbol_opt ~deprecated:["analyzer"] ~long:"analyzer" ~short:'a' ~parse_mode:CLOpt.(Infer [Driver]) "Specify which analyzer to run (only one at a time is supported):\n\ - - infer, eradicate, checkers, quandary: run the specified analysis\n\ + - infer, eradicate, checkers: run the specified analysis\n\ - capture: run capture phase only (no analysis)\n\ - compile: run compilation command without interfering (not supported by all frontends)\n\ - crashcontext, tracing: experimental (see --crashcontext and --tracing)\n\ @@ -518,7 +516,7 @@ and ast_file = and biabduction = CLOpt.mk_bool ~long:"biabduction" ~parse_mode:CLOpt.(Infer [Checkers]) - "Activate the separation logic based bi-abduction analysis using the checkers framework" + "the separation logic based bi-abduction analysis using the checkers framework" and blacklist = CLOpt.mk_string_opt ~deprecated:["-blacklist-regex";"-blacklist"] ~long:"buck-blacklist" @@ -557,7 +555,7 @@ and buck_out = and bufferoverrun = CLOpt.mk_bool ~long:"bufferoverrun" ~parse_mode:CLOpt.(Infer [Checkers]) - "Activate the buffer overrun analysis" + "the buffer overrun analysis" and bugs_csv = CLOpt.mk_path_opt ~deprecated:["bugs"] ~long:"issues-csv" @@ -592,29 +590,21 @@ and changed_files_index = "Specify the file containing the list of source files from which reactive analysis should \ start. Source files should be specified relative to project root or be absolute" -and checkers, checkers_repeated_calls, - eradicate, quandary = +and checkers_repeated_calls = + CLOpt.mk_bool ~long:"checkers-repeated-calls" ~parse_mode:CLOpt.(Infer [Checkers]) + "check for repeated calls" + +and checkers, eradicate = let checkers = CLOpt.mk_bool ~deprecated:["checkers"] ~long:"checkers" "Activate the checkers instead of the full analysis" in - let checkers_repeated_calls = - CLOpt.mk_bool_group ~long:"checkers-repeated-calls" - "Check for repeated calls" - [checkers] [] - in let eradicate = CLOpt.mk_bool_group ~deprecated:["eradicate"] ~long:"eradicate" "Activate the eradicate checker for Java annotations" [checkers] [] in - let quandary = - CLOpt.mk_bool_group ~deprecated:["quandary"] ~long:"quandary" - "Activate the quandary taint analysis" - [checkers] [] - in - (checkers, checkers_repeated_calls, - eradicate, quandary) + (checkers, eradicate) and clang_biniou_file = CLOpt.mk_path_opt ~long:"clang-biniou-file" ~parse_mode:CLOpt.(Infer [Clang]) ~meta:"file" @@ -685,7 +675,7 @@ and copy_propagation = and crashcontext = CLOpt.mk_bool ~long:"crashcontext" ~parse_mode:CLOpt.(Infer [Checkers]) - "Activate the crashcontext checker for Java stack trace context reconstruction" + "the crashcontext checker for Java stack trace context reconstruction" and cxx = CLOpt.mk_bool ~deprecated:["cxx-experimental"] ~long:"cxx" @@ -1146,19 +1136,23 @@ and project_root = ~parse_mode:CLOpt.(Infer [Analysis;Clang;Driver;Print]) ~meta:"dir" "Specify the root directory of the project" +and quandary = + CLOpt.mk_bool ~long:"quandary" ~parse_mode:CLOpt.(Infer [Checkers]) + "the quandary taint analysis" + and quandary_endpoints = CLOpt.mk_json ~long:"quandary-endpoints" - ~parse_mode:CLOpt.(Infer [Quandary]) + ~parse_mode:CLOpt.(Infer [Checkers]) "Specify endpoint classes for Quandary" and quandary_sources = CLOpt.mk_json ~long:"quandary-sources" - ~parse_mode:CLOpt.(Infer [Quandary]) + ~parse_mode:CLOpt.(Infer [Checkers]) "Specify custom sources for Quandary" and quandary_sinks = CLOpt.mk_json ~long:"quandary-sinks" - ~parse_mode:CLOpt.(Infer [Quandary]) + ~parse_mode:CLOpt.(Infer [Checkers]) "Specify custom sinks for Quandary" and quiet = @@ -1238,7 +1232,7 @@ and seconds_per_iteration = and siof = CLOpt.mk_bool ~long:"siof" ~parse_mode:CLOpt.(Infer [Checkers]) - "Activate the Static Initialization Order Fiasco analysis (C++ only)" + "the Static Initialization Order Fiasco analysis (C++ only)" and siof_safe_methods = CLOpt.mk_string_list ~long:"siof-safe-methods" @@ -1349,7 +1343,7 @@ and threadsafe_aliases = and threadsafety = CLOpt.mk_bool ~long:"threadsafety" ~parse_mode:CLOpt.(Infer [Checkers]) - "Activate the thread safety analysis" + "the thread safety analysis" and trace_join = CLOpt.mk_bool ~deprecated:["trace_join"] ~long:"trace-join" @@ -1549,11 +1543,9 @@ let post_parsing_initialization () = | Some Checkers -> checkers := true | Some Crashcontext -> checkers := true; crashcontext := true | Some Eradicate -> checkers := true; eradicate := true - | Some Quandary -> checkers := true; quandary := true | Some Tracing -> tracing := true | Some (Capture | Compile | Infer | Linters) | None -> () - let inferconfig_env_var = "INFERCONFIG" (** Name of the infer configuration file *) @@ -1813,7 +1805,7 @@ let dynamic_dispatch = match analyzer with | Infer | Tracing -> `Lazy - | Quandary -> `Sound + | 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 76b1daf06..ca9fb065b 100644 --- a/infer/src/base/Config.mli +++ b/infer/src/base/Config.mli @@ -19,7 +19,7 @@ val exe_name : exe -> string (** Various kind of analyzers *) type analyzer = - | Capture | Compile | Infer | Eradicate | Checkers | Tracing | Crashcontext | Linters | Quandary + | Capture | Compile | Infer | Eradicate | Checkers | Tracing | Crashcontext | Linters [@@deriving compare] val equal_analyzer : analyzer -> analyzer -> bool diff --git a/infer/src/base/Logging.ml b/infer/src/base/Logging.ml index 7f72cf3a5..0643a3be2 100644 --- a/infer/src/base/Logging.ml +++ b/infer/src/base/Logging.ml @@ -30,7 +30,7 @@ let dup_formatter fmt1 fmt2 = (** Name of dir for logging the output in the specific executable *) let log_dir_of_action (action : CLOpt.parse_action) = match action with - | Infer (Analysis | BufferOverrun | Checkers | Crashcontext | Quandary) -> "analyze" + | Infer (Analysis | BufferOverrun | Checkers | Crashcontext) -> "analyze" | Differential -> "differential" | Infer Driver -> "driver" | Infer Clang diff --git a/infer/src/integration/Buck.ml b/infer/src/integration/Buck.ml index c390bc7ec..e579d83f1 100644 --- a/infer/src/integration/Buck.ml +++ b/infer/src/integration/Buck.ml @@ -51,7 +51,7 @@ let add_flavor_to_target target = target | None, (Linters | Capture) -> add "infer-capture-all" - | None, (Checkers | Infer | Quandary) -> + | None, (Checkers | Infer) -> add "infer" | None, (Eradicate | Tracing | Crashcontext) -> failwithf "Analyzer %s is Java-only; not supported with Buck flavors" diff --git a/infer/tests/codetoanalyze/cpp/quandary/Makefile b/infer/tests/codetoanalyze/cpp/quandary/Makefile index 085246a87..1e6af2e39 100644 --- a/infer/tests/codetoanalyze/cpp/quandary/Makefile +++ b/infer/tests/codetoanalyze/cpp/quandary/Makefile @@ -7,10 +7,10 @@ TESTS_DIR = ../../.. -ANALYZER = quandary +ANALYZER = checkers # see explanations in cpp/errors/Makefile for the custom isystem CLANG_OPTIONS = -x c++ -std=c++11 -nostdinc++ -isystem$(ROOT_DIR) -isystem$(CLANG_INCLUDES)/c++/v1/ -c -INFER_OPTIONS = --ml-buckets cpp --no-filtering --debug-exceptions --project-root $(TESTS_DIR) --no-failures-allowed +INFER_OPTIONS = --quandary --ml-buckets cpp --no-filtering --debug-exceptions --project-root $(TESTS_DIR) --no-failures-allowed INFERPRINT_OPTIONS = --issues-tests SOURCES = $(wildcard *.cpp) diff --git a/infer/tests/codetoanalyze/java/quandary/Makefile b/infer/tests/codetoanalyze/java/quandary/Makefile index 4436b52a1..d0db989cc 100644 --- a/infer/tests/codetoanalyze/java/quandary/Makefile +++ b/infer/tests/codetoanalyze/java/quandary/Makefile @@ -7,8 +7,8 @@ TESTS_DIR = ../../.. -ANALYZER = quandary -INFER_OPTIONS = --no-filtering --debug-exceptions +ANALYZER = checkers +INFER_OPTIONS = --quandary --no-filtering --debug-exceptions INFERPRINT_OPTIONS = --issues-tests SOURCES = $(wildcard *.java)