[clang] Add the objc interface case to the function get_decl_from_typ_ptr

Reviewed By: akotulski

Differential Revision: D3995051

fbshipit-source-id: 0c26159
master
Dulma Churchill 8 years ago committed by Facebook Github Bot
parent 19969b7180
commit 2d97b5d111

@ -260,9 +260,9 @@ struct
let get_decl_from_typ_ptr typ_ptr =
let typ_opt = get_desugared_type typ_ptr in
let typ = match typ_opt with Some t -> t | _ -> assert false in
(* it needs extending to handle objC types *)
match typ with
| Clang_ast_t.RecordType (_, decl_ptr) -> get_decl decl_ptr
| Clang_ast_t.RecordType (_, decl_ptr)
| Clang_ast_t.ObjCInterfaceType (_, decl_ptr) -> get_decl decl_ptr
| _ -> None
(*TODO take the attributes into account too. To be done after we get the attribute's arguments. *)

@ -88,8 +88,8 @@ sig
See get_type for more info and restrictions *)
val get_desugared_type : Clang_ast_t.type_ptr -> Clang_ast_t.c_type option
(** returns declaration of the type for certain types and crashes for others
NOTE: this function needs extending to handle objC types *)
(** returns declaration of the type for certain types
(RecordType, ObjCInterfaceType and None for others *)
val get_decl_from_typ_ptr : Clang_ast_t.type_ptr -> Clang_ast_t.decl option
(** returns string representation of type_ptr

Loading…
Cancel
Save