[infer][checkers] remove the quandary analyzer option and rely on the --quandary flag only

Reviewed By: jvillard, sblackshear

Differential Revision: D5009572

fbshipit-source-id: 815899d
master
Jeremy Dubreil 8 years ago committed by Facebook Github Bot
parent 6f85980e6e
commit 7e12885f98

@ -276,8 +276,7 @@ let should_report (issue_kind: Exceptions.err_kind) issue_type error_desc eclass
| Compile | Compile
| Crashcontext | Crashcontext
| Infer | Infer
| Linters | Linters => false
| Quandary => false
}; };
if analyzer_is_whitelisted { if analyzer_is_whitelisted {
true true

@ -375,7 +375,7 @@ let analyze driver_mode =
false, false false, false
| _, (Capture | Compile) -> | _, (Capture | Compile) ->
false, false false, false
| _, (Infer | Eradicate | Checkers | Tracing | Crashcontext | Quandary) -> | _, (Infer | Eradicate | Checkers | Tracing | Crashcontext) ->
true, true true, true
| _, Linters -> | _, Linters ->
false, true in false, true in

@ -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 let to_arg_speclist = List.map ~f:to_arg_spec_triple
type section = type section =
Analysis | BufferOverrun | Checkers | Clang | Crashcontext | Driver | Java | Print | Quandary Analysis | BufferOverrun | Checkers | Clang | Crashcontext | Driver | Java | Print
[@@deriving compare] [@@deriving compare]
let equal_section = [%compare.equal : section ] let equal_section = [%compare.equal : section ]
let all_sections = 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 *) (* NOTE: All variants must be also added to `all_parse_tags` below *)
type 'a parse = Differential | Infer of 'a | Javac | NoParse [@@deriving compare] 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 let accept_unknown_args = function
| Infer Print | Javac | NoParse -> true | Infer Print | Javac | NoParse -> true
| Infer (Analysis | BufferOverrun | Checkers | Clang | Crashcontext | Driver | Java | Quandary) | Infer (Analysis | BufferOverrun | Checkers | Clang | Crashcontext | Driver | Java)
| Differential -> false | Differential -> false
type desc = { 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:"Checkers options" (Infer Checkers);
add_to_curr_speclist ~header:"Clang-specific options" (Infer Clang); 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:"Java-specific options" (Infer Java);
add_to_curr_speclist ~header:"Quandary checker options" (Infer Quandary)
) else ) else
add_to_curr_speclist ~add_help:true parse_action add_to_curr_speclist ~add_help:true parse_action
; ;

@ -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 *) (** a section is a part of infer that can be affected by an infer option *)
type section = type section =
Analysis | BufferOverrun | Checkers | Clang | Crashcontext | Driver | Java | Print | Quandary Analysis | BufferOverrun | Checkers | Clang | Crashcontext | Driver | Java | Print
[@@deriving compare] [@@deriving compare]
val all_sections : section list val all_sections : section list

