From 61e457b1f6f352fff0adbe640347cb406a5bad53 Mon Sep 17 00:00:00 2001 From: jrm Date: Tue, 8 Dec 2015 12:44:42 -0800 Subject: [PATCH] Run the @PerformanceCritical checker by default with the other checkers Summary: public Run the PerformanceCritical checker in prod Reviewed By: cristianoc Differential Revision: D2707084 fb-gh-sync-id: 730f7e4 --- infer/lib/python/inferlib/analyze.py | 5 +++-- infer/src/backend/config.ml | 3 --- infer/src/checkers/registerCheckers.ml | 2 +- infer/tests/codetoanalyze/java/checkers/BUCK | 4 +--- 4 files changed, 5 insertions(+), 9 deletions(-) diff --git a/infer/lib/python/inferlib/analyze.py b/infer/lib/python/inferlib/analyze.py index aac497d7e..b4b3a43fa 100644 --- a/infer/lib/python/inferlib/analyze.py +++ b/infer/lib/python/inferlib/analyze.py @@ -418,9 +418,10 @@ class Infer: self.timing['makefile_generation'] = 0 else: - if self.args.analyzer in [config.ANALYZER_ERADICATE, - config.ANALYZER_CHECKERS]: + if self.args.analyzer == config.ANALYZER_ERADICATE: infer_analyze.append('-intraprocedural') + if self.args.analyzer == config.ANALYZER_CHECKERS: + os.environ['INFER_ONDEMAND'] = 'Y' os.environ['INFER_OPTIONS'] = ' '.join(infer_options) diff --git a/infer/src/backend/config.ml b/infer/src/backend/config.ml index 16cdc415e..2ba6db400 100644 --- a/infer/src/backend/config.ml +++ b/infer/src/backend/config.ml @@ -360,9 +360,6 @@ let default_failure_name = "ASSERTION_FAILURE" let analyze_models = from_env_variable "INFER_ANALYZE_MODELS" -(** report expensive calls warnings *) -let report_expensive_calls = from_env_variable "INFER_REPORT_EXPENSIVE_CALLS" - module Experiment = struct diff --git a/infer/src/checkers/registerCheckers.ml b/infer/src/checkers/registerCheckers.ml index 6eba5d26c..15d665558 100644 --- a/infer/src/checkers/registerCheckers.ml +++ b/infer/src/checkers/registerCheckers.ml @@ -35,7 +35,7 @@ let active_procedure_checkers () = ImmutableChecker.callback_check_immutable_cast, checkers_enabled; RepeatedCallsChecker.callback_check_repeated_calls, checkers_enabled; PrintfArgs.callback_printf_args, checkers_enabled; - PerformanceCritical.callback_performance_checker, Config.report_expensive_calls; + PerformanceCritical.callback_performance_checker, checkers_enabled; ] in IList.map (fun (x, y) -> (x, y, Some Config.Java)) l in let c_cpp_checkers = diff --git a/infer/tests/codetoanalyze/java/checkers/BUCK b/infer/tests/codetoanalyze/java/checkers/BUCK index 8f58640b0..dc85ce926 100644 --- a/infer/tests/codetoanalyze/java/checkers/BUCK +++ b/infer/tests/codetoanalyze/java/checkers/BUCK @@ -18,8 +18,6 @@ java_library( out = 'out' clean_cmd = ' '.join(['rm', '-rf', out]) classpath = ':'.join([('$(classpath ' + path + ')') for path in dependencies]) -env_cmd = ' '.join(['export', 'INFER_REPORT_EXPENSIVE_CALLS=1']) -ondemand_mode = ' '.join(['export', 'INFER_ONDEMAND=1']) infer_cmd = ' '.join([ 'infer', '--no-progress-bar', @@ -32,7 +30,7 @@ infer_cmd = ' '.join([ '$SRCS', ]) copy_cmd = ' '.join(['cp', out + '/report.csv', '$OUT']) -command = ' && '.join([clean_cmd, ondemand_mode, env_cmd, infer_cmd, copy_cmd]) +command = ' && '.join([clean_cmd, infer_cmd, copy_cmd]) genrule( name = 'analyze',