[models] Use return type for ObjC models

Summary:
Change implementation of NSArray and NSDictionary model builtins to use
the method return type instead of magicking up types from strings.

Reviewed By: jvillard

Differential Revision: D3919815

fbshipit-source-id: f07a993
master
Josh Berdine 8 years ago committed by Facebook Github Bot 7
parent c094a38d56
commit 67a883e1a2

@ -1165,8 +1165,11 @@ let arrayWithObjects_pname = mk_objc_class_method "NSArray" "arrayWithObjects:"
let arrayWithObjectsCount_pname = mk_objc_class_method "NSArray" "arrayWithObjects:count:" let arrayWithObjectsCount_pname = mk_objc_class_method "NSArray" "arrayWithObjects:count:"
let execute_objc_NSArray_alloc_no_fail builtin_args symb_state pname = let execute_objc_NSArray_alloc_no_fail builtin_args symb_state pname =
let nsarray_typ = Typ.Tstruct (TN_csu (Class Objc, Mangled.from_string "NSArray")) in let ret_typ =
execute_objc_alloc_no_fail symb_state nsarray_typ (Some pname) builtin_args match builtin_args.Builtin.ret_id with
| Some (_, typ) -> typ
| None -> Typ.Tptr (Tvoid, Pk_pointer) in
execute_objc_alloc_no_fail symb_state ret_typ (Some pname) builtin_args
let execute_NSArray_arrayWithObjects_count builtin_args = let execute_NSArray_arrayWithObjects_count builtin_args =
let n_formals = 1 in let n_formals = 1 in
@ -1185,8 +1188,11 @@ let _ =
(* NSDictionary models *) (* NSDictionary models *)
let execute_objc_NSDictionary_alloc_no_fail symb_state pname builtin_args = let execute_objc_NSDictionary_alloc_no_fail symb_state pname builtin_args =
let nsdictionary_typ = Typ.Tstruct (TN_csu (Class Objc, Mangled.from_string "NSDictionary")) in let ret_typ =
execute_objc_alloc_no_fail symb_state nsdictionary_typ (Some pname) builtin_args match builtin_args.Builtin.ret_id with
| Some (_, typ) -> typ
| None -> Typ.Tptr (Tvoid, Pk_pointer) in
execute_objc_alloc_no_fail symb_state ret_typ (Some pname) builtin_args
let __objc_dictionary_literal_pname = let __objc_dictionary_literal_pname =
mk_objc_class_method "NSDictionary" "dictionaryWithObjects:forKeys:count:" mk_objc_class_method "NSDictionary" "dictionaryWithObjects:forKeys:count:"

Loading…
Cancel
Save