@ -34,7 +34,7 @@ let exe_name =
fun exe -> List.Assoc.find_exn ~equal:equal_exe exe_to_name exe fun exe -> List.Assoc.find_exn ~equal:equal_exe exe_to_name exe
type analyzer = type analyzer =
| Capture | Compile | Infer | Eradicate | Checkers | Tracing | Crashcontext | Linters | Quandary | Capture | Compile | Infer | Eradicate | Checkers | Tracing | Crashcontext | Linters
[@@deriving compare] [@@deriving compare]
let equal_analyzer = [%compare.equal : analyzer] let equal_analyzer = [%compare.equal : analyzer]
@ -42,8 +42,7 @@ let equal_analyzer = [%compare.equal : analyzer]
let string_to_analyzer = let string_to_analyzer =
[("capture", Capture); ("compile", Compile); [("capture", Capture); ("compile", Compile);
("infer", Infer); ("eradicate", Eradicate); ("checkers", Checkers); ("infer", Infer); ("eradicate", Eradicate); ("checkers", Checkers);
("tracing", Tracing); ("crashcontext", Crashcontext); ("linters", Linters); ("tracing", Tracing); ("crashcontext", Crashcontext); ("linters", Linters);]
("quandary", Quandary)]
let string_of_analyzer a = let string_of_analyzer a =
List.find_exn ~f:(fun (_, a') -> equal_analyzer a a') string_to_analyzer |> fst List.find_exn ~f:(fun (_, a') -> equal_analyzer a a') string_to_analyzer |> fst
@ -478,12 +477,11 @@ and analyzer =
let () = match Infer with let () = match Infer with
(* NOTE: if compilation fails here, it means you have added a new analyzer without updating the (* NOTE: if compilation fails here, it means you have added a new analyzer without updating the
documentation of this option *) documentation of this option *)
| Capture | Compile | Infer | Eradicate | Checkers | Tracing | Crashcontext | Linters | Capture | Compile | Infer | Eradicate | Checkers | Tracing | Crashcontext | Linters -> () in
| Quandary -> () in
CLOpt.mk_symbol_opt ~deprecated:["analyzer"] ~long:"analyzer" ~short:'a' CLOpt.mk_symbol_opt ~deprecated:["analyzer"] ~long:"analyzer" ~short:'a'
~parse_mode:CLOpt.(Infer [Driver]) ~parse_mode:CLOpt.(Infer [Driver])
"Specify which analyzer to run (only one at a time is supported):\n\ "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\ - capture: run capture phase only (no analysis)\n\
- compile: run compilation command without interfering (not supported by all frontends)\n\ - compile: run compilation command without interfering (not supported by all frontends)\n\
- crashcontext, tracing: experimental (see --crashcontext and --tracing)\n\ - crashcontext, tracing: experimental (see --crashcontext and --tracing)\n\
@ -518,7 +516,7 @@ and ast_file =
and biabduction = and biabduction =
CLOpt.mk_bool ~long:"biabduction" ~parse_mode:CLOpt.(Infer [Checkers]) 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 = and blacklist =
CLOpt.mk_string_opt ~deprecated:["-blacklist-regex";"-blacklist"] ~long:"buck-blacklist" CLOpt.mk_string_opt ~deprecated:["-blacklist-regex";"-blacklist"] ~long:"buck-blacklist"
@ -557,7 +555,7 @@ and buck_out =
and bufferoverrun = and bufferoverrun =
CLOpt.mk_bool ~long:"bufferoverrun" ~parse_mode:CLOpt.(Infer [Checkers]) CLOpt.mk_bool ~long:"bufferoverrun" ~parse_mode:CLOpt.(Infer [Checkers])
"Activate the buffer overrun analysis" "the buffer overrun analysis"
and bugs_csv = and bugs_csv =
CLOpt.mk_path_opt ~deprecated:["bugs"] ~long:"issues-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 \ "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" start. Source files should be specified relative to project root or be absolute"
and checkers, checkers_repeated_calls, and checkers_repeated_calls =
eradicate, quandary = CLOpt.mk_bool ~long:"checkers-repeated-calls" ~parse_mode:CLOpt.(Infer [Checkers])
"check for repeated calls"
and checkers, eradicate =
let checkers = let checkers =
CLOpt.mk_bool ~deprecated:["checkers"] ~long:"checkers" CLOpt.mk_bool ~deprecated:["checkers"] ~long:"checkers"
"Activate the checkers instead of the full analysis" "Activate the checkers instead of the full analysis"
in in
let checkers_repeated_calls =
CLOpt.mk_bool_group ~long:"checkers-repeated-calls"
"Check for repeated calls"
[checkers] []
in
let eradicate = let eradicate =
CLOpt.mk_bool_group ~deprecated:["eradicate"] ~long:"eradicate" CLOpt.mk_bool_group ~deprecated:["eradicate"] ~long:"eradicate"
"Activate the eradicate checker for Java annotations" "Activate the eradicate checker for Java annotations"
[checkers] [] [checkers] []
in in
let quandary = (checkers, eradicate)
CLOpt.mk_bool_group ~deprecated:["quandary"] ~long:"quandary"
"Activate the quandary taint analysis"
[checkers] []
in
(checkers, checkers_repeated_calls,
eradicate, quandary)
and clang_biniou_file = and clang_biniou_file =
CLOpt.mk_path_opt ~long:"clang-biniou-file" ~parse_mode:CLOpt.(Infer [Clang]) ~meta:"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 = and crashcontext =
CLOpt.mk_bool ~long:"crashcontext" ~parse_mode:CLOpt.(Infer [Checkers]) 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 = and cxx =
CLOpt.mk_bool ~deprecated:["cxx-experimental"] ~long:"cxx" CLOpt.mk_bool ~deprecated:["cxx-experimental"] ~long:"cxx"
@ -1146,19 +1136,23 @@ and project_root =
~parse_mode:CLOpt.(Infer [Analysis;Clang;Driver;Print]) ~parse_mode:CLOpt.(Infer [Analysis;Clang;Driver;Print])
~meta:"dir" "Specify the root directory of the project" ~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 = and quandary_endpoints =
CLOpt.mk_json ~long:"quandary-endpoints" CLOpt.mk_json ~long:"quandary-endpoints"
~parse_mode:CLOpt.(Infer [Quandary]) ~parse_mode:CLOpt.(Infer [Checkers])
"Specify endpoint classes for Quandary" "Specify endpoint classes for Quandary"
and quandary_sources = and quandary_sources =
CLOpt.mk_json ~long:"quandary-sources" CLOpt.mk_json ~long:"quandary-sources"
~parse_mode:CLOpt.(Infer [Quandary]) ~parse_mode:CLOpt.(Infer [Checkers])
"Specify custom sources for Quandary" "Specify custom sources for Quandary"
and quandary_sinks = and quandary_sinks =
CLOpt.mk_json ~long:"quandary-sinks" CLOpt.mk_json ~long:"quandary-sinks"
~parse_mode:CLOpt.(Infer [Quandary]) ~parse_mode:CLOpt.(Infer [Checkers])
"Specify custom sinks for Quandary" "Specify custom sinks for Quandary"
and quiet = and quiet =
@ -1238,7 +1232,7 @@ and seconds_per_iteration =
and siof = and siof =
CLOpt.mk_bool ~long:"siof" ~parse_mode:CLOpt.(Infer [Checkers]) 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 = and siof_safe_methods =
CLOpt.mk_string_list ~long:"siof-safe-methods" CLOpt.mk_string_list ~long:"siof-safe-methods"
@ -1349,7 +1343,7 @@ and threadsafe_aliases =
and threadsafety = and threadsafety =
CLOpt.mk_bool ~long:"threadsafety" ~parse_mode:CLOpt.(Infer [Checkers]) CLOpt.mk_bool ~long:"threadsafety" ~parse_mode:CLOpt.(Infer [Checkers])
"Activate the thread safety analysis" "the thread safety analysis"
and trace_join = and trace_join =
CLOpt.mk_bool ~deprecated:["trace_join"] ~long:"trace-join" CLOpt.mk_bool ~deprecated:["trace_join"] ~long:"trace-join"
@ -1549,11 +1543,9 @@ let post_parsing_initialization () =
| Some Checkers -> checkers := true | Some Checkers -> checkers := true
| Some Crashcontext -> checkers := true; crashcontext := true | Some Crashcontext -> checkers := true; crashcontext := true
| Some Eradicate -> checkers := true; eradicate := true | Some Eradicate -> checkers := true; eradicate := true
| Some Quandary -> checkers := true; quandary := true
| Some Tracing -> tracing := true | Some Tracing -> tracing := true
| Some (Capture | Compile | Infer | Linters) | None -> () | Some (Capture | Compile | Infer | Linters) | None -> ()
let inferconfig_env_var = "INFERCONFIG" let inferconfig_env_var = "INFERCONFIG"
(** Name of the infer configuration file *) (** Name of the infer configuration file *)
@ -1813,7 +1805,7 @@ let dynamic_dispatch =
match analyzer with match analyzer with
| Infer | Infer
| Tracing -> `Lazy | Tracing -> `Lazy
| Quandary -> `Sound | Checkers when quandary -> `Sound
| _ -> `None in | _ -> `None in
Option.value ~default:default_mode !dynamic_dispatch Option.value ~default:default_mode !dynamic_dispatch

@ -19,7 +19,7 @@ val exe_name : exe -> string
(** Various kind of analyzers *) (** Various kind of analyzers *)
type analyzer = type analyzer =
| Capture | Compile | Infer | Eradicate | Checkers | Tracing | Crashcontext | Linters | Quandary | Capture | Compile | Infer | Eradicate | Checkers | Tracing | Crashcontext | Linters
[@@deriving compare] [@@deriving compare]
val equal_analyzer : analyzer -> analyzer -> bool val equal_analyzer : analyzer -> analyzer -> bool

@ -30,7 +30,7 @@ let dup_formatter fmt1 fmt2 =
(** Name of dir for logging the output in the specific executable *) (** Name of dir for logging the output in the specific executable *)
let log_dir_of_action (action : CLOpt.parse_action) = match action with 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" | Differential -> "differential"
| Infer Driver -> "driver" | Infer Driver -> "driver"
| Infer Clang | Infer Clang

@ -51,7 +51,7 @@ let add_flavor_to_target target =
target target
| None, (Linters | Capture) -> | None, (Linters | Capture) ->
add "infer-capture-all" add "infer-capture-all"
| None, (Checkers | Infer | Quandary) -> | None, (Checkers | Infer) ->
add "infer" add "infer"
| None, (Eradicate | Tracing | Crashcontext) -> | None, (Eradicate | Tracing | Crashcontext) ->
failwithf "Analyzer %s is Java-only; not supported with Buck flavors" failwithf "Analyzer %s is Java-only; not supported with Buck flavors"

@ -7,10 +7,10 @@
TESTS_DIR = ../../.. TESTS_DIR = ../../..
ANALYZER = quandary ANALYZER = checkers
# see explanations in cpp/errors/Makefile for the custom isystem # 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 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 INFERPRINT_OPTIONS = --issues-tests
SOURCES = $(wildcard *.cpp) SOURCES = $(wildcard *.cpp)

@ -7,8 +7,8 @@
TESTS_DIR = ../../.. TESTS_DIR = ../../..
ANALYZER = quandary ANALYZER = checkers
INFER_OPTIONS = --no-filtering --debug-exceptions INFER_OPTIONS = --quandary --no-filtering --debug-exceptions
INFERPRINT_OPTIONS = --issues-tests INFERPRINT_OPTIONS = --issues-tests
SOURCES = $(wildcard *.java) SOURCES = $(wildcard *.java)

Loading…
Cancel
Save