From 7bd2cedb1dde4b106fb40d4e93c186b3ad9fe6f4 Mon Sep 17 00:00:00 2001 From: Martino Luca Date: Tue, 3 Oct 2017 08:11:54 -0700 Subject: [PATCH] [fcp] Add ooti_ prefix to objc_object_type_info type Summary: This is due to the changes in `facebook-clang-plugins` where objc_object_type_info now has a `field_prefix` set to `ooti_` See https://github.com/facebook/facebook-clang-plugins/commit/5f2042abe6cf15e2a17741259fa08c55bf61fb1b for the changes made to `facebook-clang-plugins` update-submodule: facebook-clang-plugins Reviewed By: jvillard Differential Revision: D5963064 fbshipit-source-id: 9705774 --- facebook-clang-plugins | 2 +- infer/src/clang/cPredicates.ml | 6 +++--- infer/src/clang/cType_to_sil_type.ml | 2 +- infer/src/clang/ctl_parser_types.ml | 9 ++++++--- 4 files changed, 11 insertions(+), 8 deletions(-) diff --git a/facebook-clang-plugins b/facebook-clang-plugins index a96c39601..5f2042abe 160000 --- a/facebook-clang-plugins +++ b/facebook-clang-plugins @@ -1 +1 @@ -Subproject commit a96c39601fb42c040161f5936107c92a38d83124 +Subproject commit 5f2042abe6cf15e2a17741259fa08c55bf61fb1b diff --git a/infer/src/clang/cPredicates.ml b/infer/src/clang/cPredicates.ml index bfd1f7a35..3dd1afc8a 100644 --- a/infer/src/clang/cPredicates.ml +++ b/infer/src/clang/cPredicates.ml @@ -647,12 +647,12 @@ let has_type_subprotocol_of an _prot_name = | Some ObjCObjectPointerType (_, qt) -> check_subprotocol (CAst_utils.get_type qt.qt_type_ptr) | Some ObjCObjectType (_, ooti) - -> if List.length ooti.protocol_decls_ptr > 0 then - check_protocol_hiearachy ooti.protocol_decls_ptr _prot_name + -> if List.length ooti.ooti_protocol_decls_ptr > 0 then + check_protocol_hiearachy ooti.ooti_protocol_decls_ptr _prot_name else List.exists ~f:(fun qt -> check_subprotocol (CAst_utils.get_type qt.qt_type_ptr)) - ooti.type_args + ooti.ooti_type_args | Some ObjCInterfaceType (_, pt) -> check_protocol_hiearachy [pt] _prot_name | _ diff --git a/infer/src/clang/cType_to_sil_type.ml b/infer/src/clang/cType_to_sil_type.ml index 87f0dd8bd..8b16366c1 100644 --- a/infer/src/clang/cType_to_sil_type.ml +++ b/infer/src/clang/cType_to_sil_type.ml @@ -115,7 +115,7 @@ and type_desc_of_c_type translate_decl tenv c_type : Typ.desc = if Typ.equal_desc desc (get_builtin_objc_type `ObjCClass) then desc else Typ.Tptr (typ, Typ.Pk_pointer) | ObjCObjectType (_, objc_object_type_info) - -> type_ptr_to_type_desc translate_decl tenv objc_object_type_info.Clang_ast_t.base_type + -> type_ptr_to_type_desc translate_decl tenv objc_object_type_info.Clang_ast_t.ooti_base_type | BlockPointerType (_, qual_type) -> let typ = qual_type_to_sil_type translate_decl tenv qual_type in Typ.Tptr (typ, Typ.Pk_pointer) diff --git a/infer/src/clang/ctl_parser_types.ml b/infer/src/clang/ctl_parser_types.ml index dd3d3b5e7..74f33aa36 100644 --- a/infer/src/clang/ctl_parser_types.ml +++ b/infer/src/clang/ctl_parser_types.ml @@ -415,11 +415,14 @@ and objc_object_type_equal c_type abs_ctype = in match (c_type, abs_ctype) with | ObjCObjectType (_, ooti), ObjCGenProt (base, args) -> ( - match (CAst_utils.get_type ooti.base_type, ooti.protocol_decls_ptr, ooti.type_args) with + match + (CAst_utils.get_type ooti.ooti_base_type, ooti.ooti_protocol_decls_ptr, ooti.ooti_type_args) + with | Some base_type, _ :: _, [] - -> c_type_equal base_type base && List.for_all ~f:(check_prot args) ooti.protocol_decls_ptr + -> c_type_equal base_type base + && List.for_all ~f:(check_prot args) ooti.ooti_protocol_decls_ptr | Some base_type, [], _ :: _ - -> c_type_equal base_type base && List.for_all ~f:(check_type_args args) ooti.type_args + -> c_type_equal base_type base && List.for_all ~f:(check_type_args args) ooti.ooti_type_args | _ -> false ) | _