From 78a865b14e6868b85cb62bc348e04224e5dd465d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ezgi=20=C3=87i=C3=A7ek?= Date: Sun, 14 Oct 2018 14:58:14 -0700 Subject: [PATCH] [hosting] Disable purity and cost callbacks temporarily Reviewed By: mbouaziz Differential Revision: D10356668 fbshipit-source-id: a04c329c9 --- infer/src/checkers/registerCheckers.ml | 16 ++++++++++------ infer/tests/codetoanalyze/java/hoisting/Makefile | 2 +- .../tests/codetoanalyze/java/hoisting/issues.exp | 2 -- .../java/hoistingExpensive/Makefile | 2 +- 4 files changed, 12 insertions(+), 10 deletions(-) diff --git a/infer/src/checkers/registerCheckers.ml b/infer/src/checkers/registerCheckers.ml index c7583f711..4ed78d970 100644 --- a/infer/src/checkers/registerCheckers.ml +++ b/infer/src/checkers/registerCheckers.ml @@ -109,12 +109,16 @@ let all_checkers = ; { name= "loop hoisting" ; active= Config.loop_hoisting ; callbacks= - [ (Procedure Hoisting.checker, Language.Clang) - ; (Procedure Hoisting.checker, Language.Java) - ; (Procedure Cost.checker, Language.Clang) - ; (Procedure Cost.checker, Language.Java) - ; (Procedure Purity.checker, Language.Clang) - ; (Procedure Purity.checker, Language.Java) ] } + ( (Procedure Hoisting.checker, Language.Clang) + :: (Procedure Hoisting.checker, Language.Java) + :: + ( if Config.hoisting_report_only_expensive then + [(Procedure Cost.checker, Language.Clang); (Procedure Cost.checker, Language.Java)] + else [] ) + @ + if Config.purity then + [(Procedure Purity.checker, Language.Clang); (Procedure Purity.checker, Language.Java)] + else [] ) } ; { name= "Starvation analysis" ; active= Config.starvation ; callbacks= diff --git a/infer/tests/codetoanalyze/java/hoisting/Makefile b/infer/tests/codetoanalyze/java/hoisting/Makefile index 7c8504d02..4c01c4304 100644 --- a/infer/tests/codetoanalyze/java/hoisting/Makefile +++ b/infer/tests/codetoanalyze/java/hoisting/Makefile @@ -5,7 +5,7 @@ TESTS_DIR = ../../.. -INFER_OPTIONS = --loop-hoisting-only --invariant-by-default --debug-exceptions +INFER_OPTIONS = --loop-hoisting-only --purity --debug-exceptions INFERPRINT_OPTIONS = --issues-tests SOURCES = $(wildcard *.java) diff --git a/infer/tests/codetoanalyze/java/hoisting/issues.exp b/infer/tests/codetoanalyze/java/hoisting/issues.exp index 4a648bc61..421a23f62 100644 --- a/infer/tests/codetoanalyze/java/hoisting/issues.exp +++ b/infer/tests/codetoanalyze/java/hoisting/issues.exp @@ -8,10 +8,8 @@ codetoanalyze/java/hoisting/Hoist.java, Hoist.foo(int,int):int, 0, PURE_FUNCTION codetoanalyze/java/hoisting/Hoist.java, Hoist.legit_hoist(int,int[]):void, 5, INVARIANT_CALL, no_bucket, ERROR, [Loop-invariant call to int Hoist.foo(int,int) at line 73] codetoanalyze/java/hoisting/Hoist.java, Hoist.loop_guard_hoist(int,int[]):void, 0, PURE_FUNCTION, no_bucket, ERROR, [Side-effect free function void Hoist.loop_guard_hoist(int,int[])] codetoanalyze/java/hoisting/Hoist.java, Hoist.loop_guard_hoist(int,int[]):void, 4, INVARIANT_CALL, no_bucket, ERROR, [Loop-invariant call to int Hoist.foo(int,int) at line 65] -codetoanalyze/java/hoisting/Hoist.java, Hoist.nested_loop_dont_hoist(int,int,int):void, 0, INFINITE_EXECUTION_TIME_CALL, no_bucket, ERROR, [] codetoanalyze/java/hoisting/Hoist.java, Hoist.nested_loop_dont_hoist(int,int,int):void, 0, PURE_FUNCTION, no_bucket, ERROR, [Side-effect free function void Hoist.nested_loop_dont_hoist(int,int,int)] codetoanalyze/java/hoisting/Hoist.java, Hoist.nested_loop_hoist(int,int,int):void, 0, PURE_FUNCTION, no_bucket, ERROR, [Side-effect free function void Hoist.nested_loop_hoist(int,int,int)] -codetoanalyze/java/hoisting/Hoist.java, Hoist.nested_loop_hoist(int,int,int):void, 4, CONDITION_ALWAYS_FALSE, no_bucket, WARNING, [] codetoanalyze/java/hoisting/Hoist.java, Hoist.nested_loop_hoist(int,int,int):void, 5, INVARIANT_CALL, no_bucket, ERROR, [Loop-invariant call to int Hoist.foo(int,int) at line 127] codetoanalyze/java/hoisting/Hoist.java, Hoist.not_guaranteed_to_execute_dont_hoist(int,int,int):void, 0, PURE_FUNCTION, no_bucket, ERROR, [Side-effect free function void Hoist.not_guaranteed_to_execute_dont_hoist(int,int,int)] codetoanalyze/java/hoisting/Hoist.java, Hoist.reassigned_temp_hoist(int):void, 0, PURE_FUNCTION, no_bucket, ERROR, [Side-effect free function void Hoist.reassigned_temp_hoist(int)] diff --git a/infer/tests/codetoanalyze/java/hoistingExpensive/Makefile b/infer/tests/codetoanalyze/java/hoistingExpensive/Makefile index 163c12d6f..c6275de05 100644 --- a/infer/tests/codetoanalyze/java/hoistingExpensive/Makefile +++ b/infer/tests/codetoanalyze/java/hoistingExpensive/Makefile @@ -5,7 +5,7 @@ TESTS_DIR = ../../.. -INFER_OPTIONS = --loop-hoisting-only --hoisting-report-only-expensive --invariant-by-default --debug-exceptions +INFER_OPTIONS = --loop-hoisting-only --purity --hoisting-report-only-expensive --debug-exceptions INFERPRINT_OPTIONS = --issues-tests SOURCES = $(wildcard *.java)