From 16b87a367507f12001b588d181ed4429e503a0e4 Mon Sep 17 00:00:00 2001 From: Jeremy Dubreil Date: Tue, 23 May 2017 16:41:04 -0700 Subject: [PATCH] [infer] more cleanup for the tracing mode options Summary: There were some leftover uses of the `Tracing` analyzer option. While I was at it, I also rename the `Config` option name. Reviewed By: jberdine Differential Revision: D5113489 fbshipit-source-id: 68d5cc8 --- infer/lib/python/inferlib/config.py | 6 ------ infer/src/backend/interproc.ml | 2 +- infer/src/backend/symExec.ml | 2 +- infer/src/base/Config.ml | 4 ++-- infer/src/base/Config.mli | 2 +- infer/src/java/jTrans.ml | 10 +++++----- 6 files changed, 10 insertions(+), 16 deletions(-) diff --git a/infer/lib/python/inferlib/config.py b/infer/lib/python/inferlib/config.py index 202eceab8..6977de1b7 100644 --- a/infer/lib/python/inferlib/config.py +++ b/infer/lib/python/inferlib/config.py @@ -66,11 +66,8 @@ ANALYZER_ERADICATE = 'eradicate' ANALYZER_CHECKERS = 'checkers' ANALYZER_CAPTURE = 'capture' ANALYZER_COMPILE = 'compile' -ANALYZER_TRACING = 'tracing' ANALYZER_CRASHCONTEXT = 'crashcontext' ANALYZER_LINTERS = 'linters' -ANALYZER_QUANDARY = 'quandary' -ANALYZER_THREADSAFETY = 'threadsafety' ANALYZERS = [ ANALYZER_CAPTURE, @@ -80,7 +77,4 @@ ANALYZERS = [ ANALYZER_ERADICATE, ANALYZER_INFER, ANALYZER_LINTERS, - ANALYZER_TRACING, - ANALYZER_QUANDARY, - ANALYZER_THREADSAFETY, ] diff --git a/infer/src/backend/interproc.ml b/infer/src/backend/interproc.ml index 186e8aa66..1e27f6c73 100644 --- a/infer/src/backend/interproc.ml +++ b/infer/src/backend/interproc.ml @@ -1308,7 +1308,7 @@ let analyze_proc tenv proc_desc : Specs.summary = update_summary tenv summary specs phase res in if Config.curr_language_is Config.Clang && Config.report_custom_error then report_custom_errors tenv updated_summary; - if Config.curr_language_is Config.Java && Config.report_runtime_exceptions then + if Config.curr_language_is Config.Java && Config.tracing then report_runtime_exceptions tenv proc_desc updated_summary; updated_summary diff --git a/infer/src/backend/symExec.ml b/infer/src/backend/symExec.ml index b167e5892..985682569 100644 --- a/infer/src/backend/symExec.ml +++ b/infer/src/backend/symExec.ml @@ -1083,7 +1083,7 @@ let rec sym_exec tenv current_pdesc _instr (prop_: Prop.normal Prop.t) path Exceptions.Condition_always_true_false (desc, not (IntLit.iszero i), __POS__) in Reporting.log_warning current_pname exn | _ -> () in - if not Config.report_runtime_exceptions then + if not Config.tracing then check_already_dereferenced tenv current_pname cond prop__; check_condition_always_true_false (); let n_cond, prop = check_arith_norm_exp tenv current_pname cond prop__ in diff --git a/infer/src/base/Config.ml b/infer/src/base/Config.ml index e0c160158..15a03df0b 100644 --- a/infer/src/base/Config.ml +++ b/infer/src/base/Config.ml @@ -495,7 +495,7 @@ and analyzer = - $(b,checkers), $(b,eradicate): run the specified analysis\n\ - $(b,capture): similar to specifying the $(b,capture) subcommand (DEPRECATED)\n\ - $(b,compile): similar to specifying the $(b,compile) subcommand (DEPRECATED)\n\ - - $(b,crashcontext), $(b,tracing): experimental (see $(b,--crashcontext) and $(b,--tracing))\n\ + - $(b,crashcontext): experimental (see $(b,--crashcontext))\n\ - $(b,linters): run linters based on the ast only (Objective-C and Objective-C++ only, \ activated by default)" ~symbols:string_to_analyzer @@ -1841,7 +1841,6 @@ and report_custom_error = !report_custom_error and report_formatter = !report_formatter and report_hook = !report_hook and report_previous = !report_previous -and report_runtime_exceptions = !tracing and reports_include_ml_loc = !reports_include_ml_loc and resolve_infer_eradicate_conflict = !resolve_infer_eradicate_conflict and results_dir = !results_dir @@ -1873,6 +1872,7 @@ and trace_error = !trace_error and trace_ondemand = !trace_ondemand and trace_join = !trace_join and trace_rearrange = !trace_rearrange +and tracing = !tracing and type_size = !type_size and unsafe_malloc = !unsafe_malloc and whole_seconds = !whole_seconds diff --git a/infer/src/base/Config.mli b/infer/src/base/Config.mli index f7cacc580..305fb3835 100644 --- a/infer/src/base/Config.mli +++ b/infer/src/base/Config.mli @@ -310,7 +310,7 @@ val report_current : string option val report_formatter : [`No_formatter | `Phabricator_formatter] val report_hook : string option val report_previous : string option -val report_runtime_exceptions : bool +val tracing : bool val reports_include_ml_loc : bool val resolve_infer_eradicate_conflict : bool val results_dir : string diff --git a/infer/src/java/jTrans.ml b/infer/src/java/jTrans.ml index 1ebcf810a..0990a004a 100644 --- a/infer/src/java/jTrans.ml +++ b/infer/src/java/jTrans.ml @@ -548,7 +548,7 @@ let method_invocation | I_Special -> false | _ -> true in match sil_obj_expr with - | Exp.Var _ when is_non_constructor_call && not Config.report_runtime_exceptions -> + | Exp.Var _ when is_non_constructor_call && not Config.tracing -> let obj_typ_no_ptr = match sil_obj_type.Typ.desc with | Typ.Tptr (typ, _) -> typ @@ -912,7 +912,7 @@ let rec instruction (context : JContext.t) pc instr : translation = Instr call_node | JBir.Check (JBir.CheckNullPointer expr) - when Config.report_runtime_exceptions && is_this expr -> + when Config.tracing && is_this expr -> (* TODO #6509339: refactor the boilerplate code in the translation of JVM checks *) let (instrs, sil_expr, _) = expression context pc expr in let this_not_null_node = @@ -920,7 +920,7 @@ let rec instruction (context : JContext.t) pc instr : translation = (Procdesc.Node.Stmt_node "this not null") (instrs @ [assume_not_null loc sil_expr]) in Instr this_not_null_node - | JBir.Check (JBir.CheckNullPointer expr) when Config.report_runtime_exceptions -> + | JBir.Check (JBir.CheckNullPointer expr) when Config.tracing -> let (instrs, sil_expr, _) = expression context pc expr in let not_null_node = let sil_not_null = Exp.BinOp (Binop.Ne, sil_expr, Exp.null) in @@ -951,7 +951,7 @@ let rec instruction (context : JContext.t) pc instr : translation = Prune (not_null_node, throw_npe_node) | JBir.Check (JBir.CheckArrayBound (array_expr, index_expr)) - when Config.report_runtime_exceptions -> + when Config.tracing -> let instrs, _, sil_length_expr, sil_index_expr = let array_instrs, sil_array_expr, _ = expression context pc array_expr @@ -1008,7 +1008,7 @@ let rec instruction (context : JContext.t) pc instr : translation = Prune (in_bound_node, throw_out_of_bound_node) - | JBir.Check (JBir.CheckCast (expr, object_type)) when Config.report_runtime_exceptions -> + | JBir.Check (JBir.CheckCast (expr, object_type)) when Config.tracing -> let sil_type = JTransType.expr_type context expr and instrs, sil_expr, _ = expression context pc expr and ret_id = Ident.create_fresh Ident.knormal