|
|
@ -2566,34 +2566,40 @@ module CTrans_funct (F : CModule_type.CFrontend) : CModule_type.CTranslation = s
|
|
|
|
instruction trans_state message_stmt
|
|
|
|
instruction trans_state message_stmt
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
and objCArrayLiteral_trans trans_state info stmt_info stmts =
|
|
|
|
and objCArrayDictLiteral_trans trans_state expr_info stmt_info stmts method_pointer =
|
|
|
|
|
|
|
|
let open Clang_ast_t in
|
|
|
|
|
|
|
|
match CAst_utils.get_decl_opt method_pointer with
|
|
|
|
|
|
|
|
| Some (ObjCMethodDecl (decl_info, named_decl_info, _)) ->
|
|
|
|
let typ =
|
|
|
|
let typ =
|
|
|
|
CType_decl.class_from_pointer_type trans_state.context.CContext.tenv
|
|
|
|
CAst_utils.qual_type_of_decl_ptr (Option.value_exn decl_info.di_parent_pointer)
|
|
|
|
info.Clang_ast_t.ei_qual_type
|
|
|
|
in
|
|
|
|
|
|
|
|
let obj_c_mes_expr_info =
|
|
|
|
|
|
|
|
{ Clang_ast_t.omei_selector= named_decl_info.Clang_ast_t.ni_name
|
|
|
|
|
|
|
|
; omei_receiver_kind= `Class typ
|
|
|
|
|
|
|
|
; omei_is_definition_found= true
|
|
|
|
|
|
|
|
; omei_decl_pointer= method_pointer }
|
|
|
|
|
|
|
|
in
|
|
|
|
|
|
|
|
let message_stmt =
|
|
|
|
|
|
|
|
Clang_ast_t.ObjCMessageExpr (stmt_info, stmts, expr_info, obj_c_mes_expr_info)
|
|
|
|
in
|
|
|
|
in
|
|
|
|
let meth = CFrontend_config.array_with_objects_count_m in
|
|
|
|
|
|
|
|
let obj_c_mes_expr_info = Ast_expressions.make_obj_c_message_expr_info_class meth typ None in
|
|
|
|
|
|
|
|
let stmts = stmts @ [Ast_expressions.create_nil stmt_info] in
|
|
|
|
|
|
|
|
let message_stmt = Clang_ast_t.ObjCMessageExpr (stmt_info, stmts, info, obj_c_mes_expr_info) in
|
|
|
|
|
|
|
|
instruction trans_state message_stmt
|
|
|
|
instruction trans_state message_stmt
|
|
|
|
|
|
|
|
| _ ->
|
|
|
|
|
|
|
|
Logging.die InternalError
|
|
|
|
|
|
|
|
"The method for translating array/dictionary literals is not available at %s"
|
|
|
|
|
|
|
|
(Clang_ast_j.string_of_stmt_info stmt_info)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
and objCDictionaryLiteral_trans trans_state info stmt_info stmts =
|
|
|
|
and objCArrayLiteral_trans trans_state expr_info stmt_info stmts array_literal_info =
|
|
|
|
let typ =
|
|
|
|
let method_pointer = array_literal_info.Clang_ast_t.oalei_array_method in
|
|
|
|
CType_decl.class_from_pointer_type trans_state.context.CContext.tenv
|
|
|
|
let stmts = stmts @ [Ast_expressions.create_nil stmt_info] in
|
|
|
|
info.Clang_ast_t.ei_qual_type
|
|
|
|
objCArrayDictLiteral_trans trans_state expr_info stmt_info stmts method_pointer
|
|
|
|
in
|
|
|
|
|
|
|
|
let dictionary_literal_pname = BuiltinDecl.__objc_dictionary_literal in
|
|
|
|
|
|
|
|
let dictionary_literal_s = Typ.Procname.get_method dictionary_literal_pname in
|
|
|
|
and objCDictionaryLiteral_trans trans_state expr_info stmt_info stmts dict_literal_info =
|
|
|
|
let obj_c_message_expr_info =
|
|
|
|
let method_pointer = dict_literal_info.Clang_ast_t.odlei_dict_method in
|
|
|
|
Ast_expressions.make_obj_c_message_expr_info_class dictionary_literal_s typ None
|
|
|
|
|
|
|
|
in
|
|
|
|
|
|
|
|
let stmts = CGeneral_utils.swap_elements_list stmts in
|
|
|
|
let stmts = CGeneral_utils.swap_elements_list stmts in
|
|
|
|
let stmts = stmts @ [Ast_expressions.create_nil stmt_info] in
|
|
|
|
let stmts = stmts @ [Ast_expressions.create_nil stmt_info] in
|
|
|
|
let message_stmt =
|
|
|
|
objCArrayDictLiteral_trans trans_state expr_info stmt_info stmts method_pointer
|
|
|
|
Clang_ast_t.ObjCMessageExpr (stmt_info, stmts, info, obj_c_message_expr_info)
|
|
|
|
|
|
|
|
in
|
|
|
|
|
|
|
|
instruction trans_state message_stmt
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
and objCStringLiteral_trans trans_state stmt_info stmts info =
|
|
|
|
and objCStringLiteral_trans trans_state stmt_info stmts info =
|
|
|
@ -3283,10 +3289,10 @@ module CTrans_funct (F : CModule_type.CFrontend) : CModule_type.CTranslation = s
|
|
|
|
objCBoxedExpr_trans trans_state info sel stmt_info stmts
|
|
|
|
objCBoxedExpr_trans trans_state info sel stmt_info stmts
|
|
|
|
| None ->
|
|
|
|
| None ->
|
|
|
|
assert false )
|
|
|
|
assert false )
|
|
|
|
| ObjCArrayLiteral (stmt_info, stmts, info) ->
|
|
|
|
| ObjCArrayLiteral (stmt_info, stmts, expr_info, array_literal_info) ->
|
|
|
|
objCArrayLiteral_trans trans_state info stmt_info stmts
|
|
|
|
objCArrayLiteral_trans trans_state expr_info stmt_info stmts array_literal_info
|
|
|
|
| ObjCDictionaryLiteral (stmt_info, stmts, info) ->
|
|
|
|
| ObjCDictionaryLiteral (stmt_info, stmts, expr_info, dict_literal_info) ->
|
|
|
|
objCDictionaryLiteral_trans trans_state info stmt_info stmts
|
|
|
|
objCDictionaryLiteral_trans trans_state expr_info stmt_info stmts dict_literal_info
|
|
|
|
| ObjCStringLiteral (stmt_info, stmts, info) ->
|
|
|
|
| ObjCStringLiteral (stmt_info, stmts, info) ->
|
|
|
|
objCStringLiteral_trans trans_state stmt_info stmts info
|
|
|
|
objCStringLiteral_trans trans_state stmt_info stmts info
|
|
|
|
| BreakStmt (stmt_info, _) ->
|
|
|
|
| BreakStmt (stmt_info, _) ->
|
|
|
|