[IR] remove dead no_return CallFlag

Summary:
This was never set to true except in a wrong way in the Java frontend
(see previous diff).

Reviewed By: dulmarod

Differential Revision: D18573927

fbshipit-source-id: 4c9d1a855
master
Jules Villard 5 years ago committed by Facebook Github Bot
parent f778134088
commit 997948914f

@ -17,7 +17,6 @@ type t =
; cf_injected_destructor: bool ; cf_injected_destructor: bool
; cf_interface: bool ; cf_interface: bool
; cf_is_objc_block: bool ; cf_is_objc_block: bool
; cf_noreturn: bool
; cf_virtual: bool ; cf_virtual: bool
; cf_with_block_parameters: bool } ; cf_with_block_parameters: bool }
[@@deriving compare] [@@deriving compare]
@ -27,14 +26,12 @@ let pp f
; cf_injected_destructor ; cf_injected_destructor
; cf_interface ; cf_interface
; cf_is_objc_block ; cf_is_objc_block
; cf_noreturn
; cf_with_block_parameters ; cf_with_block_parameters
; cf_virtual }[@warning "+9"]) = ; cf_virtual }[@warning "+9"]) =
if cf_assign_last_arg then F.pp_print_string f " assign_last" ; if cf_assign_last_arg then F.pp_print_string f " assign_last" ;
if cf_injected_destructor then F.pp_print_string f " injected" ; if cf_injected_destructor then F.pp_print_string f " injected" ;
if cf_interface then F.pp_print_string f " interface" ; if cf_interface then F.pp_print_string f " interface" ;
if cf_is_objc_block then F.pp_print_string f " objc_block" ; if cf_is_objc_block then F.pp_print_string f " objc_block" ;
if cf_noreturn then F.pp_print_string f " noreturn" ;
if cf_with_block_parameters then F.pp_print_string f " block_params" ; if cf_with_block_parameters then F.pp_print_string f " block_params" ;
if cf_virtual then F.pp_print_string f " virtual" ; if cf_virtual then F.pp_print_string f " virtual" ;
() ()
@ -45,6 +42,5 @@ let default =
; cf_injected_destructor= false ; cf_injected_destructor= false
; cf_interface= false ; cf_interface= false
; cf_is_objc_block= false ; cf_is_objc_block= false
; cf_noreturn= false
; cf_with_block_parameters= false ; cf_with_block_parameters= false
; cf_virtual= false } ; cf_virtual= false }

@ -18,7 +18,6 @@ type t =
(** true if this is an implicit C++ destructor call injected by the clang frontend *) (** true if this is an implicit C++ destructor call injected by the clang frontend *)
; cf_interface: bool ; cf_interface: bool
; cf_is_objc_block: bool ; cf_is_objc_block: bool
; cf_noreturn: bool
; cf_virtual: bool ; cf_virtual: bool
; cf_with_block_parameters: bool } ; cf_with_block_parameters: bool }
[@@deriving compare] [@@deriving compare]

@ -217,8 +217,6 @@ module NoReturn = struct
Procdesc.Node.get_instrs node Procdesc.Node.get_instrs node
|> Instrs.exists ~f:(fun (instr : Sil.instr) -> |> Instrs.exists ~f:(fun (instr : Sil.instr) ->
match instr with match instr with
| Call (_, _, _, _, {cf_noreturn= true}) ->
true
| Call (_, Const (Cfun proc_name), _, _, _) -> ( | Call (_, Const (Cfun proc_name), _, _, _) -> (
match Attributes.load proc_name with match Attributes.load proc_name with
| Some {ProcAttributes.is_no_return= true} -> | Some {ProcAttributes.is_no_return= true} ->

@ -1476,12 +1476,6 @@ let rec sym_exec exe_env tenv current_summary instr_ (prop_ : Prop.normal Prop.t
&& not (Rearrange.is_only_pt_by_fld_or_param_nonnull current_pdesc tenv prop_r fun_exp) && not (Rearrange.is_only_pt_by_fld_or_param_nonnull current_pdesc tenv prop_r fun_exp)
then Rearrange.check_call_to_objc_block_error tenv current_pdesc prop_r fun_exp loc ; then Rearrange.check_call_to_objc_block_error tenv current_pdesc prop_r fun_exp loc ;
Rearrange.check_dereference_error tenv current_pdesc prop_r fun_exp loc ; Rearrange.check_dereference_error tenv current_pdesc prop_r fun_exp loc ;
if call_flags.CallFlags.cf_noreturn then (
L.d_str "Unknown function pointer with noreturn attribute " ;
Sil.d_exp fun_exp ;
L.d_strln ", diverging." ;
diverge prop_r path )
else (
L.d_str "Unknown function pointer " ; L.d_str "Unknown function pointer " ;
Sil.d_exp fun_exp ; Sil.d_exp fun_exp ;
L.d_strln ", returning undefined value." ; L.d_strln ", returning undefined value." ;
@ -1498,7 +1492,7 @@ let rec sym_exec exe_env tenv current_summary instr_ (prop_ : Prop.normal Prop.t
; args= n_actual_params ; args= n_actual_params
; proc_name= callee_pname ; proc_name= callee_pname
; loc ; loc
; exe_env } ) ; exe_env }
| Sil.Metadata (Nullify (pvar, _)) -> ( | Sil.Metadata (Nullify (pvar, _)) -> (
let eprop = Prop.expose prop_ in let eprop = Prop.expose prop_ in
match match

@ -110,7 +110,7 @@ module PulseTransferFunctions = struct
let model = let model =
match proc_name_of_call call_exp with match proc_name_of_call call_exp with
| Some callee_pname -> | Some callee_pname ->
PulseModels.dispatch tenv callee_pname flags PulseModels.dispatch tenv callee_pname
| None -> | None ->
(* function pointer, etc.: skip for now *) (* function pointer, etc.: skip for now *)
None None

@ -296,13 +296,9 @@ let builtins_dispatcher =
fun proc_name -> Hashtbl.find builtins_map proc_name fun proc_name -> Hashtbl.find builtins_map proc_name
let dispatch tenv proc_name flags = let dispatch tenv proc_name =
match builtins_dispatcher proc_name with match builtins_dispatcher proc_name with
| Some _ as result ->
result
| None -> (
match ProcNameDispatcher.dispatch tenv proc_name with
| Some _ as result -> | Some _ as result ->
result result
| None -> | None ->
if flags.CallFlags.cf_noreturn then Some Misc.early_exit else None ) ProcNameDispatcher.dispatch tenv proc_name

@ -17,4 +17,4 @@ type exec_fun =
type model = exec_fun type model = exec_fun
val dispatch : Tenv.t -> Typ.Procname.t -> CallFlags.t -> model option val dispatch : Tenv.t -> Typ.Procname.t -> model option

Loading…
Cancel
Save