[nullsafe][EASY] Log callee annotated signature when typechecking SIL call instruction

Summary:
This was needed countless of times. We log current signature, but not
callees.

Reviewed By: dulmarod

Differential Revision: D20765107

fbshipit-source-id: 399926c65
master
Mitya Lyubarskiy 5 years ago committed by Facebook GitHub Bot
parent 869ba0f966
commit d51a688a1b

@ -1027,6 +1027,7 @@ let calc_typestate_after_call find_canonical_duplicate calls_this checks tenv id
let typecheck_sil_call_function find_canonical_duplicate checks tenv instr_ref typestate idenv
~callee_pname ~curr_pname curr_pdesc curr_annotated_signature calls_this ~nullsafe_mode
ret_id_typ etl_ loc callee_pname_java cflags node =
L.d_with_indent ~name:"typecheck_sil_call_function" (fun () ->
let callee_attributes =
match PatternMatch.lookup_attributes tenv callee_pname with
| Some proc_attributes ->
@ -1054,8 +1055,8 @@ let typecheck_sil_call_function find_canonical_duplicate checks tenv instr_ref t
let etl = drop_unchecked_params calls_this curr_pname callee_attributes etl_ in
let call_params, typestate1 =
let handle_et (e1, t1) (etl1, typestate1) =
typecheck_expr_for_errors ~nullsafe_mode find_canonical_duplicate curr_pdesc calls_this checks
tenv node instr_ref typestate e1 loc ;
typecheck_expr_for_errors ~nullsafe_mode find_canonical_duplicate curr_pdesc calls_this
checks tenv node instr_ref typestate e1 loc ;
let e2 =
convert_complex_exp_to_pvar tenv idenv curr_pname curr_annotated_signature
~is_assignment:false ~node ~original_node:node e1 typestate1 loc
@ -1075,6 +1076,8 @@ let typecheck_sil_call_function find_canonical_duplicate checks tenv instr_ref t
let callee_annotated_signature =
Models.get_modelled_annotated_signature ~is_trusted_callee tenv callee_attributes
in
if Config.write_html then
L.d_printfln "Callee signature: %a" (AnnotatedSignature.pp pname) callee_annotated_signature ;
let signature_params =
drop_unchecked_signature_params callee_attributes callee_annotated_signature
in
@ -1089,10 +1092,11 @@ let typecheck_sil_call_function find_canonical_duplicate checks tenv instr_ref t
let typestate_after_call, finally_resolved_ret =
calc_typestate_after_call find_canonical_duplicate calls_this checks tenv idenv instr_ref
signature_params cflags call_params ~is_anonymous_inner_class_constructor
~callee_annotated_signature ~callee_attributes ~callee_pname ~callee_pname_java ~curr_pname
~curr_pdesc ~curr_annotated_signature ~nullsafe_mode ~typestate ~typestate1 loc node
~callee_annotated_signature ~callee_attributes ~callee_pname ~callee_pname_java
~curr_pname ~curr_pdesc ~curr_annotated_signature ~nullsafe_mode ~typestate ~typestate1
loc node
in
do_return finally_resolved_ret typestate_after_call
do_return finally_resolved_ret typestate_after_call )
(** Typecheck an instruction. *)

Loading…
Cancel
Save