@ -393,12 +393,14 @@ module CTrans_funct (F : CModule_type.CFrontend) : CModule_type.CTranslation = s
let exps = [ ( exp , typ ) ] in
let exps = [ ( exp , typ ) ] in
{ empty_res_trans with exps ; instrs }
{ empty_res_trans with exps ; instrs }
| Tfun _ | Tvoid | Tarray _ | TVar _ ->
| Tfun _ | Tvoid | Tarray _ | TVar _ ->
CFrontend_config . unimplemented " fill_typ_with_zero on type %a " ( Typ . pp Pp . text ) typ
CFrontend_config . unimplemented _ _ POS__ stmt_info . Clang_ast_t . si_source_range None
" fill_typ_with_zero on type %a " ( Typ . pp Pp . text ) typ
in
in
let res_trans = fill_typ_with_zero var_exp_typ in
let res_trans = fill_typ_with_zero var_exp_typ in
{ res_trans with initd_exps = [ fst var_exp_typ ] }
{ res_trans with initd_exps = [ fst var_exp_typ ] }
| None ->
| None ->
CFrontend_config . unimplemented " Retrieving var from non-InitListExpr parent "
CFrontend_config . unimplemented _ _ POS__ stmt_info . Clang_ast_t . si_source_range None
" Retrieving var from non-InitListExpr parent "
let no_op_trans succ_nodes = { empty_res_trans with root_nodes = succ_nodes }
let no_op_trans succ_nodes = { empty_res_trans with root_nodes = succ_nodes }
@ -746,7 +748,7 @@ module CTrans_funct (F : CModule_type.CFrontend) : CModule_type.CTranslation = s
| ` CXXMethod | ` CXXConversion | ` CXXConstructor | ` CXXDestructor ->
| ` CXXMethod | ` CXXConversion | ` CXXConstructor | ` CXXDestructor ->
method_deref_trans trans_state pre_trans_result decl_ref stmt_info decl_kind
method_deref_trans trans_state pre_trans_result decl_ref stmt_info decl_kind
| _ ->
| _ ->
CFrontend_config . unimplemented
CFrontend_config . unimplemented _ _ POS__ stmt_info . Clang_ast_t . si_source_range None
" Decl ref expression %a with pointer %d still needs to be translated "
" Decl ref expression %a with pointer %d still needs to be translated "
( Pp . to_string ~ f : Clang_ast_j . string_of_decl_kind )
( Pp . to_string ~ f : Clang_ast_j . string_of_decl_kind )
decl_kind decl_ref . Clang_ast_t . dr_decl_pointer
decl_kind decl_ref . Clang_ast_t . dr_decl_pointer
@ -1518,7 +1520,8 @@ module CTrans_funct (F : CModule_type.CFrontend) : CModule_type.CTranslation = s
let root_nodes' = if root_nodes < > [] then root_nodes else op_res_trans . root_nodes in
let root_nodes' = if root_nodes < > [] then root_nodes else op_res_trans . root_nodes in
{ op_res_trans with root_nodes = root_nodes' }
{ op_res_trans with root_nodes = root_nodes' }
| _ ->
| _ ->
CFrontend_config . unimplemented " BinaryConditionalOperator not translated "
CFrontend_config . unimplemented _ _ POS__ stmt_info . Clang_ast_t . si_source_range None
" BinaryConditionalOperator not translated "
(* Translate a condition for if/loops statement. It shorts-circuit and/or. *)
(* Translate a condition for if/loops statement. It shorts-circuit and/or. *)
@ -2069,7 +2072,7 @@ module CTrans_funct (F : CModule_type.CFrontend) : CModule_type.CTranslation = s
| [ stmt ] ->
| [ stmt ] ->
[ init_expr_trans trans_state ( var_exp , var_typ ) stmt_info ( Some stmt ) ]
[ init_expr_trans trans_state ( var_exp , var_typ ) stmt_info ( Some stmt ) ]
| _ ->
| _ ->
CFrontend_config . unimplemented
CFrontend_config . unimplemented _ _ POS__ stmt_info . Clang_ast_t . si_source_range None
" InitListExpression for var %a type %a with multiple init statements " Exp . pp var_exp
" InitListExpression for var %a type %a with multiple init statements " Exp . pp var_exp
( Typ . pp_full Pp . text ) var_typ
( Typ . pp_full Pp . text ) var_typ
@ -2115,8 +2118,8 @@ module CTrans_funct (F : CModule_type.CFrontend) : CModule_type.CTranslation = s
| Tint _ | Tfloat _ | Tptr _ ->
| Tint _ | Tfloat _ | Tptr _ ->
initListExpr_builtin_trans trans_state_pri init_stmt_info stmts var_exp var_typ
initListExpr_builtin_trans trans_state_pri init_stmt_info stmts var_exp var_typ
| _ ->
| _ ->
CFrontend_config . unimplemented " InitListExp for var %a of type %a " Exp . pp var_exp
CFrontend_config . unimplemented _ _ POS__ stmt_info . Clang_ast_t . si_source_range None
( Typ . pp Pp . text ) var_typ
" InitListExp for var %a of type %a " Exp . pp var_exp ( Typ . pp Pp . text ) var_typ
in
in
let nname = " InitListExp " in
let nname = " InitListExp " in
let res_trans =
let res_trans =
@ -2257,8 +2260,8 @@ module CTrans_funct (F : CModule_type.CFrontend) : CModule_type.CTranslation = s
| ( TypedefDecl _ | TypeAliasDecl _ | UsingDecl _ | UsingDirectiveDecl _ ) :: _ ->
| ( TypedefDecl _ | TypeAliasDecl _ | UsingDecl _ | UsingDirectiveDecl _ ) :: _ ->
empty_res_trans
empty_res_trans
| decl :: _ ->
| decl :: _ ->
CFrontend_config . unimplemented " In DeclStmt found an unknown declaration type %s "
CFrontend_config . unimplemented _ _ POS__ stmt_info . Clang_ast_t . si_source_range None
( Clang_ast_j . string_of_decl decl )
" In DeclStmt found an unknown declaration type %s " ( Clang_ast_j . string_of_decl decl )
| [] ->
| [] ->
assert false
assert false
in
in
@ -2951,7 +2954,7 @@ module CTrans_funct (F : CModule_type.CFrontend) : CModule_type.CTranslation = s
binaryOperator_trans trans_state binop_info stmt_info expr_info stmt_list
binaryOperator_trans trans_state binop_info stmt_info expr_info stmt_list
and attributedStmt_trans trans_state stmt s attrs =
and attributedStmt_trans trans_state stmt _info stmt s attrs =
let open Clang_ast_t in
let open Clang_ast_t in
match ( stmts , attrs ) with
match ( stmts , attrs ) with
| [ stmt ] , [ attr ] -> (
| [ stmt ] , [ attr ] -> (
@ -2959,12 +2962,13 @@ module CTrans_funct (F : CModule_type.CFrontend) : CModule_type.CTranslation = s
| NullStmt _ , FallThroughAttr _ ->
| NullStmt _ , FallThroughAttr _ ->
no_op_trans trans_state . succ_nodes
no_op_trans trans_state . succ_nodes
| _ ->
| _ ->
CFrontend_config . unimplemented
CFrontend_config . unimplemented _ _ POS__ stmt_info . Clang_ast_t . si_source_range None
" attributedStmt [stmt] [attr] with:@ \n stmt=%s@ \n attr=%s@ \n "
" attributedStmt [stmt] [attr] with:@ \n stmt=%s@ \n attr=%s@ \n "
( Clang_ast_j . string_of_stmt stmt )
( Clang_ast_j . string_of_stmt stmt )
( Clang_ast_j . string_of_attribute attr ) )
( Clang_ast_j . string_of_attribute attr ) )
| _ ->
| _ ->
CFrontend_config . unimplemented " attributedStmt with:@ \n stmts=[%a]@ \n attrs=[%a]@ \n "
CFrontend_config . unimplemented _ _ POS__ stmt_info . Clang_ast_t . si_source_range None
" attributedStmt with:@ \n stmts=[%a]@ \n attrs=[%a]@ \n "
( Pp . semicolon_seq ( Pp . to_string ~ f : Clang_ast_j . string_of_stmt ) )
( Pp . semicolon_seq ( Pp . to_string ~ f : Clang_ast_j . string_of_stmt ) )
stmts
stmts
( Pp . semicolon_seq ( Pp . to_string ~ f : Clang_ast_j . string_of_attribute ) )
( Pp . semicolon_seq ( Pp . to_string ~ f : Clang_ast_j . string_of_attribute ) )
@ -3207,8 +3211,8 @@ module CTrans_funct (F : CModule_type.CFrontend) : CModule_type.CTranslation = s
| LambdaExpr ( stmt_info , _ , expr_info , lambda_expr_info ) ->
| LambdaExpr ( stmt_info , _ , expr_info , lambda_expr_info ) ->
let trans_state' = { trans_state with priority = Free } in
let trans_state' = { trans_state with priority = Free } in
lambdaExpr_trans trans_state' stmt_info expr_info lambda_expr_info
lambdaExpr_trans trans_state' stmt_info expr_info lambda_expr_info
| AttributedStmt ( _ , stmts , attrs ) ->
| AttributedStmt ( stmt_info , stmts , attrs ) ->
attributedStmt_trans trans_state stmt s attrs
attributedStmt_trans trans_state stmt _info stmt s attrs
| TypeTraitExpr ( _ , _ , expr_info , type_trait_info ) ->
| TypeTraitExpr ( _ , _ , expr_info , type_trait_info ) ->
booleanValue_trans trans_state expr_info type_trait_info . Clang_ast_t . xtti_value
booleanValue_trans trans_state expr_info type_trait_info . Clang_ast_t . xtti_value
| CXXNoexceptExpr ( _ , _ , expr_info , cxx_noexcept_expr_info ) ->
| CXXNoexceptExpr ( _ , _ , expr_info , cxx_noexcept_expr_info ) ->
@ -3230,7 +3234,9 @@ module CTrans_funct (F : CModule_type.CFrontend) : CModule_type.CTranslation = s
| SubstNonTypeTemplateParmExpr _
| SubstNonTypeTemplateParmExpr _
| SubstNonTypeTemplateParmPackExpr _
| SubstNonTypeTemplateParmPackExpr _
| CXXDependentScopeMemberExpr _ ->
| CXXDependentScopeMemberExpr _ ->
CFrontend_config . unimplemented " Translation of templated code is unsupported: %a "
CFrontend_config . unimplemented _ _ POS__ stmt_info . Clang_ast_t . si_source_range
( Some ( Clang_ast_proj . get_stmt_kind_string instr ) )
" Translation of templated code is unsupported: %a "
( Pp . to_string ~ f : Clang_ast_j . string_of_stmt )
( Pp . to_string ~ f : Clang_ast_j . string_of_stmt )
instr
instr
| ForStmt ( _ , _ ) | WhileStmt ( _ , _ ) | DoStmt ( _ , _ ) | ObjCForCollectionStmt ( _ , _ ) ->
| ForStmt ( _ , _ ) | WhileStmt ( _ , _ ) | DoStmt ( _ , _ ) | ObjCForCollectionStmt ( _ , _ ) ->
@ -3328,7 +3334,9 @@ module CTrans_funct (F : CModule_type.CFrontend) : CModule_type.CTranslation = s
| SEHLeaveStmt _
| SEHLeaveStmt _
| SEHTryStmt _
| SEHTryStmt _
| DefaultStmt _ ->
| DefaultStmt _ ->
CFrontend_config . unimplemented " Statement translation for kind %s: %a "
CFrontend_config . unimplemented _ _ POS__ stmt_info . Clang_ast_t . si_source_range
( Some ( Clang_ast_proj . get_stmt_kind_string instr ) )
" Statement translation for kind %s: %a "
( Clang_ast_proj . get_stmt_kind_string instr )
( Clang_ast_proj . get_stmt_kind_string instr )
( Pp . to_string ~ f : Clang_ast_j . string_of_stmt )
( Pp . to_string ~ f : Clang_ast_j . string_of_stmt )
instr
instr