@ -39,7 +39,7 @@ let fields_superclass tenv interface_decl_info =
[]
[]
let build_sil_field qual_type_to_sil_type tenv class_tname field _name qual_type prop_attributes =
let build_sil_field qual_type_to_sil_type tenv class_tname ni _name qual_type prop_attributes =
let prop_atts =
let prop_atts =
List . map
List . map
~ f : ( fun att -> Annot . { name = None ; value = Str ( Clang_ast_j . string_of_property_attribute att ) } )
~ f : ( fun att -> Annot . { name = None ; value = Str ( Clang_ast_j . string_of_property_attribute att ) } )
@ -54,7 +54,7 @@ let build_sil_field qual_type_to_sil_type tenv class_tname field_name qual_type
| _ ->
| _ ->
[]
[]
in
in
let fname = CGeneral_utils . mk_class_field_name class_tname field_name. Clang_ast_t . ni_name in
let fname = CGeneral_utils . mk_class_field_name class_tname ni_name in
let typ = qual_type_to_sil_type tenv qual_type in
let typ = qual_type_to_sil_type tenv qual_type in
let item_annotations =
let item_annotations =
match prop_atts with
match prop_atts with
@ -68,22 +68,23 @@ let build_sil_field qual_type_to_sil_type tenv class_tname field_name qual_type
(* Given a list of declarations in an interface returns a list of fields *)
(* Given a list of declarations in an interface returns a list of fields *)
let get_fields qual_type_to_sil_type tenv class_tname decl_list =
let get_fields ~ implements_remodel_class qual_type_to_sil_type tenv class_tname decl_list =
let open Clang_ast_t in
let open Clang_ast_t in
let get_sil_field n ame_info ( qt : qual_type ) property_attributes =
let get_sil_field n i_n ame ( qt : qual_type ) property_attributes =
build_sil_field qual_type_to_sil_type tenv class_tname n ame_info qt property_attributes
build_sil_field qual_type_to_sil_type tenv class_tname n i_n ame qt property_attributes
in
in
let rec get_field fields decl =
let rec get_field fields decl =
match decl with
match decl with
| ObjCPropertyDecl ( _ , name_info , { opdi_qual_type ; opdi_ivar_decl ; opdi_property_attributes } ) ->
| ObjCPropertyDecl ( _ , { ni_name } , { opdi_qual_type ; opdi_ivar_decl ; opdi_property_attributes } ) ->
let n ame_info , qual_type =
let n i_n ame, qual_type =
match CAst_utils . get_decl_opt_with_decl_ref_opt opdi_ivar_decl with
match CAst_utils . get_decl_opt_with_decl_ref_opt opdi_ivar_decl with
| Some ( ObjCIvarDecl ( _ , name_info , qual_type , _ , _ ) ) ->
| Some ( ObjCIvarDecl ( _ , { ni_name } , qual_type , _ , _ ) ) ->
( n ame_info , qual_type )
( n i_n ame, qual_type )
| _ ->
| _ ->
( name_info , opdi_qual_type )
let ni_name = if implements_remodel_class then " _ " ^ ni_name else ni_name in
( ni_name , opdi_qual_type )
in
in
let field = get_sil_field n ame_info qual_type opdi_property_attributes in
let field = get_sil_field n i_n ame qual_type opdi_property_attributes in
CGeneral_utils . add_no_duplicates_fields field fields
CGeneral_utils . add_no_duplicates_fields field fields
| ObjCPropertyImplDecl ( _ , obj_c_property_impl_decl_info ) -> (
| ObjCPropertyImplDecl ( _ , obj_c_property_impl_decl_info ) -> (
let property_decl_opt = obj_c_property_impl_decl_info . Clang_ast_t . opidi_property_decl in
let property_decl_opt = obj_c_property_impl_decl_info . Clang_ast_t . opidi_property_decl in
@ -92,8 +93,8 @@ let get_fields qual_type_to_sil_type tenv class_tname decl_list =
get_field fields decl
get_field fields decl
| None ->
| None ->
fields )
fields )
| ObjCIvarDecl ( _ , name_info , qual_type , _ , _ ) ->
| ObjCIvarDecl ( _ , { ni_name } , qual_type , _ , _ ) ->
let field = get_sil_field n ame_info qual_type [] in
let field = get_sil_field n i_n ame qual_type [] in
CGeneral_utils . add_no_duplicates_fields field fields
CGeneral_utils . add_no_duplicates_fields field fields
| _ ->
| _ ->
fields
fields