[SIL][1/3] delete never produced cf_targets CallFlag

Summary:
Nothing was ever writing to this field.

youarealreadydead

Reviewed By: mbouaziz

Differential Revision: D14324761

fbshipit-source-id: a27bac2a4
master
Jules Villard 6 years ago committed by Facebook Github Bot
parent 3f8dc91b2a
commit be61022bff

@ -18,7 +18,6 @@ type t =
; cf_assign_last_arg: bool
; cf_noreturn: bool
; cf_is_objc_block: bool
; cf_targets: Typ.Procname.t list
; cf_with_block_parameters: bool }
[@@deriving compare]
@ -35,5 +34,4 @@ let default =
; cf_assign_last_arg= false
; cf_noreturn= false
; cf_is_objc_block= false
; cf_with_block_parameters= false
; cf_targets= [] }
; cf_with_block_parameters= false }

@ -18,7 +18,6 @@ type t =
; cf_assign_last_arg: bool
; cf_noreturn: bool
; cf_is_objc_block: bool
; cf_targets: Typ.Procname.t list
; cf_with_block_parameters: bool }
[@@deriving compare]

@ -603,24 +603,13 @@ let resolve_virtual_pname tenv prop actuals callee_pname call_flags : Typ.Procna
| _ when not (call_flags.CallFlags.cf_virtual || call_flags.CallFlags.cf_interface) ->
(* if this is not a virtual or interface call, there's no need for resolution *)
[callee_pname]
| (receiver_exp, actual_receiver_typ) :: _ -> (
| (receiver_exp, actual_receiver_typ) :: _ ->
if !Language.curr_language <> Language.Java then
(* default mode for Obj-C/C++/Java virtual calls: resolution only *)
[do_resolve callee_pname receiver_exp actual_receiver_typ]
else
let resolved_target = do_resolve callee_pname receiver_exp actual_receiver_typ in
match call_flags.CallFlags.cf_targets with
| target :: _
when call_flags.CallFlags.cf_interface
&& receiver_types_equal callee_pname actual_receiver_typ
&& Typ.Procname.equal resolved_target callee_pname ->
(* "production mode" of dynamic dispatch for Java: unsound, but faster. the handling
is restricted to interfaces: if we can't resolve an interface call, we pick the
first implementation of the interface and call it *)
[target]
| _ ->
(* default mode for Java virtual calls: resolution only *)
[resolved_target] )
[resolved_target]
| _ ->
L.(die InternalError) "A virtual call must have a receiver"

Loading…
Cancel
Save