From a28ccbb180fce281ca4ce00f9420c29e6b305a44 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ezgi=20=C3=87i=C3=A7ek?= Date: Fri, 17 Jan 2020 06:57:57 -0800 Subject: [PATCH] [purity] Add pure frontend functions Reviewed By: ngorogiannis Differential Revision: D19428097 fbshipit-source-id: d91502039 --- infer/src/checkers/purityModels.ml | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/infer/src/checkers/purityModels.ml b/infer/src/checkers/purityModels.ml index ac55c4276..569a6830a 100644 --- a/infer/src/checkers/purityModels.ml +++ b/infer/src/checkers/purityModels.ml @@ -9,15 +9,19 @@ open! IStd module BuiltinPureMethods = Caml.Set.Make (String) let pure_builtins = - BuiltinPureMethods.of_list - [ "__instanceof" - ; "__cast" - ; "__get_array_length" - ; "__set_array_length" - ; "__get_type_of" - ; "__infer_assume" - ; "__infer_skip" - ; "__infer_fail" ] + List.map ~f:Procname.get_method + [ BuiltinDecl.__instanceof + ; BuiltinDecl.__cast + ; BuiltinDecl.__get_array_length + ; BuiltinDecl.__set_array_length + ; BuiltinDecl.__get_type_of + ; BuiltinDecl.__infer_assume + ; BuiltinDecl.__infer_skip + ; BuiltinDecl.__infer_skip_gcc_asm_stmt + ; BuiltinDecl.__infer_generic_selection_expr + ; BuiltinDecl.__infer_skip_function + ; BuiltinDecl.__infer_fail ] + |> BuiltinPureMethods.of_list let modifies_first = PurityDomain.impure_params (PurityDomain.ModifiedParamIndices.of_list [0])