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

Summary:
The Siof checkers can now be run with:
  infer -a checkers --siof -- ...
and also runs by default using:
  infer -a checkers -- ...

Reviewed By: jberdine

Differential Revision: D5009731

fbshipit-source-id: e0e2168
master
Jeremy Dubreil 8 years ago committed by Facebook Github Bot
parent 62be37f163
commit 8064ac2614

@ -271,7 +271,6 @@ let should_report (issue_kind: Exceptions.err_kind) issue_type error_desc eclass
switch Config.analyzer { switch Config.analyzer {
| Checkers | Checkers
| Eradicate | Eradicate
| Siof
| Tracing => true | Tracing => true
| Bufferoverrun | Bufferoverrun
| Capture | Capture

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

@ -37,7 +37,7 @@ let frontend_parse_modes = CLOpt.(Infer [Clang])
type analyzer = type analyzer =
| Capture | Compile | Infer | Eradicate | Checkers | Tracing | Crashcontext | Linters | Quandary | Capture | Compile | Infer | Eradicate | Checkers | Tracing | Crashcontext | Linters | Quandary
| Siof | Bufferoverrun | Bufferoverrun
[@@deriving compare] [@@deriving compare]
let equal_analyzer = [%compare.equal : analyzer] let equal_analyzer = [%compare.equal : analyzer]
@ -46,7 +46,7 @@ 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); ("siof", Siof); ("bufferoverrun", Bufferoverrun)] ("quandary", Quandary); ("bufferoverrun", Bufferoverrun)]
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
@ -482,7 +482,7 @@ and analyzer =
(* 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
| Quandary | Siof | Bufferoverrun -> () in | Quandary | Bufferoverrun -> () 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\
@ -490,8 +490,7 @@ and analyzer =
- 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\
- linters: run linters based on the ast only (Objective-C and Objective-C++ only)\n\ - linters: run linters based on the ast only (Objective-C and Objective-C++ only)"
- siof: check for Static Initialization Order Fiasco (C++ only)"
~symbols:string_to_analyzer ~symbols:string_to_analyzer
and android_harness = and android_harness =
@ -593,7 +592,7 @@ and changed_files_index =
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 bufferoverrun, checkers, checkers_repeated_calls, and bufferoverrun, checkers, checkers_repeated_calls,
eradicate, quandary, siof = eradicate, quandary =
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"
@ -618,13 +617,8 @@ and bufferoverrun, checkers, checkers_repeated_calls,
"Activate the quandary taint analysis" "Activate the quandary taint analysis"
[checkers] [] [checkers] []
in in
let siof =
CLOpt.mk_bool_group ~long:"siof"
"Activate the Static Initialization Order Fiasco analysis"
[checkers] []
in
(bufferoverrun, checkers, checkers_repeated_calls, (bufferoverrun, checkers, checkers_repeated_calls,
eradicate, quandary, siof) 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"
@ -1246,6 +1240,10 @@ and seconds_per_iteration =
CLOpt.mk_float_opt ~deprecated:["seconds_per_iteration"] ~long:"seconds-per-iteration" CLOpt.mk_float_opt ~deprecated:["seconds_per_iteration"] ~long:"seconds-per-iteration"
~meta:"float" "Set the number of seconds per iteration (see --iterations)" ~meta:"float" "Set the number of seconds per iteration (see --iterations)"
and siof =
CLOpt.mk_bool ~long:"siof" ~parse_mode:CLOpt.(Infer [Checkers])
"Activate 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"
~parse_mode:CLOpt.(Infer [Checkers]) ~parse_mode:CLOpt.(Infer [Checkers])
@ -1557,7 +1555,6 @@ let post_parsing_initialization () =
| Some Eradicate -> checkers := true; eradicate := true | Some Eradicate -> checkers := true; eradicate := true
| Some Quandary -> checkers := true; quandary := true | Some Quandary -> checkers := true; quandary := true
| Some Bufferoverrun -> checkers := true; bufferoverrun := true | Some Bufferoverrun -> checkers := true; bufferoverrun := true
| Some Siof -> checkers := true; siof := true
| Some Tracing -> tracing := true | Some Tracing -> tracing := true
| Some (Capture | Compile | Infer | Linters) | None -> () | Some (Capture | Compile | Infer | Linters) | None -> ()

@ -20,7 +20,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 | Quandary
| Siof | Bufferoverrun | Bufferoverrun
[@@deriving compare] [@@deriving compare]
val equal_analyzer : analyzer -> analyzer -> bool val equal_analyzer : analyzer -> analyzer -> bool

@ -44,7 +44,7 @@ let active_procedure_checkers () =
let l = let l =
[ [
ClangTaintAnalysis.checker, Config.quandary; ClangTaintAnalysis.checker, Config.quandary;
Siof.checker, Config.siof; Siof.checker, enabled_by_default || Config.siof;
ThreadSafety.analyze_procedure, Config.threadsafety; ThreadSafety.analyze_procedure, Config.threadsafety;
BufferOverrunChecker.checker, Config.bufferoverrun; BufferOverrunChecker.checker, Config.bufferoverrun;
Interproc.analyze_procedure, Config.biabduction; Interproc.analyze_procedure, Config.biabduction;

@ -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, (Bufferoverrun | Checkers | Infer | Quandary | Siof) -> | None, (Bufferoverrun | Checkers | Infer | Quandary) ->
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 = siof 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$(MODELS_DIR)/cpp/include -isystem$(CLANG_INCLUDES)/c++/v1/ -c CLANG_OPTIONS = -x c++ -std=c++11 -nostdinc++ -isystem$(MODELS_DIR)/cpp/include -isystem$(CLANG_INCLUDES)/c++/v1/ -c
INFER_OPTIONS = --ml-buckets cpp --no-filtering --debug-exceptions --project-root $(TESTS_DIR) --no-failures-allowed INFER_OPTIONS = --siof --ml-buckets cpp --no-filtering --debug-exceptions --project-root $(TESTS_DIR) --no-failures-allowed
INFERPRINT_OPTIONS = --issues-tests INFERPRINT_OPTIONS = --issues-tests
SOURCES = \ SOURCES = \

Loading…
Cancel
Save