|
|
@ -1838,7 +1838,7 @@ struct
|
|
|
|
| _ -> assert false
|
|
|
|
| _ -> assert false
|
|
|
|
|
|
|
|
|
|
|
|
(* Cast expression are treated the same apart from the cast operation kind*)
|
|
|
|
(* Cast expression are treated the same apart from the cast operation kind*)
|
|
|
|
and cast_exprs_trans trans_state stmt_info stmt_list expr_info cast_expr_info is_objc_bridged =
|
|
|
|
and cast_exprs_trans trans_state stmt_info stmt_list expr_info cast_expr_info =
|
|
|
|
let context = trans_state.context in
|
|
|
|
let context = trans_state.context in
|
|
|
|
Printing.log_out " priority node free = '%s'\n@."
|
|
|
|
Printing.log_out " priority node free = '%s'\n@."
|
|
|
|
(string_of_bool (PriorityNode.is_priority_free trans_state));
|
|
|
|
(string_of_bool (PriorityNode.is_priority_free trans_state));
|
|
|
@ -1850,8 +1850,11 @@ struct
|
|
|
|
CTypes_decl.type_ptr_to_sil_type context.CContext.tenv expr_info.Clang_ast_t.ei_type_ptr in
|
|
|
|
CTypes_decl.type_ptr_to_sil_type context.CContext.tenv expr_info.Clang_ast_t.ei_type_ptr in
|
|
|
|
let cast_kind = cast_expr_info.Clang_ast_t.cei_cast_kind in
|
|
|
|
let cast_kind = cast_expr_info.Clang_ast_t.cei_cast_kind in
|
|
|
|
(* This gives the differnece among cast operations kind*)
|
|
|
|
(* This gives the differnece among cast operations kind*)
|
|
|
|
|
|
|
|
let is_objc_bridged_cast_expr _ stmt =
|
|
|
|
|
|
|
|
match stmt with | Clang_ast_t.ObjCBridgedCastExpr _ -> true | _ -> false in
|
|
|
|
|
|
|
|
let is_objc_bridged = Ast_utils.exists_eventually_st is_objc_bridged_cast_expr () stmt in
|
|
|
|
let cast_ids, cast_inst, cast_exp =
|
|
|
|
let cast_ids, cast_inst, cast_exp =
|
|
|
|
cast_operation context cast_kind res_trans_stmt.exps typ sil_loc is_objc_bridged in
|
|
|
|
cast_operation trans_state cast_kind res_trans_stmt.exps typ sil_loc is_objc_bridged in
|
|
|
|
{ res_trans_stmt with
|
|
|
|
{ res_trans_stmt with
|
|
|
|
ids = res_trans_stmt.ids @ cast_ids;
|
|
|
|
ids = res_trans_stmt.ids @ cast_ids;
|
|
|
|
instrs = res_trans_stmt.instrs @ cast_inst;
|
|
|
|
instrs = res_trans_stmt.instrs @ cast_inst;
|
|
|
@ -2329,6 +2332,13 @@ struct
|
|
|
|
"CXXStdInitializerListExpr" stmt_info all_res_trans in
|
|
|
|
"CXXStdInitializerListExpr" stmt_info all_res_trans in
|
|
|
|
{ res_trans_to_parent with exps = res_trans_call.exps }
|
|
|
|
{ res_trans_to_parent with exps = res_trans_call.exps }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
and objCBridgedCastExpr_trans trans_state stmts expr_info =
|
|
|
|
|
|
|
|
let stmt = extract_stmt_from_singleton stmts "" in
|
|
|
|
|
|
|
|
let tenv = trans_state.context.CContext.tenv in
|
|
|
|
|
|
|
|
let typ = CTypes_decl.get_type_from_expr_info expr_info tenv in
|
|
|
|
|
|
|
|
let trans_state' = { trans_state with obj_bridged_cast_typ = Some typ } in
|
|
|
|
|
|
|
|
instruction trans_state' stmt
|
|
|
|
|
|
|
|
|
|
|
|
(* Translates a clang instruction into SIL instructions. It takes a *)
|
|
|
|
(* Translates a clang instruction into SIL instructions. It takes a *)
|
|
|
|
(* a trans_state containing current info on the translation and it returns *)
|
|
|
|
(* a trans_state containing current info on the translation and it returns *)
|
|
|
|
(* a result_state.*)
|
|
|
|
(* a result_state.*)
|
|
|
@ -2439,15 +2449,16 @@ struct
|
|
|
|
| UnaryExprOrTypeTraitExpr(_, _, expr_info, ei) ->
|
|
|
|
| UnaryExprOrTypeTraitExpr(_, _, expr_info, ei) ->
|
|
|
|
unaryExprOrTypeTraitExpr_trans trans_state expr_info ei
|
|
|
|
unaryExprOrTypeTraitExpr_trans trans_state expr_info ei
|
|
|
|
|
|
|
|
|
|
|
|
| ObjCBridgedCastExpr(stmt_info, stmt_list, expr_info, cast_kind, _) ->
|
|
|
|
| ObjCBridgedCastExpr(_, stmt_list, expr_info, _, _) ->
|
|
|
|
cast_exprs_trans trans_state stmt_info stmt_list expr_info cast_kind true
|
|
|
|
objCBridgedCastExpr_trans trans_state stmt_list expr_info
|
|
|
|
|
|
|
|
|
|
|
|
| ImplicitCastExpr(stmt_info, stmt_list, expr_info, cast_kind)
|
|
|
|
| ImplicitCastExpr(stmt_info, stmt_list, expr_info, cast_kind)
|
|
|
|
| CStyleCastExpr(stmt_info, stmt_list, expr_info, cast_kind, _)
|
|
|
|
| CStyleCastExpr(stmt_info, stmt_list, expr_info, cast_kind, _)
|
|
|
|
| CXXReinterpretCastExpr(stmt_info, stmt_list, expr_info, cast_kind, _, _)
|
|
|
|
| CXXReinterpretCastExpr(stmt_info, stmt_list, expr_info, cast_kind, _, _)
|
|
|
|
| CXXConstCastExpr(stmt_info, stmt_list, expr_info, cast_kind, _, _)
|
|
|
|
| CXXConstCastExpr(stmt_info, stmt_list, expr_info, cast_kind, _, _)
|
|
|
|
| CXXStaticCastExpr(stmt_info, stmt_list, expr_info, cast_kind, _, _)
|
|
|
|
| CXXStaticCastExpr(stmt_info, stmt_list, expr_info, cast_kind, _, _)
|
|
|
|
| CXXFunctionalCastExpr(stmt_info, stmt_list, expr_info, cast_kind, _)->
|
|
|
|
| CXXFunctionalCastExpr(stmt_info, stmt_list, expr_info, cast_kind, _)->
|
|
|
|
cast_exprs_trans trans_state stmt_info stmt_list expr_info cast_kind false
|
|
|
|
cast_exprs_trans trans_state stmt_info stmt_list expr_info cast_kind
|
|
|
|
|
|
|
|
|
|
|
|
| IntegerLiteral(_, _, expr_info, integer_literal_info) ->
|
|
|
|
| IntegerLiteral(_, _, expr_info, integer_literal_info) ->
|
|
|
|
integerLiteral_trans trans_state expr_info integer_literal_info
|
|
|
|
integerLiteral_trans trans_state expr_info integer_literal_info
|
|
|
@ -2686,6 +2697,7 @@ struct
|
|
|
|
priority = Free;
|
|
|
|
priority = Free;
|
|
|
|
var_exp_typ = None;
|
|
|
|
var_exp_typ = None;
|
|
|
|
opaque_exp = None;
|
|
|
|
opaque_exp = None;
|
|
|
|
|
|
|
|
obj_bridged_cast_typ = None;
|
|
|
|
} in
|
|
|
|
} in
|
|
|
|
let res_trans_stmt = instruction trans_state stmt in
|
|
|
|
let res_trans_stmt = instruction trans_state stmt in
|
|
|
|
fst (CTrans_utils.extract_exp_from_list res_trans_stmt.exps warning)
|
|
|
|
fst (CTrans_utils.extract_exp_from_list res_trans_stmt.exps warning)
|
|
|
@ -2698,6 +2710,7 @@ struct
|
|
|
|
priority = Free;
|
|
|
|
priority = Free;
|
|
|
|
var_exp_typ = None;
|
|
|
|
var_exp_typ = None;
|
|
|
|
opaque_exp = None;
|
|
|
|
opaque_exp = None;
|
|
|
|
|
|
|
|
obj_bridged_cast_typ = None
|
|
|
|
} in
|
|
|
|
} in
|
|
|
|
let instrs = extra_instrs @ [`ClangStmt body] in
|
|
|
|
let instrs = extra_instrs @ [`ClangStmt body] in
|
|
|
|
let instrs_trans = IList.map get_custom_stmt_trans instrs in
|
|
|
|
let instrs_trans = IList.map get_custom_stmt_trans instrs in
|
|
|
|