| ... | @@ -112,7 +112,7 @@ static TransScopeSwitch *trans_scope_switch_create(Context *c, TransScope *paren | ... | @@ -112,7 +112,7 @@ static TransScopeSwitch *trans_scope_switch_create(Context *c, TransScope *paren |
| 112 | | 112 | |
| 113 | static TransScopeBlock *trans_scope_block_find(TransScope *scope); | 113 | static TransScopeBlock *trans_scope_block_find(TransScope *scope); |
| 114 | | 114 | |
| 115 | static AstNode *resolve_record_decl(Context *c, const clang::RecordDecl *record_decl); | 115 | static AstNode *resolve_record_decl(Context *c, const ZigClangRecordDecl *record_decl); |
| 116 | static AstNode *resolve_enum_decl(Context *c, const clang::EnumDecl *enum_decl); | 116 | static AstNode *resolve_enum_decl(Context *c, const clang::EnumDecl *enum_decl); |
| 117 | static AstNode *resolve_typedef_decl(Context *c, const clang::TypedefNameDecl *typedef_decl); | 117 | static AstNode *resolve_typedef_decl(Context *c, const clang::TypedefNameDecl *typedef_decl); |
| 118 | | 118 | |
| ... | @@ -122,9 +122,9 @@ static int trans_stmt_extra(Context *c, TransScope *scope, const clang::Stmt *st | ... | @@ -122,9 +122,9 @@ static int trans_stmt_extra(Context *c, TransScope *scope, const clang::Stmt *st |
| 122 | TransScope **out_node_scope); | 122 | TransScope **out_node_scope); |
| 123 | static TransScope *trans_stmt(Context *c, TransScope *scope, const clang::Stmt *stmt, AstNode **out_node); | 123 | static TransScope *trans_stmt(Context *c, TransScope *scope, const clang::Stmt *stmt, AstNode **out_node); |
| 124 | static AstNode *trans_expr(Context *c, ResultUsed result_used, TransScope *scope, const clang::Expr *expr, TransLRValue lrval); | 124 | static AstNode *trans_expr(Context *c, ResultUsed result_used, TransScope *scope, const clang::Expr *expr, TransLRValue lrval); |
| 125 | static AstNode *trans_qual_type(Context *c, clang::QualType qt, const clang::SourceLocation &source_loc); | 125 | static AstNode *trans_qual_type(Context *c, clang::QualType qt, ZigClangSourceLocation source_loc); |
| 126 | static AstNode *trans_bool_expr(Context *c, ResultUsed result_used, TransScope *scope, const clang::Expr *expr, TransLRValue lrval); | 126 | static AstNode *trans_bool_expr(Context *c, ResultUsed result_used, TransScope *scope, const clang::Expr *expr, TransLRValue lrval); |
| 127 | static AstNode *trans_ap_value(Context *c, clang::APValue *ap_value, clang::QualType qt, const clang::SourceLocation &source_loc); | 127 | static AstNode *trans_ap_value(Context *c, clang::APValue *ap_value, clang::QualType qt, ZigClangSourceLocation source_loc); |
| 128 | | 128 | |
| 129 | static ZigClangSourceLocation bitcast(clang::SourceLocation src) { | 129 | static ZigClangSourceLocation bitcast(clang::SourceLocation src) { |
| 130 | ZigClangSourceLocation dest; | 130 | ZigClangSourceLocation dest; |
| ... | @@ -143,7 +143,7 @@ static clang::QualType bitcast(ZigClangQualType src) { | ... | @@ -143,7 +143,7 @@ static clang::QualType bitcast(ZigClangQualType src) { |
| 143 | } | 143 | } |
| 144 | | 144 | |
| 145 | ATTRIBUTE_PRINTF(3, 4) | 145 | ATTRIBUTE_PRINTF(3, 4) |
| 146 | static void emit_warning(Context *c, const clang::SourceLocation &clang_sl, const char *format, ...) { | 146 | static void emit_warning(Context *c, ZigClangSourceLocation sl, const char *format, ...) { |
| 147 | if (!c->warnings_on) { | 147 | if (!c->warnings_on) { |
| 148 | return; | 148 | return; |
| 149 | } | 149 | } |
| ... | @@ -153,7 +153,6 @@ static void emit_warning(Context *c, const clang::SourceLocation &clang_sl, cons | ... | @@ -153,7 +153,6 @@ static void emit_warning(Context *c, const clang::SourceLocation &clang_sl, cons |
| 153 | Buf *msg = buf_vprintf(format, ap); | 153 | Buf *msg = buf_vprintf(format, ap); |
| 154 | va_end(ap); | 154 | va_end(ap); |
| 155 | | 155 | |
| 156 | ZigClangSourceLocation sl = bitcast(clang_sl); | | |
| 157 | const char *filename_bytes = ZigClangSourceManager_getFilename(c->source_manager, | 156 | const char *filename_bytes = ZigClangSourceManager_getFilename(c->source_manager, |
| 158 | ZigClangSourceManager_getSpellingLoc(c->source_manager, sl)); | 157 | ZigClangSourceManager_getSpellingLoc(c->source_manager, sl)); |
| 159 | Buf *path; | 158 | Buf *path; |
| ... | @@ -489,11 +488,6 @@ static Buf *string_ref_to_buf(llvm::StringRef string_ref) { | ... | @@ -489,11 +488,6 @@ static Buf *string_ref_to_buf(llvm::StringRef string_ref) { |
| 489 | return buf_create_from_mem((const char *)string_ref.bytes_begin(), string_ref.size()); | 488 | return buf_create_from_mem((const char *)string_ref.bytes_begin(), string_ref.size()); |
| 490 | } | 489 | } |
| 491 | | 490 | |
| 492 | static const char *decl_name(const clang::Decl *decl) { | | |
| 493 | const clang::NamedDecl *named_decl = static_cast<const clang::NamedDecl *>(decl); | | |
| 494 | return (const char *)named_decl->getName().bytes_begin(); | | |
| 495 | } | | |
| 496 | | | |
| 497 | static AstNode *trans_create_node_apint(Context *c, const llvm::APSInt &aps_int) { | 491 | static AstNode *trans_create_node_apint(Context *c, const llvm::APSInt &aps_int) { |
| 498 | AstNode *node = trans_create_node(c, NodeTypeIntLiteral); | 492 | AstNode *node = trans_create_node(c, NodeTypeIntLiteral); |
| 499 | node->data.int_literal.bigint = allocate<BigInt>(1); | 493 | node->data.int_literal.bigint = allocate<BigInt>(1); |
| ... | @@ -539,7 +533,7 @@ static clang::QualType get_expr_qual_type_before_implicit_cast(Context *c, const | ... | @@ -539,7 +533,7 @@ static clang::QualType get_expr_qual_type_before_implicit_cast(Context *c, const |
| 539 | } | 533 | } |
| 540 | | 534 | |
| 541 | static AstNode *get_expr_type(Context *c, const clang::Expr *expr) { | 535 | static AstNode *get_expr_type(Context *c, const clang::Expr *expr) { |
| 542 | return trans_qual_type(c, get_expr_qual_type(c, expr), expr->getBeginLoc()); | 536 | return trans_qual_type(c, get_expr_qual_type(c, expr), bitcast(expr->getBeginLoc())); |
| 543 | } | 537 | } |
| 544 | | 538 | |
| 545 | static bool qual_types_equal(clang::QualType t1, clang::QualType t2) { | 539 | static bool qual_types_equal(clang::QualType t1, clang::QualType t2) { |
| ... | @@ -598,7 +592,7 @@ static bool qual_type_is_fn_ptr(clang::QualType qt) { | ... | @@ -598,7 +592,7 @@ static bool qual_type_is_fn_ptr(clang::QualType qt) { |
| 598 | return false; | 592 | return false; |
| 599 | } | 593 | } |
| 600 | | 594 | |
| 601 | static uint32_t qual_type_int_bit_width(Context *c, const clang::QualType &qt, const clang::SourceLocation &source_loc) { | 595 | static uint32_t qual_type_int_bit_width(Context *c, const clang::QualType &qt, ZigClangSourceLocation source_loc) { |
| 602 | const clang::Type *ty = qt.getTypePtr(); | 596 | const clang::Type *ty = qt.getTypePtr(); |
| 603 | switch (ty->getTypeClass()) { | 597 | switch (ty->getTypeClass()) { |
| 604 | case clang::Type::Builtin: | 598 | case clang::Type::Builtin: |
| ... | @@ -622,7 +616,7 @@ static uint32_t qual_type_int_bit_width(Context *c, const clang::QualType &qt, c | ... | @@ -622,7 +616,7 @@ static uint32_t qual_type_int_bit_width(Context *c, const clang::QualType &qt, c |
| 622 | { | 616 | { |
| 623 | const clang::TypedefType *typedef_ty = static_cast<const clang::TypedefType*>(ty); | 617 | const clang::TypedefType *typedef_ty = static_cast<const clang::TypedefType*>(ty); |
| 624 | const clang::TypedefNameDecl *typedef_decl = typedef_ty->getDecl(); | 618 | const clang::TypedefNameDecl *typedef_decl = typedef_ty->getDecl(); |
| 625 | const char *type_name = decl_name(typedef_decl); | 619 | const char *type_name = ZigClangDecl_getName_bytes_begin((const ZigClangDecl *)typedef_decl); |
| 626 | if (strcmp(type_name, "uint8_t") == 0 || strcmp(type_name, "int8_t") == 0) { | 620 | if (strcmp(type_name, "uint8_t") == 0 || strcmp(type_name, "int8_t") == 0) { |
| 627 | return 8; | 621 | return 8; |
| 628 | } else if (strcmp(type_name, "uint16_t") == 0 || strcmp(type_name, "int16_t") == 0) { | 622 | } else if (strcmp(type_name, "uint16_t") == 0 || strcmp(type_name, "int16_t") == 0) { |
| ... | @@ -643,7 +637,7 @@ static uint32_t qual_type_int_bit_width(Context *c, const clang::QualType &qt, c | ... | @@ -643,7 +637,7 @@ static uint32_t qual_type_int_bit_width(Context *c, const clang::QualType &qt, c |
| 643 | | 637 | |
| 644 | | 638 | |
| 645 | static AstNode *qual_type_to_log2_int_ref(Context *c, const clang::QualType &qt, | 639 | static AstNode *qual_type_to_log2_int_ref(Context *c, const clang::QualType &qt, |
| 646 | const clang::SourceLocation &source_loc) | 640 | ZigClangSourceLocation source_loc) |
| 647 | { | 641 | { |
| 648 | uint32_t int_bit_width = qual_type_int_bit_width(c, qt, source_loc); | 642 | uint32_t int_bit_width = qual_type_int_bit_width(c, qt, source_loc); |
| 649 | if (int_bit_width != 0) { | 643 | if (int_bit_width != 0) { |
| ... | @@ -688,7 +682,7 @@ static bool qual_type_child_is_fn_proto(const clang::QualType &qt) { | ... | @@ -688,7 +682,7 @@ static bool qual_type_child_is_fn_proto(const clang::QualType &qt) { |
| 688 | return false; | 682 | return false; |
| 689 | } | 683 | } |
| 690 | | 684 | |
| 691 | static AstNode* trans_c_cast(Context *c, const clang::SourceLocation &source_location, clang::QualType dest_type, | 685 | static AstNode* trans_c_cast(Context *c, ZigClangSourceLocation source_location, clang::QualType dest_type, |
| 692 | clang::QualType src_type, AstNode *expr) | 686 | clang::QualType src_type, AstNode *expr) |
| 693 | { | 687 | { |
| 694 | // The only way void pointer casts are valid C code, is if | 688 | // The only way void pointer casts are valid C code, is if |
| ... | @@ -788,7 +782,7 @@ static bool qual_type_has_wrapping_overflow(Context *c, clang::QualType qt) { | ... | @@ -788,7 +782,7 @@ static bool qual_type_has_wrapping_overflow(Context *c, clang::QualType qt) { |
| 788 | } | 782 | } |
| 789 | } | 783 | } |
| 790 | | 784 | |
| 791 | static bool type_is_opaque(Context *c, const clang::Type *ty, const clang::SourceLocation &source_loc) { | 785 | static bool type_is_opaque(Context *c, const clang::Type *ty, ZigClangSourceLocation source_loc) { |
| 792 | switch (ty->getTypeClass()) { | 786 | switch (ty->getTypeClass()) { |
| 793 | case clang::Type::Builtin: { | 787 | case clang::Type::Builtin: { |
| 794 | const clang::BuiltinType *builtin_ty = static_cast<const clang::BuiltinType*>(ty); | 788 | const clang::BuiltinType *builtin_ty = static_cast<const clang::BuiltinType*>(ty); |
| ... | @@ -812,7 +806,7 @@ static bool type_is_opaque(Context *c, const clang::Type *ty, const clang::Sourc | ... | @@ -812,7 +806,7 @@ static bool type_is_opaque(Context *c, const clang::Type *ty, const clang::Sourc |
| 812 | } | 806 | } |
| 813 | } | 807 | } |
| 814 | | 808 | |
| 815 | static AstNode *trans_type(Context *c, const clang::Type *ty, const clang::SourceLocation &source_loc) { | 809 | static AstNode *trans_type(Context *c, const clang::Type *ty, ZigClangSourceLocation source_loc) { |
| 816 | switch (ty->getTypeClass()) { | 810 | switch (ty->getTypeClass()) { |
| 817 | case clang::Type::Builtin: | 811 | case clang::Type::Builtin: |
| 818 | { | 812 | { |
| ... | @@ -1129,8 +1123,8 @@ static AstNode *trans_type(Context *c, const clang::Type *ty, const clang::Sourc | ... | @@ -1129,8 +1123,8 @@ static AstNode *trans_type(Context *c, const clang::Type *ty, const clang::Sourc |
| 1129 | } | 1123 | } |
| 1130 | case clang::Type::Record: | 1124 | case clang::Type::Record: |
| 1131 | { | 1125 | { |
| 1132 | const clang::RecordType *record_ty = static_cast<const clang::RecordType*>(ty); | 1126 | const ZigClangRecordType *record_ty = reinterpret_cast<const ZigClangRecordType*>(ty); |
| 1133 | return resolve_record_decl(c, record_ty->getDecl()); | 1127 | return resolve_record_decl(c, ZigClangRecordType_getDecl(record_ty)); |
| 1134 | } | 1128 | } |
| 1135 | case clang::Type::Enum: | 1129 | case clang::Type::Enum: |
| 1136 | { | 1130 | { |
| ... | @@ -1217,7 +1211,7 @@ static AstNode *trans_type(Context *c, const clang::Type *ty, const clang::Sourc | ... | @@ -1217,7 +1211,7 @@ static AstNode *trans_type(Context *c, const clang::Type *ty, const clang::Sourc |
| 1217 | zig_unreachable(); | 1211 | zig_unreachable(); |
| 1218 | } | 1212 | } |
| 1219 | | 1213 | |
| 1220 | static AstNode *trans_qual_type(Context *c, clang::QualType qt, const clang::SourceLocation &source_loc) { | 1214 | static AstNode *trans_qual_type(Context *c, clang::QualType qt, ZigClangSourceLocation source_loc) { |
| 1221 | return trans_type(c, qt.getTypePtr(), source_loc); | 1215 | return trans_type(c, qt.getTypePtr(), source_loc); |
| 1222 | } | 1216 | } |
| 1223 | | 1217 | |
| ... | @@ -1289,7 +1283,7 @@ static AstNode *trans_return_stmt(Context *c, TransScope *scope, const clang::Re | ... | @@ -1289,7 +1283,7 @@ static AstNode *trans_return_stmt(Context *c, TransScope *scope, const clang::Re |
| 1289 | static AstNode *trans_integer_literal(Context *c, ResultUsed result_used, const clang::IntegerLiteral *stmt) { | 1283 | static AstNode *trans_integer_literal(Context *c, ResultUsed result_used, const clang::IntegerLiteral *stmt) { |
| 1290 | clang::Expr::EvalResult result; | 1284 | clang::Expr::EvalResult result; |
| 1291 | if (!stmt->EvaluateAsInt(result, *reinterpret_cast<clang::ASTContext *>(c->ctx))) { | 1285 | if (!stmt->EvaluateAsInt(result, *reinterpret_cast<clang::ASTContext *>(c->ctx))) { |
| 1292 | emit_warning(c, stmt->getBeginLoc(), "invalid integer literal"); | 1286 | emit_warning(c, bitcast(stmt->getBeginLoc()), "invalid integer literal"); |
| 1293 | return nullptr; | 1287 | return nullptr; |
| 1294 | } | 1288 | } |
| 1295 | AstNode *node = trans_create_node_apint(c, result.Val.getInt()); | 1289 | AstNode *node = trans_create_node_apint(c, result.Val.getInt()); |
| ... | @@ -1301,10 +1295,10 @@ static AstNode *trans_constant_expr(Context *c, ResultUsed result_used, const cl | ... | @@ -1301,10 +1295,10 @@ static AstNode *trans_constant_expr(Context *c, ResultUsed result_used, const cl |
| 1301 | if (!expr->EvaluateAsConstantExpr(result, clang::Expr::EvaluateForCodeGen, | 1295 | if (!expr->EvaluateAsConstantExpr(result, clang::Expr::EvaluateForCodeGen, |
| 1302 | *reinterpret_cast<clang::ASTContext *>(c->ctx))) | 1296 | *reinterpret_cast<clang::ASTContext *>(c->ctx))) |
| 1303 | { | 1297 | { |
| 1304 | emit_warning(c, expr->getBeginLoc(), "invalid constant expression"); | 1298 | emit_warning(c, bitcast(expr->getBeginLoc()), "invalid constant expression"); |
| 1305 | return nullptr; | 1299 | return nullptr; |
| 1306 | } | 1300 | } |
| 1307 | AstNode *node = trans_ap_value(c, &result.Val, expr->getType(), expr->getBeginLoc()); | 1301 | AstNode *node = trans_ap_value(c, &result.Val, expr->getType(), bitcast(expr->getBeginLoc())); |
| 1308 | return maybe_suppress_result(c, result_used, node); | 1302 | return maybe_suppress_result(c, result_used, node); |
| 1309 | } | 1303 | } |
| 1310 | | 1304 | |
| ... | @@ -1417,7 +1411,7 @@ static AstNode *trans_create_assign(Context *c, ResultUsed result_used, TransSco | ... | @@ -1417,7 +1411,7 @@ static AstNode *trans_create_assign(Context *c, ResultUsed result_used, TransSco |
| 1417 | static AstNode *trans_create_shift_op(Context *c, TransScope *scope, clang::QualType result_type, | 1411 | static AstNode *trans_create_shift_op(Context *c, TransScope *scope, clang::QualType result_type, |
| 1418 | clang::Expr *lhs_expr, BinOpType bin_op, clang::Expr *rhs_expr) | 1412 | clang::Expr *lhs_expr, BinOpType bin_op, clang::Expr *rhs_expr) |
| 1419 | { | 1413 | { |
| 1420 | const clang::SourceLocation &rhs_location = rhs_expr->getBeginLoc(); | 1414 | ZigClangSourceLocation rhs_location = bitcast(rhs_expr->getBeginLoc()); |
| 1421 | AstNode *rhs_type = qual_type_to_log2_int_ref(c, result_type, rhs_location); | 1415 | AstNode *rhs_type = qual_type_to_log2_int_ref(c, result_type, rhs_location); |
| 1422 | // lhs >> u5(rh) | 1416 | // lhs >> u5(rh) |
| 1423 | | 1417 | |
| ... | @@ -1434,13 +1428,13 @@ static AstNode *trans_create_shift_op(Context *c, TransScope *scope, clang::Qual | ... | @@ -1434,13 +1428,13 @@ static AstNode *trans_create_shift_op(Context *c, TransScope *scope, clang::Qual |
| 1434 | static AstNode *trans_binary_operator(Context *c, ResultUsed result_used, TransScope *scope, const clang::BinaryOperator *stmt) { | 1428 | static AstNode *trans_binary_operator(Context *c, ResultUsed result_used, TransScope *scope, const clang::BinaryOperator *stmt) { |
| 1435 | switch (stmt->getOpcode()) { | 1429 | switch (stmt->getOpcode()) { |
| 1436 | case clang::BO_PtrMemD: | 1430 | case clang::BO_PtrMemD: |
| 1437 | emit_warning(c, stmt->getBeginLoc(), "TODO handle more C binary operators: BO_PtrMemD"); | 1431 | emit_warning(c, bitcast(stmt->getBeginLoc()), "TODO handle more C binary operators: BO_PtrMemD"); |
| 1438 | return nullptr; | 1432 | return nullptr; |
| 1439 | case clang::BO_PtrMemI: | 1433 | case clang::BO_PtrMemI: |
| 1440 | emit_warning(c, stmt->getBeginLoc(), "TODO handle more C binary operators: BO_PtrMemI"); | 1434 | emit_warning(c, bitcast(stmt->getBeginLoc()), "TODO handle more C binary operators: BO_PtrMemI"); |
| 1441 | return nullptr; | 1435 | return nullptr; |
| 1442 | case clang::BO_Cmp: | 1436 | case clang::BO_Cmp: |
| 1443 | emit_warning(c, stmt->getBeginLoc(), "TODO handle more C binary operators: BO_Cmp"); | 1437 | emit_warning(c, bitcast(stmt->getBeginLoc()), "TODO handle more C binary operators: BO_Cmp"); |
| 1444 | return nullptr; | 1438 | return nullptr; |
| 1445 | case clang::BO_Mul: { | 1439 | case clang::BO_Mul: { |
| 1446 | AstNode *node = trans_create_bin_op(c, scope, stmt->getLHS(), | 1440 | AstNode *node = trans_create_bin_op(c, scope, stmt->getLHS(), |
| ... | @@ -1584,7 +1578,7 @@ static AstNode *trans_binary_operator(Context *c, ResultUsed result_used, TransS | ... | @@ -1584,7 +1578,7 @@ static AstNode *trans_binary_operator(Context *c, ResultUsed result_used, TransS |
| 1584 | static AstNode *trans_create_compound_assign_shift(Context *c, ResultUsed result_used, TransScope *scope, | 1578 | static AstNode *trans_create_compound_assign_shift(Context *c, ResultUsed result_used, TransScope *scope, |
| 1585 | const clang::CompoundAssignOperator *stmt, BinOpType assign_op, BinOpType bin_op) | 1579 | const clang::CompoundAssignOperator *stmt, BinOpType assign_op, BinOpType bin_op) |
| 1586 | { | 1580 | { |
| 1587 | const clang::SourceLocation &rhs_location = stmt->getRHS()->getBeginLoc(); | 1581 | ZigClangSourceLocation rhs_location = bitcast(stmt->getRHS()->getBeginLoc()); |
| 1588 | AstNode *rhs_type = qual_type_to_log2_int_ref(c, stmt->getComputationLHSType(), rhs_location); | 1582 | AstNode *rhs_type = qual_type_to_log2_int_ref(c, stmt->getComputationLHSType(), rhs_location); |
| 1589 | | 1583 | |
| 1590 | bool use_intermediate_casts = stmt->getComputationLHSType().getTypePtr() != stmt->getComputationResultType().getTypePtr(); | 1584 | bool use_intermediate_casts = stmt->getComputationLHSType().getTypePtr() != stmt->getComputationResultType().getTypePtr(); |
| ... | @@ -1733,13 +1727,13 @@ static AstNode *trans_compound_assign_operator(Context *c, ResultUsed result_use | ... | @@ -1733,13 +1727,13 @@ static AstNode *trans_compound_assign_operator(Context *c, ResultUsed result_use |
| 1733 | else | 1727 | else |
| 1734 | return trans_create_compound_assign(c, result_used, scope, stmt, BinOpTypeAssignTimes, BinOpTypeMult); | 1728 | return trans_create_compound_assign(c, result_used, scope, stmt, BinOpTypeAssignTimes, BinOpTypeMult); |
| 1735 | case clang::BO_DivAssign: | 1729 | case clang::BO_DivAssign: |
| 1736 | emit_warning(c, stmt->getBeginLoc(), "TODO handle more C compound assign operators: BO_DivAssign"); | 1730 | emit_warning(c, bitcast(stmt->getBeginLoc()), "TODO handle more C compound assign operators: BO_DivAssign"); |
| 1737 | return nullptr; | 1731 | return nullptr; |
| 1738 | case clang::BO_RemAssign: | 1732 | case clang::BO_RemAssign: |
| 1739 | emit_warning(c, stmt->getBeginLoc(), "TODO handle more C compound assign operators: BO_RemAssign"); | 1733 | emit_warning(c, bitcast(stmt->getBeginLoc()), "TODO handle more C compound assign operators: BO_RemAssign"); |
| 1740 | return nullptr; | 1734 | return nullptr; |
| 1741 | case clang::BO_Cmp: | 1735 | case clang::BO_Cmp: |
| 1742 | emit_warning(c, stmt->getBeginLoc(), "TODO handle more C compound assign operators: BO_Cmp"); | 1736 | emit_warning(c, bitcast(stmt->getBeginLoc()), "TODO handle more C compound assign operators: BO_Cmp"); |
| 1743 | return nullptr; | 1737 | return nullptr; |
| 1744 | case clang::BO_AddAssign: | 1738 | case clang::BO_AddAssign: |
| 1745 | if (qual_type_has_wrapping_overflow(c, stmt->getType())) | 1739 | if (qual_type_has_wrapping_overflow(c, stmt->getType())) |
| ... | @@ -1798,7 +1792,7 @@ static AstNode *trans_implicit_cast_expr(Context *c, ResultUsed result_used, Tra | ... | @@ -1798,7 +1792,7 @@ static AstNode *trans_implicit_cast_expr(Context *c, ResultUsed result_used, Tra |
| 1798 | AstNode *target_node = trans_expr(c, ResultUsedYes, scope, stmt->getSubExpr(), TransRValue); | 1792 | AstNode *target_node = trans_expr(c, ResultUsedYes, scope, stmt->getSubExpr(), TransRValue); |
| 1799 | if (target_node == nullptr) | 1793 | if (target_node == nullptr) |
| 1800 | return nullptr; | 1794 | return nullptr; |
| 1801 | AstNode *node = trans_c_cast(c, stmt->getExprLoc(), stmt->getType(), | 1795 | AstNode *node = trans_c_cast(c, bitcast(stmt->getExprLoc()), stmt->getType(), |
| 1802 | stmt->getSubExpr()->getType(), target_node); | 1796 | stmt->getSubExpr()->getType(), target_node); |
| 1803 | return maybe_suppress_result(c, result_used, node); | 1797 | return maybe_suppress_result(c, result_used, node); |
| 1804 | } | 1798 | } |
| ... | @@ -1832,160 +1826,160 @@ static AstNode *trans_implicit_cast_expr(Context *c, ResultUsed result_used, Tra | ... | @@ -1832,160 +1826,160 @@ static AstNode *trans_implicit_cast_expr(Context *c, ResultUsed result_used, Tra |
| 1832 | case clang::CK_NoOp: | 1826 | case clang::CK_NoOp: |
| 1833 | return trans_expr(c, ResultUsedYes, scope, stmt->getSubExpr(), TransRValue); | 1827 | return trans_expr(c, ResultUsedYes, scope, stmt->getSubExpr(), TransRValue); |
| 1834 | case clang::CK_Dependent: | 1828 | case clang::CK_Dependent: |
| 1835 | emit_warning(c, stmt->getBeginLoc(), "TODO handle C translation cast CK_Dependent"); | 1829 | emit_warning(c, bitcast(stmt->getBeginLoc()), "TODO handle C translation cast CK_Dependent"); |
| 1836 | return nullptr; | 1830 | return nullptr; |
| 1837 | case clang::CK_LValueBitCast: | 1831 | case clang::CK_LValueBitCast: |
| 1838 | emit_warning(c, stmt->getBeginLoc(), "TODO handle C translation cast CK_LValueBitCast"); | 1832 | emit_warning(c, bitcast(stmt->getBeginLoc()), "TODO handle C translation cast CK_LValueBitCast"); |
| 1839 | return nullptr; | 1833 | return nullptr; |
| 1840 | case clang::CK_BaseToDerived: | 1834 | case clang::CK_BaseToDerived: |
| 1841 | emit_warning(c, stmt->getBeginLoc(), "TODO handle C translation cast CK_BaseToDerived"); | 1835 | emit_warning(c, bitcast(stmt->getBeginLoc()), "TODO handle C translation cast CK_BaseToDerived"); |
| 1842 | return nullptr; | 1836 | return nullptr; |
| 1843 | case clang::CK_DerivedToBase: | 1837 | case clang::CK_DerivedToBase: |
| 1844 | emit_warning(c, stmt->getBeginLoc(), "TODO handle C translation cast CK_DerivedToBase"); | 1838 | emit_warning(c, bitcast(stmt->getBeginLoc()), "TODO handle C translation cast CK_DerivedToBase"); |
| 1845 | return nullptr; | 1839 | return nullptr; |
| 1846 | case clang::CK_UncheckedDerivedToBase: | 1840 | case clang::CK_UncheckedDerivedToBase: |
| 1847 | emit_warning(c, stmt->getBeginLoc(), "TODO handle C translation cast CK_UncheckedDerivedToBase"); | 1841 | emit_warning(c, bitcast(stmt->getBeginLoc()), "TODO handle C translation cast CK_UncheckedDerivedToBase"); |
| 1848 | return nullptr; | 1842 | return nullptr; |
| 1849 | case clang::CK_Dynamic: | 1843 | case clang::CK_Dynamic: |
| 1850 | emit_warning(c, stmt->getBeginLoc(), "TODO handle C translation cast CK_Dynamic"); | 1844 | emit_warning(c, bitcast(stmt->getBeginLoc()), "TODO handle C translation cast CK_Dynamic"); |
| 1851 | return nullptr; | 1845 | return nullptr; |
| 1852 | case clang::CK_ToUnion: | 1846 | case clang::CK_ToUnion: |
| 1853 | emit_warning(c, stmt->getBeginLoc(), "TODO handle C translation cast CK_ToUnion"); | 1847 | emit_warning(c, bitcast(stmt->getBeginLoc()), "TODO handle C translation cast CK_ToUnion"); |
| 1854 | return nullptr; | 1848 | return nullptr; |
| 1855 | case clang::CK_NullToMemberPointer: | 1849 | case clang::CK_NullToMemberPointer: |
| 1856 | emit_warning(c, stmt->getBeginLoc(), "TODO handle C translation cast CK_NullToMemberPointer"); | 1850 | emit_warning(c, bitcast(stmt->getBeginLoc()), "TODO handle C translation cast CK_NullToMemberPointer"); |
| 1857 | return nullptr; | 1851 | return nullptr; |
| 1858 | case clang::CK_BaseToDerivedMemberPointer: | 1852 | case clang::CK_BaseToDerivedMemberPointer: |
| 1859 | emit_warning(c, stmt->getBeginLoc(), "TODO handle C translation cast CK_BaseToDerivedMemberPointer"); | 1853 | emit_warning(c, bitcast(stmt->getBeginLoc()), "TODO handle C translation cast CK_BaseToDerivedMemberPointer"); |
| 1860 | return nullptr; | 1854 | return nullptr; |
| 1861 | case clang::CK_DerivedToBaseMemberPointer: | 1855 | case clang::CK_DerivedToBaseMemberPointer: |
| 1862 | emit_warning(c, stmt->getBeginLoc(), "TODO handle C translation cast CK_DerivedToBaseMemberPointer"); | 1856 | emit_warning(c, bitcast(stmt->getBeginLoc()), "TODO handle C translation cast CK_DerivedToBaseMemberPointer"); |
| 1863 | return nullptr; | 1857 | return nullptr; |
| 1864 | case clang::CK_MemberPointerToBoolean: | 1858 | case clang::CK_MemberPointerToBoolean: |
| 1865 | emit_warning(c, stmt->getBeginLoc(), "TODO handle C translation cast CK_MemberPointerToBoolean"); | 1859 | emit_warning(c, bitcast(stmt->getBeginLoc()), "TODO handle C translation cast CK_MemberPointerToBoolean"); |
| 1866 | return nullptr; | 1860 | return nullptr; |
| 1867 | case clang::CK_ReinterpretMemberPointer: | 1861 | case clang::CK_ReinterpretMemberPointer: |
| 1868 | emit_warning(c, stmt->getBeginLoc(), "TODO handle C translation cast CK_ReinterpretMemberPointer"); | 1862 | emit_warning(c, bitcast(stmt->getBeginLoc()), "TODO handle C translation cast CK_ReinterpretMemberPointer"); |
| 1869 | return nullptr; | 1863 | return nullptr; |
| 1870 | case clang::CK_UserDefinedConversion: | 1864 | case clang::CK_UserDefinedConversion: |
| 1871 | emit_warning(c, stmt->getBeginLoc(), "TODO handle C translation cast CK_UserDefinedConversion"); | 1865 | emit_warning(c, bitcast(stmt->getBeginLoc()), "TODO handle C translation cast CK_UserDefinedConversion"); |
| 1872 | return nullptr; | 1866 | return nullptr; |
| 1873 | case clang::CK_ConstructorConversion: | 1867 | case clang::CK_ConstructorConversion: |
| 1874 | emit_warning(c, stmt->getBeginLoc(), "TODO handle C CK_ConstructorConversion"); | 1868 | emit_warning(c, bitcast(stmt->getBeginLoc()), "TODO handle C CK_ConstructorConversion"); |
| 1875 | return nullptr; | 1869 | return nullptr; |
| 1876 | case clang::CK_IntegralToPointer: | 1870 | case clang::CK_IntegralToPointer: |
| 1877 | emit_warning(c, stmt->getBeginLoc(), "TODO handle C CK_IntegralToPointer"); | 1871 | emit_warning(c, bitcast(stmt->getBeginLoc()), "TODO handle C CK_IntegralToPointer"); |
| 1878 | return nullptr; | 1872 | return nullptr; |
| 1879 | case clang::CK_PointerToIntegral: | 1873 | case clang::CK_PointerToIntegral: |
| 1880 | emit_warning(c, stmt->getBeginLoc(), "TODO handle C CK_PointerToIntegral"); | 1874 | emit_warning(c, bitcast(stmt->getBeginLoc()), "TODO handle C CK_PointerToIntegral"); |
| 1881 | return nullptr; | 1875 | return nullptr; |
| 1882 | case clang::CK_PointerToBoolean: | 1876 | case clang::CK_PointerToBoolean: |
| 1883 | emit_warning(c, stmt->getBeginLoc(), "TODO handle C CK_PointerToBoolean"); | 1877 | emit_warning(c, bitcast(stmt->getBeginLoc()), "TODO handle C CK_PointerToBoolean"); |
| 1884 | return nullptr; | 1878 | return nullptr; |
| 1885 | case clang::CK_ToVoid: | 1879 | case clang::CK_ToVoid: |
| 1886 | emit_warning(c, stmt->getBeginLoc(), "TODO handle C CK_ToVoid"); | 1880 | emit_warning(c, bitcast(stmt->getBeginLoc()), "TODO handle C CK_ToVoid"); |
| 1887 | return nullptr; | 1881 | return nullptr; |
| 1888 | case clang::CK_VectorSplat: | 1882 | case clang::CK_VectorSplat: |
| 1889 | emit_warning(c, stmt->getBeginLoc(), "TODO handle C CK_VectorSplat"); | 1883 | emit_warning(c, bitcast(stmt->getBeginLoc()), "TODO handle C CK_VectorSplat"); |
| 1890 | return nullptr; | 1884 | return nullptr; |
| 1891 | case clang::CK_IntegralToBoolean: | 1885 | case clang::CK_IntegralToBoolean: |
| 1892 | emit_warning(c, stmt->getBeginLoc(), "TODO handle C CK_IntegralToBoolean"); | 1886 | emit_warning(c, bitcast(stmt->getBeginLoc()), "TODO handle C CK_IntegralToBoolean"); |
| 1893 | return nullptr; | 1887 | return nullptr; |
| 1894 | case clang::CK_IntegralToFloating: | 1888 | case clang::CK_IntegralToFloating: |
| 1895 | emit_warning(c, stmt->getBeginLoc(), "TODO handle C CK_IntegralToFloating"); | 1889 | emit_warning(c, bitcast(stmt->getBeginLoc()), "TODO handle C CK_IntegralToFloating"); |
| 1896 | return nullptr; | 1890 | return nullptr; |
| 1897 | case clang::CK_FixedPointCast: | 1891 | case clang::CK_FixedPointCast: |
| 1898 | emit_warning(c, stmt->getBeginLoc(), "TODO handle C CK_FixedPointCast"); | 1892 | emit_warning(c, bitcast(stmt->getBeginLoc()), "TODO handle C CK_FixedPointCast"); |
| 1899 | return nullptr; | 1893 | return nullptr; |
| 1900 | case clang::CK_FixedPointToBoolean: | 1894 | case clang::CK_FixedPointToBoolean: |
| 1901 | emit_warning(c, stmt->getBeginLoc(), "TODO handle C CK_FixedPointToBoolean"); | 1895 | emit_warning(c, bitcast(stmt->getBeginLoc()), "TODO handle C CK_FixedPointToBoolean"); |
| 1902 | return nullptr; | 1896 | return nullptr; |
| 1903 | case clang::CK_FloatingToIntegral: | 1897 | case clang::CK_FloatingToIntegral: |
| 1904 | emit_warning(c, stmt->getBeginLoc(), "TODO handle C CK_FloatingToIntegral"); | 1898 | emit_warning(c, bitcast(stmt->getBeginLoc()), "TODO handle C CK_FloatingToIntegral"); |
| 1905 | return nullptr; | 1899 | return nullptr; |
| 1906 | case clang::CK_FloatingToBoolean: | 1900 | case clang::CK_FloatingToBoolean: |
| 1907 | emit_warning(c, stmt->getBeginLoc(), "TODO handle C CK_FloatingToBoolean"); | 1901 | emit_warning(c, bitcast(stmt->getBeginLoc()), "TODO handle C CK_FloatingToBoolean"); |
| 1908 | return nullptr; | 1902 | return nullptr; |
| 1909 | case clang::CK_BooleanToSignedIntegral: | 1903 | case clang::CK_BooleanToSignedIntegral: |
| 1910 | emit_warning(c, stmt->getBeginLoc(), "TODO handle C CK_BooleanToSignedIntegral"); | 1904 | emit_warning(c, bitcast(stmt->getBeginLoc()), "TODO handle C CK_BooleanToSignedIntegral"); |
| 1911 | return nullptr; | 1905 | return nullptr; |
| 1912 | case clang::CK_FloatingCast: | 1906 | case clang::CK_FloatingCast: |
| 1913 | emit_warning(c, stmt->getBeginLoc(), "TODO handle C CK_FloatingCast"); | 1907 | emit_warning(c, bitcast(stmt->getBeginLoc()), "TODO handle C CK_FloatingCast"); |
| 1914 | return nullptr; | 1908 | return nullptr; |
| 1915 | case clang::CK_CPointerToObjCPointerCast: | 1909 | case clang::CK_CPointerToObjCPointerCast: |
| 1916 | emit_warning(c, stmt->getBeginLoc(), "TODO handle C CK_CPointerToObjCPointerCast"); | 1910 | emit_warning(c, bitcast(stmt->getBeginLoc()), "TODO handle C CK_CPointerToObjCPointerCast"); |
| 1917 | return nullptr; | 1911 | return nullptr; |
| 1918 | case clang::CK_BlockPointerToObjCPointerCast: | 1912 | case clang::CK_BlockPointerToObjCPointerCast: |
| 1919 | emit_warning(c, stmt->getBeginLoc(), "TODO handle C CK_BlockPointerToObjCPointerCast"); | 1913 | emit_warning(c, bitcast(stmt->getBeginLoc()), "TODO handle C CK_BlockPointerToObjCPointerCast"); |
| 1920 | return nullptr; | 1914 | return nullptr; |
| 1921 | case clang::CK_AnyPointerToBlockPointerCast: | 1915 | case clang::CK_AnyPointerToBlockPointerCast: |
| 1922 | emit_warning(c, stmt->getBeginLoc(), "TODO handle C CK_AnyPointerToBlockPointerCast"); | 1916 | emit_warning(c, bitcast(stmt->getBeginLoc()), "TODO handle C CK_AnyPointerToBlockPointerCast"); |
| 1923 | return nullptr; | 1917 | return nullptr; |
| 1924 | case clang::CK_ObjCObjectLValueCast: | 1918 | case clang::CK_ObjCObjectLValueCast: |
| 1925 | emit_warning(c, stmt->getBeginLoc(), "TODO handle C CK_ObjCObjectLValueCast"); | 1919 | emit_warning(c, bitcast(stmt->getBeginLoc()), "TODO handle C CK_ObjCObjectLValueCast"); |
| 1926 | return nullptr; | 1920 | return nullptr; |
| 1927 | case clang::CK_FloatingRealToComplex: | 1921 | case clang::CK_FloatingRealToComplex: |
| 1928 | emit_warning(c, stmt->getBeginLoc(), "TODO handle C CK_FloatingRealToComplex"); | 1922 | emit_warning(c, bitcast(stmt->getBeginLoc()), "TODO handle C CK_FloatingRealToComplex"); |
| 1929 | return nullptr; | 1923 | return nullptr; |
| 1930 | case clang::CK_FloatingComplexToReal: | 1924 | case clang::CK_FloatingComplexToReal: |
| 1931 | emit_warning(c, stmt->getBeginLoc(), "TODO handle C CK_FloatingComplexToReal"); | 1925 | emit_warning(c, bitcast(stmt->getBeginLoc()), "TODO handle C CK_FloatingComplexToReal"); |
| 1932 | return nullptr; | 1926 | return nullptr; |
| 1933 | case clang::CK_FloatingComplexToBoolean: | 1927 | case clang::CK_FloatingComplexToBoolean: |
| 1934 | emit_warning(c, stmt->getBeginLoc(), "TODO handle C CK_FloatingComplexToBoolean"); | 1928 | emit_warning(c, bitcast(stmt->getBeginLoc()), "TODO handle C CK_FloatingComplexToBoolean"); |
| 1935 | return nullptr; | 1929 | return nullptr; |
| 1936 | case clang::CK_FloatingComplexCast: | 1930 | case clang::CK_FloatingComplexCast: |
| 1937 | emit_warning(c, stmt->getBeginLoc(), "TODO handle C CK_FloatingComplexCast"); | 1931 | emit_warning(c, bitcast(stmt->getBeginLoc()), "TODO handle C CK_FloatingComplexCast"); |
| 1938 | return nullptr; | 1932 | return nullptr; |
| 1939 | case clang::CK_FloatingComplexToIntegralComplex: | 1933 | case clang::CK_FloatingComplexToIntegralComplex: |
| 1940 | emit_warning(c, stmt->getBeginLoc(), "TODO handle C CK_FloatingComplexToIntegralComplex"); | 1934 | emit_warning(c, bitcast(stmt->getBeginLoc()), "TODO handle C CK_FloatingComplexToIntegralComplex"); |
| 1941 | return nullptr; | 1935 | return nullptr; |
| 1942 | case clang::CK_IntegralRealToComplex: | 1936 | case clang::CK_IntegralRealToComplex: |
| 1943 | emit_warning(c, stmt->getBeginLoc(), "TODO handle C CK_IntegralRealToComplex"); | 1937 | emit_warning(c, bitcast(stmt->getBeginLoc()), "TODO handle C CK_IntegralRealToComplex"); |
| 1944 | return nullptr; | 1938 | return nullptr; |
| 1945 | case clang::CK_IntegralComplexToReal: | 1939 | case clang::CK_IntegralComplexToReal: |
| 1946 | emit_warning(c, stmt->getBeginLoc(), "TODO handle C CK_IntegralComplexToReal"); | 1940 | emit_warning(c, bitcast(stmt->getBeginLoc()), "TODO handle C CK_IntegralComplexToReal"); |
| 1947 | return nullptr; | 1941 | return nullptr; |
| 1948 | case clang::CK_IntegralComplexToBoolean: | 1942 | case clang::CK_IntegralComplexToBoolean: |
| 1949 | emit_warning(c, stmt->getBeginLoc(), "TODO handle C CK_IntegralComplexToBoolean"); | 1943 | emit_warning(c, bitcast(stmt->getBeginLoc()), "TODO handle C CK_IntegralComplexToBoolean"); |
| 1950 | return nullptr; | 1944 | return nullptr; |
| 1951 | case clang::CK_IntegralComplexCast: | 1945 | case clang::CK_IntegralComplexCast: |
| 1952 | emit_warning(c, stmt->getBeginLoc(), "TODO handle C CK_IntegralComplexCast"); | 1946 | emit_warning(c, bitcast(stmt->getBeginLoc()), "TODO handle C CK_IntegralComplexCast"); |
| 1953 | return nullptr; | 1947 | return nullptr; |
| 1954 | case clang::CK_IntegralComplexToFloatingComplex: | 1948 | case clang::CK_IntegralComplexToFloatingComplex: |
| 1955 | emit_warning(c, stmt->getBeginLoc(), "TODO handle C CK_IntegralComplexToFloatingComplex"); | 1949 | emit_warning(c, bitcast(stmt->getBeginLoc()), "TODO handle C CK_IntegralComplexToFloatingComplex"); |
| 1956 | return nullptr; | 1950 | return nullptr; |
| 1957 | case clang::CK_ARCProduceObject: | 1951 | case clang::CK_ARCProduceObject: |
| 1958 | emit_warning(c, stmt->getBeginLoc(), "TODO handle C CK_ARCProduceObject"); | 1952 | emit_warning(c, bitcast(stmt->getBeginLoc()), "TODO handle C CK_ARCProduceObject"); |
| 1959 | return nullptr; | 1953 | return nullptr; |
| 1960 | case clang::CK_ARCConsumeObject: | 1954 | case clang::CK_ARCConsumeObject: |
| 1961 | emit_warning(c, stmt->getBeginLoc(), "TODO handle C CK_ARCConsumeObject"); | 1955 | emit_warning(c, bitcast(stmt->getBeginLoc()), "TODO handle C CK_ARCConsumeObject"); |
| 1962 | return nullptr; | 1956 | return nullptr; |
| 1963 | case clang::CK_ARCReclaimReturnedObject: | 1957 | case clang::CK_ARCReclaimReturnedObject: |
| 1964 | emit_warning(c, stmt->getBeginLoc(), "TODO handle C CK_ARCReclaimReturnedObject"); | 1958 | emit_warning(c, bitcast(stmt->getBeginLoc()), "TODO handle C CK_ARCReclaimReturnedObject"); |
| 1965 | return nullptr; | 1959 | return nullptr; |
| 1966 | case clang::CK_ARCExtendBlockObject: | 1960 | case clang::CK_ARCExtendBlockObject: |
| 1967 | emit_warning(c, stmt->getBeginLoc(), "TODO handle C CK_ARCExtendBlockObject"); | 1961 | emit_warning(c, bitcast(stmt->getBeginLoc()), "TODO handle C CK_ARCExtendBlockObject"); |
| 1968 | return nullptr; | 1962 | return nullptr; |
| 1969 | case clang::CK_AtomicToNonAtomic: | 1963 | case clang::CK_AtomicToNonAtomic: |
| 1970 | emit_warning(c, stmt->getBeginLoc(), "TODO handle C CK_AtomicToNonAtomic"); | 1964 | emit_warning(c, bitcast(stmt->getBeginLoc()), "TODO handle C CK_AtomicToNonAtomic"); |
| 1971 | return nullptr; | 1965 | return nullptr; |
| 1972 | case clang::CK_NonAtomicToAtomic: | 1966 | case clang::CK_NonAtomicToAtomic: |
| 1973 | emit_warning(c, stmt->getBeginLoc(), "TODO handle C CK_NonAtomicToAtomic"); | 1967 | emit_warning(c, bitcast(stmt->getBeginLoc()), "TODO handle C CK_NonAtomicToAtomic"); |
| 1974 | return nullptr; | 1968 | return nullptr; |
| 1975 | case clang::CK_CopyAndAutoreleaseBlockObject: | 1969 | case clang::CK_CopyAndAutoreleaseBlockObject: |
| 1976 | emit_warning(c, stmt->getBeginLoc(), "TODO handle C CK_CopyAndAutoreleaseBlockObject"); | 1970 | emit_warning(c, bitcast(stmt->getBeginLoc()), "TODO handle C CK_CopyAndAutoreleaseBlockObject"); |
| 1977 | return nullptr; | 1971 | return nullptr; |
| 1978 | case clang::CK_BuiltinFnToFnPtr: | 1972 | case clang::CK_BuiltinFnToFnPtr: |
| 1979 | emit_warning(c, stmt->getBeginLoc(), "TODO handle C CK_BuiltinFnToFnPtr"); | 1973 | emit_warning(c, bitcast(stmt->getBeginLoc()), "TODO handle C CK_BuiltinFnToFnPtr"); |
| 1980 | return nullptr; | 1974 | return nullptr; |
| 1981 | case clang::CK_ZeroToOCLOpaqueType: | 1975 | case clang::CK_ZeroToOCLOpaqueType: |
| 1982 | emit_warning(c, stmt->getBeginLoc(), "TODO handle C CK_ZeroToOCLOpaqueType"); | 1976 | emit_warning(c, bitcast(stmt->getBeginLoc()), "TODO handle C CK_ZeroToOCLOpaqueType"); |
| 1983 | return nullptr; | 1977 | return nullptr; |
| 1984 | case clang::CK_AddressSpaceConversion: | 1978 | case clang::CK_AddressSpaceConversion: |
| 1985 | emit_warning(c, stmt->getBeginLoc(), "TODO handle C CK_AddressSpaceConversion"); | 1979 | emit_warning(c, bitcast(stmt->getBeginLoc()), "TODO handle C CK_AddressSpaceConversion"); |
| 1986 | return nullptr; | 1980 | return nullptr; |
| 1987 | case clang::CK_IntToOCLSampler: | 1981 | case clang::CK_IntToOCLSampler: |
| 1988 | emit_warning(c, stmt->getBeginLoc(), "TODO handle C CK_IntToOCLSampler"); | 1982 | emit_warning(c, bitcast(stmt->getBeginLoc()), "TODO handle C CK_IntToOCLSampler"); |
| 1989 | return nullptr; | 1983 | return nullptr; |
| 1990 | } | 1984 | } |
| 1991 | zig_unreachable(); | 1985 | zig_unreachable(); |
| ... | @@ -1993,7 +1987,7 @@ static AstNode *trans_implicit_cast_expr(Context *c, ResultUsed result_used, Tra | ... | @@ -1993,7 +1987,7 @@ static AstNode *trans_implicit_cast_expr(Context *c, ResultUsed result_used, Tra |
| 1993 | | 1987 | |
| 1994 | static AstNode *trans_decl_ref_expr(Context *c, TransScope *scope, const clang::DeclRefExpr *stmt, TransLRValue lrval) { | 1988 | static AstNode *trans_decl_ref_expr(Context *c, TransScope *scope, const clang::DeclRefExpr *stmt, TransLRValue lrval) { |
| 1995 | const clang::ValueDecl *value_decl = stmt->getDecl(); | 1989 | const clang::ValueDecl *value_decl = stmt->getDecl(); |
| 1996 | Buf *c_symbol_name = buf_create_from_str(decl_name(value_decl)); | 1990 | Buf *c_symbol_name = buf_create_from_str(ZigClangDecl_getName_bytes_begin((const ZigClangDecl *)value_decl)); |
| 1997 | Buf *zig_symbol_name = trans_lookup_zig_symbol(c, scope, c_symbol_name); | 1991 | Buf *zig_symbol_name = trans_lookup_zig_symbol(c, scope, c_symbol_name); |
| 1998 | if (lrval == TransLValue) { | 1992 | if (lrval == TransLValue) { |
| 1999 | c->ptr_params.put(zig_symbol_name, true); | 1993 | c->ptr_params.put(zig_symbol_name, true); |
| ... | @@ -2148,7 +2142,7 @@ static AstNode *trans_unary_operator(Context *c, ResultUsed result_used, TransSc | ... | @@ -2148,7 +2142,7 @@ static AstNode *trans_unary_operator(Context *c, ResultUsed result_used, TransSc |
| 2148 | return trans_create_node_ptr_deref(c, unwrapped); | 2142 | return trans_create_node_ptr_deref(c, unwrapped); |
| 2149 | } | 2143 | } |
| 2150 | case clang::UO_Plus: | 2144 | case clang::UO_Plus: |
| 2151 | emit_warning(c, stmt->getBeginLoc(), "TODO handle C translation UO_Plus"); | 2145 | emit_warning(c, bitcast(stmt->getBeginLoc()), "TODO handle C translation UO_Plus"); |
| 2152 | return nullptr; | 2146 | return nullptr; |
| 2153 | case clang::UO_Minus: | 2147 | case clang::UO_Minus: |
| 2154 | { | 2148 | { |
| ... | @@ -2174,7 +2168,7 @@ static AstNode *trans_unary_operator(Context *c, ResultUsed result_used, TransSc | ... | @@ -2174,7 +2168,7 @@ static AstNode *trans_unary_operator(Context *c, ResultUsed result_used, TransSc |
| 2174 | node->data.bin_op_expr.bin_op = BinOpTypeSubWrap; | 2168 | node->data.bin_op_expr.bin_op = BinOpTypeSubWrap; |
| 2175 | return node; | 2169 | return node; |
| 2176 | } else { | 2170 | } else { |
| 2177 | emit_warning(c, stmt->getBeginLoc(), "C negation with non float non integer"); | 2171 | emit_warning(c, bitcast(stmt->getBeginLoc()), "C negation with non float non integer"); |
| 2178 | return nullptr; | 2172 | return nullptr; |
| 2179 | } | 2173 | } |
| 2180 | } | 2174 | } |
| ... | @@ -2197,15 +2191,15 @@ static AstNode *trans_unary_operator(Context *c, ResultUsed result_used, TransSc | ... | @@ -2197,15 +2191,15 @@ static AstNode *trans_unary_operator(Context *c, ResultUsed result_used, TransSc |
| 2197 | return trans_create_node_prefix_op(c, PrefixOpBoolNot, sub_node); | 2191 | return trans_create_node_prefix_op(c, PrefixOpBoolNot, sub_node); |
| 2198 | } | 2192 | } |
| 2199 | case clang::UO_Real: | 2193 | case clang::UO_Real: |
| 2200 | emit_warning(c, stmt->getBeginLoc(), "TODO handle C translation UO_Real"); | 2194 | emit_warning(c, bitcast(stmt->getBeginLoc()), "TODO handle C translation UO_Real"); |
| 2201 | return nullptr; | 2195 | return nullptr; |
| 2202 | case clang::UO_Imag: | 2196 | case clang::UO_Imag: |
| 2203 | emit_warning(c, stmt->getBeginLoc(), "TODO handle C translation UO_Imag"); | 2197 | emit_warning(c, bitcast(stmt->getBeginLoc()), "TODO handle C translation UO_Imag"); |
| 2204 | return nullptr; | 2198 | return nullptr; |
| 2205 | case clang::UO_Extension: | 2199 | case clang::UO_Extension: |
| 2206 | return trans_expr(c, result_used, scope, stmt->getSubExpr(), TransLValue); | 2200 | return trans_expr(c, result_used, scope, stmt->getSubExpr(), TransLValue); |
| 2207 | case clang::UO_Coawait: | 2201 | case clang::UO_Coawait: |
| 2208 | emit_warning(c, stmt->getBeginLoc(), "TODO handle C translation UO_Coawait"); | 2202 | emit_warning(c, bitcast(stmt->getBeginLoc()), "TODO handle C translation UO_Coawait"); |
| 2209 | return nullptr; | 2203 | return nullptr; |
| 2210 | } | 2204 | } |
| 2211 | zig_unreachable(); | 2205 | zig_unreachable(); |
| ... | @@ -2235,11 +2229,11 @@ static int trans_local_declaration(Context *c, TransScope *scope, const clang::D | ... | @@ -2235,11 +2229,11 @@ static int trans_local_declaration(Context *c, TransScope *scope, const clang::D |
| 2235 | } else { | 2229 | } else { |
| 2236 | init_node = trans_create_node(c, NodeTypeUndefinedLiteral); | 2230 | init_node = trans_create_node(c, NodeTypeUndefinedLiteral); |
| 2237 | } | 2231 | } |
| 2238 | AstNode *type_node = trans_qual_type(c, qual_type, stmt->getBeginLoc()); | 2232 | AstNode *type_node = trans_qual_type(c, qual_type, bitcast(stmt->getBeginLoc())); |
| 2239 | if (type_node == nullptr) | 2233 | if (type_node == nullptr) |
| 2240 | return ErrorUnexpected; | 2234 | return ErrorUnexpected; |
| 2241 | | 2235 | |
| 2242 | Buf *c_symbol_name = buf_create_from_str(decl_name(var_decl)); | 2236 | Buf *c_symbol_name = buf_create_from_str(ZigClangDecl_getName_bytes_begin((const ZigClangDecl *)var_decl)); |
| 2243 | | 2237 | |
| 2244 | TransScopeVar *var_scope = trans_scope_var_create(c, scope, c_symbol_name); | 2238 | TransScopeVar *var_scope = trans_scope_var_create(c, scope, c_symbol_name); |
| 2245 | scope = &var_scope->base; | 2239 | scope = &var_scope->base; |
| ... | @@ -2251,223 +2245,223 @@ static int trans_local_declaration(Context *c, TransScope *scope, const clang::D | ... | @@ -2251,223 +2245,223 @@ static int trans_local_declaration(Context *c, TransScope *scope, const clang::D |
| 2251 | continue; | 2245 | continue; |
| 2252 | } | 2246 | } |
| 2253 | case clang::Decl::AccessSpec: | 2247 | case clang::Decl::AccessSpec: |
| 2254 | emit_warning(c, stmt->getBeginLoc(), "TODO handle decl kind AccessSpec"); | 2248 | emit_warning(c, bitcast(stmt->getBeginLoc()), "TODO handle decl kind AccessSpec"); |
| 2255 | return ErrorUnexpected; | 2249 | return ErrorUnexpected; |
| 2256 | case clang::Decl::Block: | 2250 | case clang::Decl::Block: |
| 2257 | emit_warning(c, stmt->getBeginLoc(), "TODO handle C Block"); | 2251 | emit_warning(c, bitcast(stmt->getBeginLoc()), "TODO handle C Block"); |
| 2258 | return ErrorUnexpected; | 2252 | return ErrorUnexpected; |
| 2259 | case clang::Decl::Captured: | 2253 | case clang::Decl::Captured: |
| 2260 | emit_warning(c, stmt->getBeginLoc(), "TODO handle C Captured"); | 2254 | emit_warning(c, bitcast(stmt->getBeginLoc()), "TODO handle C Captured"); |
| 2261 | return ErrorUnexpected; | 2255 | return ErrorUnexpected; |
| 2262 | case clang::Decl::ClassScopeFunctionSpecialization: | 2256 | case clang::Decl::ClassScopeFunctionSpecialization: |
| 2263 | emit_warning(c, stmt->getBeginLoc(), "TODO handle C ClassScopeFunctionSpecialization"); | 2257 | emit_warning(c, bitcast(stmt->getBeginLoc()), "TODO handle C ClassScopeFunctionSpecialization"); |
| 2264 | return ErrorUnexpected; | 2258 | return ErrorUnexpected; |
| 2265 | case clang::Decl::Empty: | 2259 | case clang::Decl::Empty: |
| 2266 | emit_warning(c, stmt->getBeginLoc(), "TODO handle C Empty"); | 2260 | emit_warning(c, bitcast(stmt->getBeginLoc()), "TODO handle C Empty"); |
| 2267 | return ErrorUnexpected; | 2261 | return ErrorUnexpected; |
| 2268 | case clang::Decl::Export: | 2262 | case clang::Decl::Export: |
| 2269 | emit_warning(c, stmt->getBeginLoc(), "TODO handle C Export"); | 2263 | emit_warning(c, bitcast(stmt->getBeginLoc()), "TODO handle C Export"); |
| 2270 | return ErrorUnexpected; | 2264 | return ErrorUnexpected; |
| 2271 | case clang::Decl::ExternCContext: | 2265 | case clang::Decl::ExternCContext: |
| 2272 | emit_warning(c, stmt->getBeginLoc(), "TODO handle C ExternCContext"); | 2266 | emit_warning(c, bitcast(stmt->getBeginLoc()), "TODO handle C ExternCContext"); |
| 2273 | return ErrorUnexpected; | 2267 | return ErrorUnexpected; |
| 2274 | case clang::Decl::FileScopeAsm: | 2268 | case clang::Decl::FileScopeAsm: |
| 2275 | emit_warning(c, stmt->getBeginLoc(), "TODO handle C FileScopeAsm"); | 2269 | emit_warning(c, bitcast(stmt->getBeginLoc()), "TODO handle C FileScopeAsm"); |
| 2276 | return ErrorUnexpected; | 2270 | return ErrorUnexpected; |
| 2277 | case clang::Decl::Friend: | 2271 | case clang::Decl::Friend: |
| 2278 | emit_warning(c, stmt->getBeginLoc(), "TODO handle C Friend"); | 2272 | emit_warning(c, bitcast(stmt->getBeginLoc()), "TODO handle C Friend"); |
| 2279 | return ErrorUnexpected; | 2273 | return ErrorUnexpected; |
| 2280 | case clang::Decl::FriendTemplate: | 2274 | case clang::Decl::FriendTemplate: |
| 2281 | emit_warning(c, stmt->getBeginLoc(), "TODO handle C FriendTemplate"); | 2275 | emit_warning(c, bitcast(stmt->getBeginLoc()), "TODO handle C FriendTemplate"); |
| 2282 | return ErrorUnexpected; | 2276 | return ErrorUnexpected; |
| 2283 | case clang::Decl::Import: | 2277 | case clang::Decl::Import: |
| 2284 | emit_warning(c, stmt->getBeginLoc(), "TODO handle C Import"); | 2278 | emit_warning(c, bitcast(stmt->getBeginLoc()), "TODO handle C Import"); |
| 2285 | return ErrorUnexpected; | 2279 | return ErrorUnexpected; |
| 2286 | case clang::Decl::LinkageSpec: | 2280 | case clang::Decl::LinkageSpec: |
| 2287 | emit_warning(c, stmt->getBeginLoc(), "TODO handle C LinkageSpec"); | 2281 | emit_warning(c, bitcast(stmt->getBeginLoc()), "TODO handle C LinkageSpec"); |
| 2288 | return ErrorUnexpected; | 2282 | return ErrorUnexpected; |
| 2289 | case clang::Decl::Label: | 2283 | case clang::Decl::Label: |
| 2290 | emit_warning(c, stmt->getBeginLoc(), "TODO handle C Label"); | 2284 | emit_warning(c, bitcast(stmt->getBeginLoc()), "TODO handle C Label"); |
| 2291 | return ErrorUnexpected; | 2285 | return ErrorUnexpected; |
| 2292 | case clang::Decl::Namespace: | 2286 | case clang::Decl::Namespace: |
| 2293 | emit_warning(c, stmt->getBeginLoc(), "TODO handle C Namespace"); | 2287 | emit_warning(c, bitcast(stmt->getBeginLoc()), "TODO handle C Namespace"); |
| 2294 | return ErrorUnexpected; | 2288 | return ErrorUnexpected; |
| 2295 | case clang::Decl::NamespaceAlias: | 2289 | case clang::Decl::NamespaceAlias: |
| 2296 | emit_warning(c, stmt->getBeginLoc(), "TODO handle C NamespaceAlias"); | 2290 | emit_warning(c, bitcast(stmt->getBeginLoc()), "TODO handle C NamespaceAlias"); |
| 2297 | return ErrorUnexpected; | 2291 | return ErrorUnexpected; |
| 2298 | case clang::Decl::ObjCCompatibleAlias: | 2292 | case clang::Decl::ObjCCompatibleAlias: |
| 2299 | emit_warning(c, stmt->getBeginLoc(), "TODO handle C ObjCCompatibleAlias"); | 2293 | emit_warning(c, bitcast(stmt->getBeginLoc()), "TODO handle C ObjCCompatibleAlias"); |
| 2300 | return ErrorUnexpected; | 2294 | return ErrorUnexpected; |
| 2301 | case clang::Decl::ObjCCategory: | 2295 | case clang::Decl::ObjCCategory: |
| 2302 | emit_warning(c, stmt->getBeginLoc(), "TODO handle C ObjCCategory"); | 2296 | emit_warning(c, bitcast(stmt->getBeginLoc()), "TODO handle C ObjCCategory"); |
| 2303 | return ErrorUnexpected; | 2297 | return ErrorUnexpected; |
| 2304 | case clang::Decl::ObjCCategoryImpl: | 2298 | case clang::Decl::ObjCCategoryImpl: |
| 2305 | emit_warning(c, stmt->getBeginLoc(), "TODO handle C ObjCCategoryImpl"); | 2299 | emit_warning(c, bitcast(stmt->getBeginLoc()), "TODO handle C ObjCCategoryImpl"); |
| 2306 | return ErrorUnexpected; | 2300 | return ErrorUnexpected; |
| 2307 | case clang::Decl::ObjCImplementation: | 2301 | case clang::Decl::ObjCImplementation: |
| 2308 | emit_warning(c, stmt->getBeginLoc(), "TODO handle C ObjCImplementation"); | 2302 | emit_warning(c, bitcast(stmt->getBeginLoc()), "TODO handle C ObjCImplementation"); |
| 2309 | return ErrorUnexpected; | 2303 | return ErrorUnexpected; |
| 2310 | case clang::Decl::ObjCInterface: | 2304 | case clang::Decl::ObjCInterface: |
| 2311 | emit_warning(c, stmt->getBeginLoc(), "TODO handle C ObjCInterface"); | 2305 | emit_warning(c, bitcast(stmt->getBeginLoc()), "TODO handle C ObjCInterface"); |
| 2312 | return ErrorUnexpected; | 2306 | return ErrorUnexpected; |
| 2313 | case clang::Decl::ObjCProtocol: | 2307 | case clang::Decl::ObjCProtocol: |
| 2314 | emit_warning(c, stmt->getBeginLoc(), "TODO handle C ObjCProtocol"); | 2308 | emit_warning(c, bitcast(stmt->getBeginLoc()), "TODO handle C ObjCProtocol"); |
| 2315 | return ErrorUnexpected; | 2309 | return ErrorUnexpected; |
| 2316 | case clang::Decl::ObjCMethod: | 2310 | case clang::Decl::ObjCMethod: |
| 2317 | emit_warning(c, stmt->getBeginLoc(), "TODO handle C ObjCMethod"); | 2311 | emit_warning(c, bitcast(stmt->getBeginLoc()), "TODO handle C ObjCMethod"); |
| 2318 | return ErrorUnexpected; | 2312 | return ErrorUnexpected; |
| 2319 | case clang::Decl::ObjCProperty: | 2313 | case clang::Decl::ObjCProperty: |
| 2320 | emit_warning(c, stmt->getBeginLoc(), "TODO handle C ObjCProperty"); | 2314 | emit_warning(c, bitcast(stmt->getBeginLoc()), "TODO handle C ObjCProperty"); |
| 2321 | return ErrorUnexpected; | 2315 | return ErrorUnexpected; |
| 2322 | case clang::Decl::BuiltinTemplate: | 2316 | case clang::Decl::BuiltinTemplate: |
| 2323 | emit_warning(c, stmt->getBeginLoc(), "TODO handle C BuiltinTemplate"); | 2317 | emit_warning(c, bitcast(stmt->getBeginLoc()), "TODO handle C BuiltinTemplate"); |
| 2324 | return ErrorUnexpected; | 2318 | return ErrorUnexpected; |
| 2325 | case clang::Decl::ClassTemplate: | 2319 | case clang::Decl::ClassTemplate: |
| 2326 | emit_warning(c, stmt->getBeginLoc(), "TODO handle C ClassTemplate"); | 2320 | emit_warning(c, bitcast(stmt->getBeginLoc()), "TODO handle C ClassTemplate"); |
| 2327 | return ErrorUnexpected; | 2321 | return ErrorUnexpected; |
| 2328 | case clang::Decl::FunctionTemplate: | 2322 | case clang::Decl::FunctionTemplate: |
| 2329 | emit_warning(c, stmt->getBeginLoc(), "TODO handle C FunctionTemplate"); | 2323 | emit_warning(c, bitcast(stmt->getBeginLoc()), "TODO handle C FunctionTemplate"); |
| 2330 | return ErrorUnexpected; | 2324 | return ErrorUnexpected; |
| 2331 | case clang::Decl::TypeAliasTemplate: | 2325 | case clang::Decl::TypeAliasTemplate: |
| 2332 | emit_warning(c, stmt->getBeginLoc(), "TODO handle C TypeAliasTemplate"); | 2326 | emit_warning(c, bitcast(stmt->getBeginLoc()), "TODO handle C TypeAliasTemplate"); |
| 2333 | return ErrorUnexpected; | 2327 | return ErrorUnexpected; |
| 2334 | case clang::Decl::VarTemplate: | 2328 | case clang::Decl::VarTemplate: |
| 2335 | emit_warning(c, stmt->getBeginLoc(), "TODO handle C VarTemplate"); | 2329 | emit_warning(c, bitcast(stmt->getBeginLoc()), "TODO handle C VarTemplate"); |
| 2336 | return ErrorUnexpected; | 2330 | return ErrorUnexpected; |
| 2337 | case clang::Decl::TemplateTemplateParm: | 2331 | case clang::Decl::TemplateTemplateParm: |
| 2338 | emit_warning(c, stmt->getBeginLoc(), "TODO handle C TemplateTemplateParm"); | 2332 | emit_warning(c, bitcast(stmt->getBeginLoc()), "TODO handle C TemplateTemplateParm"); |
| 2339 | return ErrorUnexpected; | 2333 | return ErrorUnexpected; |
| 2340 | case clang::Decl::Enum: | 2334 | case clang::Decl::Enum: |
| 2341 | emit_warning(c, stmt->getBeginLoc(), "TODO handle C Enum"); | 2335 | emit_warning(c, bitcast(stmt->getBeginLoc()), "TODO handle C Enum"); |
| 2342 | return ErrorUnexpected; | 2336 | return ErrorUnexpected; |
| 2343 | case clang::Decl::Record: | 2337 | case clang::Decl::Record: |
| 2344 | emit_warning(c, stmt->getBeginLoc(), "TODO handle C Record"); | 2338 | emit_warning(c, bitcast(stmt->getBeginLoc()), "TODO handle C Record"); |
| 2345 | return ErrorUnexpected; | 2339 | return ErrorUnexpected; |
| 2346 | case clang::Decl::CXXRecord: | 2340 | case clang::Decl::CXXRecord: |
| 2347 | emit_warning(c, stmt->getBeginLoc(), "TODO handle C CXXRecord"); | 2341 | emit_warning(c, bitcast(stmt->getBeginLoc()), "TODO handle C CXXRecord"); |
| 2348 | return ErrorUnexpected; | 2342 | return ErrorUnexpected; |
| 2349 | case clang::Decl::ClassTemplateSpecialization: | 2343 | case clang::Decl::ClassTemplateSpecialization: |
| 2350 | emit_warning(c, stmt->getBeginLoc(), "TODO handle C ClassTemplateSpecialization"); | 2344 | emit_warning(c, bitcast(stmt->getBeginLoc()), "TODO handle C ClassTemplateSpecialization"); |
| 2351 | return ErrorUnexpected; | 2345 | return ErrorUnexpected; |
| 2352 | case clang::Decl::ClassTemplatePartialSpecialization: | 2346 | case clang::Decl::ClassTemplatePartialSpecialization: |
| 2353 | emit_warning(c, stmt->getBeginLoc(), "TODO handle C ClassTemplatePartialSpecialization"); | 2347 | emit_warning(c, bitcast(stmt->getBeginLoc()), "TODO handle C ClassTemplatePartialSpecialization"); |
| 2354 | return ErrorUnexpected; | 2348 | return ErrorUnexpected; |
| 2355 | case clang::Decl::TemplateTypeParm: | 2349 | case clang::Decl::TemplateTypeParm: |
| 2356 | emit_warning(c, stmt->getBeginLoc(), "TODO handle C TemplateTypeParm"); | 2350 | emit_warning(c, bitcast(stmt->getBeginLoc()), "TODO handle C TemplateTypeParm"); |
| 2357 | return ErrorUnexpected; | 2351 | return ErrorUnexpected; |
| 2358 | case clang::Decl::ObjCTypeParam: | 2352 | case clang::Decl::ObjCTypeParam: |
| 2359 | emit_warning(c, stmt->getBeginLoc(), "TODO handle C ObjCTypeParam"); | 2353 | emit_warning(c, bitcast(stmt->getBeginLoc()), "TODO handle C ObjCTypeParam"); |
| 2360 | return ErrorUnexpected; | 2354 | return ErrorUnexpected; |
| 2361 | case clang::Decl::TypeAlias: | 2355 | case clang::Decl::TypeAlias: |
| 2362 | emit_warning(c, stmt->getBeginLoc(), "TODO handle C TypeAlias"); | 2356 | emit_warning(c, bitcast(stmt->getBeginLoc()), "TODO handle C TypeAlias"); |
| 2363 | return ErrorUnexpected; | 2357 | return ErrorUnexpected; |
| 2364 | case clang::Decl::Typedef: | 2358 | case clang::Decl::Typedef: |
| 2365 | emit_warning(c, stmt->getBeginLoc(), "TODO handle C Typedef"); | 2359 | emit_warning(c, bitcast(stmt->getBeginLoc()), "TODO handle C Typedef"); |
| 2366 | return ErrorUnexpected; | 2360 | return ErrorUnexpected; |
| 2367 | case clang::Decl::UnresolvedUsingTypename: | 2361 | case clang::Decl::UnresolvedUsingTypename: |
| 2368 | emit_warning(c, stmt->getBeginLoc(), "TODO handle C UnresolvedUsingTypename"); | 2362 | emit_warning(c, bitcast(stmt->getBeginLoc()), "TODO handle C UnresolvedUsingTypename"); |
| 2369 | return ErrorUnexpected; | 2363 | return ErrorUnexpected; |
| 2370 | case clang::Decl::Using: | 2364 | case clang::Decl::Using: |
| 2371 | emit_warning(c, stmt->getBeginLoc(), "TODO handle C Using"); | 2365 | emit_warning(c, bitcast(stmt->getBeginLoc()), "TODO handle C Using"); |
| 2372 | return ErrorUnexpected; | 2366 | return ErrorUnexpected; |
| 2373 | case clang::Decl::UsingDirective: | 2367 | case clang::Decl::UsingDirective: |
| 2374 | emit_warning(c, stmt->getBeginLoc(), "TODO handle C UsingDirective"); | 2368 | emit_warning(c, bitcast(stmt->getBeginLoc()), "TODO handle C UsingDirective"); |
| 2375 | return ErrorUnexpected; | 2369 | return ErrorUnexpected; |
| 2376 | case clang::Decl::UsingPack: | 2370 | case clang::Decl::UsingPack: |
| 2377 | emit_warning(c, stmt->getBeginLoc(), "TODO handle C UsingPack"); | 2371 | emit_warning(c, bitcast(stmt->getBeginLoc()), "TODO handle C UsingPack"); |
| 2378 | return ErrorUnexpected; | 2372 | return ErrorUnexpected; |
| 2379 | case clang::Decl::UsingShadow: | 2373 | case clang::Decl::UsingShadow: |
| 2380 | emit_warning(c, stmt->getBeginLoc(), "TODO handle C UsingShadow"); | 2374 | emit_warning(c, bitcast(stmt->getBeginLoc()), "TODO handle C UsingShadow"); |
| 2381 | return ErrorUnexpected; | 2375 | return ErrorUnexpected; |
| 2382 | case clang::Decl::ConstructorUsingShadow: | 2376 | case clang::Decl::ConstructorUsingShadow: |
| 2383 | emit_warning(c, stmt->getBeginLoc(), "TODO handle C ConstructorUsingShadow"); | 2377 | emit_warning(c, bitcast(stmt->getBeginLoc()), "TODO handle C ConstructorUsingShadow"); |
| 2384 | return ErrorUnexpected; | 2378 | return ErrorUnexpected; |
| 2385 | case clang::Decl::Binding: | 2379 | case clang::Decl::Binding: |
| 2386 | emit_warning(c, stmt->getBeginLoc(), "TODO handle C Binding"); | 2380 | emit_warning(c, bitcast(stmt->getBeginLoc()), "TODO handle C Binding"); |
| 2387 | return ErrorUnexpected; | 2381 | return ErrorUnexpected; |
| 2388 | case clang::Decl::Field: | 2382 | case clang::Decl::Field: |
| 2389 | emit_warning(c, stmt->getBeginLoc(), "TODO handle C Field"); | 2383 | emit_warning(c, bitcast(stmt->getBeginLoc()), "TODO handle C Field"); |
| 2390 | return ErrorUnexpected; | 2384 | return ErrorUnexpected; |
| 2391 | case clang::Decl::ObjCAtDefsField: | 2385 | case clang::Decl::ObjCAtDefsField: |
| 2392 | emit_warning(c, stmt->getBeginLoc(), "TODO handle C ObjCAtDefsField"); | 2386 | emit_warning(c, bitcast(stmt->getBeginLoc()), "TODO handle C ObjCAtDefsField"); |
| 2393 | return ErrorUnexpected; | 2387 | return ErrorUnexpected; |
| 2394 | case clang::Decl::ObjCIvar: | 2388 | case clang::Decl::ObjCIvar: |
| 2395 | emit_warning(c, stmt->getBeginLoc(), "TODO handle C ObjCIvar"); | 2389 | emit_warning(c, bitcast(stmt->getBeginLoc()), "TODO handle C ObjCIvar"); |
| 2396 | return ErrorUnexpected; | 2390 | return ErrorUnexpected; |
| 2397 | case clang::Decl::Function: | 2391 | case clang::Decl::Function: |
| 2398 | emit_warning(c, stmt->getBeginLoc(), "TODO handle C Function"); | 2392 | emit_warning(c, bitcast(stmt->getBeginLoc()), "TODO handle C Function"); |
| 2399 | return ErrorUnexpected; | 2393 | return ErrorUnexpected; |
| 2400 | case clang::Decl::CXXDeductionGuide: | 2394 | case clang::Decl::CXXDeductionGuide: |
| 2401 | emit_warning(c, stmt->getBeginLoc(), "TODO handle C CXXDeductionGuide"); | 2395 | emit_warning(c, bitcast(stmt->getBeginLoc()), "TODO handle C CXXDeductionGuide"); |
| 2402 | return ErrorUnexpected; | 2396 | return ErrorUnexpected; |
| 2403 | case clang::Decl::CXXMethod: | 2397 | case clang::Decl::CXXMethod: |
| 2404 | emit_warning(c, stmt->getBeginLoc(), "TODO handle C CXXMethod"); | 2398 | emit_warning(c, bitcast(stmt->getBeginLoc()), "TODO handle C CXXMethod"); |
| 2405 | return ErrorUnexpected; | 2399 | return ErrorUnexpected; |
| 2406 | case clang::Decl::CXXConstructor: | 2400 | case clang::Decl::CXXConstructor: |
| 2407 | emit_warning(c, stmt->getBeginLoc(), "TODO handle C CXXConstructor"); | 2401 | emit_warning(c, bitcast(stmt->getBeginLoc()), "TODO handle C CXXConstructor"); |
| 2408 | return ErrorUnexpected; | 2402 | return ErrorUnexpected; |
| 2409 | case clang::Decl::CXXConversion: | 2403 | case clang::Decl::CXXConversion: |
| 2410 | emit_warning(c, stmt->getBeginLoc(), "TODO handle C CXXConversion"); | 2404 | emit_warning(c, bitcast(stmt->getBeginLoc()), "TODO handle C CXXConversion"); |
| 2411 | return ErrorUnexpected; | 2405 | return ErrorUnexpected; |
| 2412 | case clang::Decl::CXXDestructor: | 2406 | case clang::Decl::CXXDestructor: |
| 2413 | emit_warning(c, stmt->getBeginLoc(), "TODO handle C CXXDestructor"); | 2407 | emit_warning(c, bitcast(stmt->getBeginLoc()), "TODO handle C CXXDestructor"); |
| 2414 | return ErrorUnexpected; | 2408 | return ErrorUnexpected; |
| 2415 | case clang::Decl::MSProperty: | 2409 | case clang::Decl::MSProperty: |
| 2416 | emit_warning(c, stmt->getBeginLoc(), "TODO handle C MSProperty"); | 2410 | emit_warning(c, bitcast(stmt->getBeginLoc()), "TODO handle C MSProperty"); |
| 2417 | return ErrorUnexpected; | 2411 | return ErrorUnexpected; |
| 2418 | case clang::Decl::NonTypeTemplateParm: | 2412 | case clang::Decl::NonTypeTemplateParm: |
| 2419 | emit_warning(c, stmt->getBeginLoc(), "TODO handle C NonTypeTemplateParm"); | 2413 | emit_warning(c, bitcast(stmt->getBeginLoc()), "TODO handle C NonTypeTemplateParm"); |
| 2420 | return ErrorUnexpected; | 2414 | return ErrorUnexpected; |
| 2421 | case clang::Decl::Decomposition: | 2415 | case clang::Decl::Decomposition: |
| 2422 | emit_warning(c, stmt->getBeginLoc(), "TODO handle C Decomposition"); | 2416 | emit_warning(c, bitcast(stmt->getBeginLoc()), "TODO handle C Decomposition"); |
| 2423 | return ErrorUnexpected; | 2417 | return ErrorUnexpected; |
| 2424 | case clang::Decl::ImplicitParam: | 2418 | case clang::Decl::ImplicitParam: |
| 2425 | emit_warning(c, stmt->getBeginLoc(), "TODO handle C ImplicitParam"); | 2419 | emit_warning(c, bitcast(stmt->getBeginLoc()), "TODO handle C ImplicitParam"); |
| 2426 | return ErrorUnexpected; | 2420 | return ErrorUnexpected; |
| 2427 | case clang::Decl::OMPCapturedExpr: | 2421 | case clang::Decl::OMPCapturedExpr: |
| 2428 | emit_warning(c, stmt->getBeginLoc(), "TODO handle C OMPCapturedExpr"); | 2422 | emit_warning(c, bitcast(stmt->getBeginLoc()), "TODO handle C OMPCapturedExpr"); |
| 2429 | return ErrorUnexpected; | 2423 | return ErrorUnexpected; |
| 2430 | case clang::Decl::ParmVar: | 2424 | case clang::Decl::ParmVar: |
| 2431 | emit_warning(c, stmt->getBeginLoc(), "TODO handle C ParmVar"); | 2425 | emit_warning(c, bitcast(stmt->getBeginLoc()), "TODO handle C ParmVar"); |
| 2432 | return ErrorUnexpected; | 2426 | return ErrorUnexpected; |
| 2433 | case clang::Decl::VarTemplateSpecialization: | 2427 | case clang::Decl::VarTemplateSpecialization: |
| 2434 | emit_warning(c, stmt->getBeginLoc(), "TODO handle C VarTemplateSpecialization"); | 2428 | emit_warning(c, bitcast(stmt->getBeginLoc()), "TODO handle C VarTemplateSpecialization"); |
| 2435 | return ErrorUnexpected; | 2429 | return ErrorUnexpected; |
| 2436 | case clang::Decl::VarTemplatePartialSpecialization: | 2430 | case clang::Decl::VarTemplatePartialSpecialization: |
| 2437 | emit_warning(c, stmt->getBeginLoc(), "TODO handle C VarTemplatePartialSpecialization"); | 2431 | emit_warning(c, bitcast(stmt->getBeginLoc()), "TODO handle C VarTemplatePartialSpecialization"); |
| 2438 | return ErrorUnexpected; | 2432 | return ErrorUnexpected; |
| 2439 | case clang::Decl::EnumConstant: | 2433 | case clang::Decl::EnumConstant: |
| 2440 | emit_warning(c, stmt->getBeginLoc(), "TODO handle C EnumConstant"); | 2434 | emit_warning(c, bitcast(stmt->getBeginLoc()), "TODO handle C EnumConstant"); |
| 2441 | return ErrorUnexpected; | 2435 | return ErrorUnexpected; |
| 2442 | case clang::Decl::IndirectField: | 2436 | case clang::Decl::IndirectField: |
| 2443 | emit_warning(c, stmt->getBeginLoc(), "TODO handle C IndirectField"); | 2437 | emit_warning(c, bitcast(stmt->getBeginLoc()), "TODO handle C IndirectField"); |
| 2444 | return ErrorUnexpected; | 2438 | return ErrorUnexpected; |
| 2445 | case clang::Decl::OMPDeclareReduction: | 2439 | case clang::Decl::OMPDeclareReduction: |
| 2446 | emit_warning(c, stmt->getBeginLoc(), "TODO handle C OMPDeclareReduction"); | 2440 | emit_warning(c, bitcast(stmt->getBeginLoc()), "TODO handle C OMPDeclareReduction"); |
| 2447 | return ErrorUnexpected; | 2441 | return ErrorUnexpected; |
| 2448 | case clang::Decl::UnresolvedUsingValue: | 2442 | case clang::Decl::UnresolvedUsingValue: |
| 2449 | emit_warning(c, stmt->getBeginLoc(), "TODO handle C UnresolvedUsingValue"); | 2443 | emit_warning(c, bitcast(stmt->getBeginLoc()), "TODO handle C UnresolvedUsingValue"); |
| 2450 | return ErrorUnexpected; | 2444 | return ErrorUnexpected; |
| 2451 | case clang::Decl::OMPRequires: | 2445 | case clang::Decl::OMPRequires: |
| 2452 | emit_warning(c, stmt->getBeginLoc(), "TODO handle C OMPRequires"); | 2446 | emit_warning(c, bitcast(stmt->getBeginLoc()), "TODO handle C OMPRequires"); |
| 2453 | return ErrorUnexpected; | 2447 | return ErrorUnexpected; |
| 2454 | case clang::Decl::OMPThreadPrivate: | 2448 | case clang::Decl::OMPThreadPrivate: |
| 2455 | emit_warning(c, stmt->getBeginLoc(), "TODO handle C OMPThreadPrivate"); | 2449 | emit_warning(c, bitcast(stmt->getBeginLoc()), "TODO handle C OMPThreadPrivate"); |
| 2456 | return ErrorUnexpected; | 2450 | return ErrorUnexpected; |
| 2457 | case clang::Decl::ObjCPropertyImpl: | 2451 | case clang::Decl::ObjCPropertyImpl: |
| 2458 | emit_warning(c, stmt->getBeginLoc(), "TODO handle C ObjCPropertyImpl"); | 2452 | emit_warning(c, bitcast(stmt->getBeginLoc()), "TODO handle C ObjCPropertyImpl"); |
| 2459 | return ErrorUnexpected; | 2453 | return ErrorUnexpected; |
| 2460 | case clang::Decl::PragmaComment: | 2454 | case clang::Decl::PragmaComment: |
| 2461 | emit_warning(c, stmt->getBeginLoc(), "TODO handle C PragmaComment"); | 2455 | emit_warning(c, bitcast(stmt->getBeginLoc()), "TODO handle C PragmaComment"); |
| 2462 | return ErrorUnexpected; | 2456 | return ErrorUnexpected; |
| 2463 | case clang::Decl::PragmaDetectMismatch: | 2457 | case clang::Decl::PragmaDetectMismatch: |
| 2464 | emit_warning(c, stmt->getBeginLoc(), "TODO handle C PragmaDetectMismatch"); | 2458 | emit_warning(c, bitcast(stmt->getBeginLoc()), "TODO handle C PragmaDetectMismatch"); |
| 2465 | return ErrorUnexpected; | 2459 | return ErrorUnexpected; |
| 2466 | case clang::Decl::StaticAssert: | 2460 | case clang::Decl::StaticAssert: |
| 2467 | emit_warning(c, stmt->getBeginLoc(), "TODO handle C StaticAssert"); | 2461 | emit_warning(c, bitcast(stmt->getBeginLoc()), "TODO handle C StaticAssert"); |
| 2468 | return ErrorUnexpected; | 2462 | return ErrorUnexpected; |
| 2469 | case clang::Decl::TranslationUnit: | 2463 | case clang::Decl::TranslationUnit: |
| 2470 | emit_warning(c, stmt->getBeginLoc(), "TODO handle C TranslationUnit"); | 2464 | emit_warning(c, bitcast(stmt->getBeginLoc()), "TODO handle C TranslationUnit"); |
| 2471 | return ErrorUnexpected; | 2465 | return ErrorUnexpected; |
| 2472 | } | 2466 | } |
| 2473 | zig_unreachable(); | 2467 | zig_unreachable(); |
| ... | @@ -2689,7 +2683,7 @@ static AstNode *trans_bool_expr(Context *c, ResultUsed result_used, TransScope * | ... | @@ -2689,7 +2683,7 @@ static AstNode *trans_bool_expr(Context *c, ResultUsed result_used, TransScope * |
| 2689 | const clang::ElaboratedType *elaborated_ty = static_cast<const clang::ElaboratedType*>(ty); | 2683 | const clang::ElaboratedType *elaborated_ty = static_cast<const clang::ElaboratedType*>(ty); |
| 2690 | switch (elaborated_ty->getKeyword()) { | 2684 | switch (elaborated_ty->getKeyword()) { |
| 2691 | case clang::ETK_Enum: { | 2685 | case clang::ETK_Enum: { |
| 2692 | AstNode *enum_type = trans_qual_type(c, elaborated_ty->getNamedType(), expr->getBeginLoc()); | 2686 | AstNode *enum_type = trans_qual_type(c, elaborated_ty->getNamedType(), bitcast(expr->getBeginLoc())); |
| 2693 | return to_enum_zero_cmp(c, res, enum_type); | 2687 | return to_enum_zero_cmp(c, res, enum_type); |
| 2694 | } | 2688 | } |
| 2695 | case clang::ETK_Struct: | 2689 | case clang::ETK_Struct: |
| ... | @@ -2846,7 +2840,7 @@ static AstNode *trans_member_expr(Context *c, ResultUsed result_used, TransScope | ... | @@ -2846,7 +2840,7 @@ static AstNode *trans_member_expr(Context *c, ResultUsed result_used, TransScope |
| 2846 | container_node = trans_create_node_unwrap_null(c, container_node); | 2840 | container_node = trans_create_node_unwrap_null(c, container_node); |
| 2847 | } | 2841 | } |
| 2848 | | 2842 | |
| 2849 | const char *name = decl_name(stmt->getMemberDecl()); | 2843 | const char *name = ZigClangDecl_getName_bytes_begin((const ZigClangDecl *)stmt->getMemberDecl()); |
| 2850 | | 2844 | |
| 2851 | AstNode *node = trans_create_node_field_access_str(c, container_node, name); | 2845 | AstNode *node = trans_create_node_field_access_str(c, container_node, name); |
| 2852 | return maybe_suppress_result(c, result_used, node); | 2846 | return maybe_suppress_result(c, result_used, node); |
| ... | @@ -2875,7 +2869,7 @@ static AstNode *trans_c_style_cast_expr(Context *c, ResultUsed result_used, Tran | ... | @@ -2875,7 +2869,7 @@ static AstNode *trans_c_style_cast_expr(Context *c, ResultUsed result_used, Tran |
| 2875 | if (sub_expr_node == nullptr) | 2869 | if (sub_expr_node == nullptr) |
| 2876 | return nullptr; | 2870 | return nullptr; |
| 2877 | | 2871 | |
| 2878 | AstNode *cast = trans_c_cast(c, stmt->getBeginLoc(), stmt->getType(), stmt->getSubExpr()->getType(), sub_expr_node); | 2872 | AstNode *cast = trans_c_cast(c, bitcast(stmt->getBeginLoc()), stmt->getType(), stmt->getSubExpr()->getType(), sub_expr_node); |
| 2879 | if (cast == nullptr) | 2873 | if (cast == nullptr) |
| 2880 | return nullptr; | 2874 | return nullptr; |
| 2881 | | 2875 | |
| ... | @@ -2885,7 +2879,7 @@ static AstNode *trans_c_style_cast_expr(Context *c, ResultUsed result_used, Tran | ... | @@ -2885,7 +2879,7 @@ static AstNode *trans_c_style_cast_expr(Context *c, ResultUsed result_used, Tran |
| 2885 | static AstNode *trans_unary_expr_or_type_trait_expr(Context *c, ResultUsed result_used, | 2879 | static AstNode *trans_unary_expr_or_type_trait_expr(Context *c, ResultUsed result_used, |
| 2886 | TransScope *scope, const clang::UnaryExprOrTypeTraitExpr *stmt) | 2880 | TransScope *scope, const clang::UnaryExprOrTypeTraitExpr *stmt) |
| 2887 | { | 2881 | { |
| 2888 | AstNode *type_node = trans_qual_type(c, stmt->getTypeOfArgument(), stmt->getBeginLoc()); | 2882 | AstNode *type_node = trans_qual_type(c, stmt->getTypeOfArgument(), bitcast(stmt->getBeginLoc())); |
| 2889 | if (type_node == nullptr) | 2883 | if (type_node == nullptr) |
| 2890 | return nullptr; | 2884 | return nullptr; |
| 2891 | | 2885 | |
| ... | @@ -3092,7 +3086,7 @@ static int trans_switch_case(Context *c, TransScope *parent_scope, const clang:: | ... | @@ -3092,7 +3086,7 @@ static int trans_switch_case(Context *c, TransScope *parent_scope, const clang:: |
| 3092 | *out_node = nullptr; | 3086 | *out_node = nullptr; |
| 3093 | | 3087 | |
| 3094 | if (stmt->getRHS() != nullptr) { | 3088 | if (stmt->getRHS() != nullptr) { |
| 3095 | emit_warning(c, stmt->getBeginLoc(), "TODO support GNU switch case a ... b extension"); | 3089 | emit_warning(c, bitcast(stmt->getBeginLoc()), "TODO support GNU switch case a ... b extension"); |
| 3096 | return ErrorUnexpected; | 3090 | return ErrorUnexpected; |
| 3097 | } | 3091 | } |
| 3098 | | 3092 | |
| ... | @@ -3177,13 +3171,13 @@ static AstNode *trans_string_literal(Context *c, ResultUsed result_used, TransSc | ... | @@ -3177,13 +3171,13 @@ static AstNode *trans_string_literal(Context *c, ResultUsed result_used, TransSc |
| 3177 | return maybe_suppress_result(c, result_used, node); | 3171 | return maybe_suppress_result(c, result_used, node); |
| 3178 | } | 3172 | } |
| 3179 | case clang::StringLiteral::UTF16: | 3173 | case clang::StringLiteral::UTF16: |
| 3180 | emit_warning(c, stmt->getBeginLoc(), "TODO support UTF16 string literals"); | 3174 | emit_warning(c, bitcast(stmt->getBeginLoc()), "TODO support UTF16 string literals"); |
| 3181 | return nullptr; | 3175 | return nullptr; |
| 3182 | case clang::StringLiteral::UTF32: | 3176 | case clang::StringLiteral::UTF32: |
| 3183 | emit_warning(c, stmt->getBeginLoc(), "TODO support UTF32 string literals"); | 3177 | emit_warning(c, bitcast(stmt->getBeginLoc()), "TODO support UTF32 string literals"); |
| 3184 | return nullptr; | 3178 | return nullptr; |
| 3185 | case clang::StringLiteral::Wide: | 3179 | case clang::StringLiteral::Wide: |
| 3186 | emit_warning(c, stmt->getBeginLoc(), "TODO support wide string literals"); | 3180 | emit_warning(c, bitcast(stmt->getBeginLoc()), "TODO support wide string literals"); |
| 3187 | return nullptr; | 3181 | return nullptr; |
| 3188 | } | 3182 | } |
| 3189 | zig_unreachable(); | 3183 | zig_unreachable(); |
| ... | @@ -3328,505 +3322,505 @@ static int trans_stmt_extra(Context *c, TransScope *scope, const clang::Stmt *st | ... | @@ -3328,505 +3322,505 @@ static int trans_stmt_extra(Context *c, TransScope *scope, const clang::Stmt *st |
| 3328 | return wrap_stmt(out_node, out_child_scope, scope, | 3322 | return wrap_stmt(out_node, out_child_scope, scope, |
| 3329 | trans_stmt_expr(c, result_used, scope, (const clang::StmtExpr *)stmt, out_node_scope)); | 3323 | trans_stmt_expr(c, result_used, scope, (const clang::StmtExpr *)stmt, out_node_scope)); |
| 3330 | case clang::Stmt::NoStmtClass: | 3324 | case clang::Stmt::NoStmtClass: |
| 3331 | emit_warning(c, stmt->getBeginLoc(), "TODO handle C NoStmtClass"); | 3325 | emit_warning(c, bitcast(stmt->getBeginLoc()), "TODO handle C NoStmtClass"); |
| 3332 | return ErrorUnexpected; | 3326 | return ErrorUnexpected; |
| 3333 | case clang::Stmt::GCCAsmStmtClass: | 3327 | case clang::Stmt::GCCAsmStmtClass: |
| 3334 | emit_warning(c, stmt->getBeginLoc(), "TODO handle C GCCAsmStmtClass"); | 3328 | emit_warning(c, bitcast(stmt->getBeginLoc()), "TODO handle C GCCAsmStmtClass"); |
| 3335 | return ErrorUnexpected; | 3329 | return ErrorUnexpected; |
| 3336 | case clang::Stmt::MSAsmStmtClass: | 3330 | case clang::Stmt::MSAsmStmtClass: |
| 3337 | emit_warning(c, stmt->getBeginLoc(), "TODO handle C MSAsmStmtClass"); | 3331 | emit_warning(c, bitcast(stmt->getBeginLoc()), "TODO handle C MSAsmStmtClass"); |
| 3338 | return ErrorUnexpected; | 3332 | return ErrorUnexpected; |
| 3339 | case clang::Stmt::AttributedStmtClass: | 3333 | case clang::Stmt::AttributedStmtClass: |
| 3340 | emit_warning(c, stmt->getBeginLoc(), "TODO handle C AttributedStmtClass"); | 3334 | emit_warning(c, bitcast(stmt->getBeginLoc()), "TODO handle C AttributedStmtClass"); |
| 3341 | return ErrorUnexpected; | 3335 | return ErrorUnexpected; |
| 3342 | case clang::Stmt::CXXCatchStmtClass: | 3336 | case clang::Stmt::CXXCatchStmtClass: |
| 3343 | emit_warning(c, stmt->getBeginLoc(), "TODO handle C CXXCatchStmtClass"); | 3337 | emit_warning(c, bitcast(stmt->getBeginLoc()), "TODO handle C CXXCatchStmtClass"); |
| 3344 | return ErrorUnexpected; | 3338 | return ErrorUnexpected; |
| 3345 | case clang::Stmt::CXXForRangeStmtClass: | 3339 | case clang::Stmt::CXXForRangeStmtClass: |
| 3346 | emit_warning(c, stmt->getBeginLoc(), "TODO handle C CXXForRangeStmtClass"); | 3340 | emit_warning(c, bitcast(stmt->getBeginLoc()), "TODO handle C CXXForRangeStmtClass"); |
| 3347 | return ErrorUnexpected; | 3341 | return ErrorUnexpected; |
| 3348 | case clang::Stmt::CXXTryStmtClass: | 3342 | case clang::Stmt::CXXTryStmtClass: |
| 3349 | emit_warning(c, stmt->getBeginLoc(), "TODO handle C CXXTryStmtClass"); | 3343 | emit_warning(c, bitcast(stmt->getBeginLoc()), "TODO handle C CXXTryStmtClass"); |
| 3350 | return ErrorUnexpected; | 3344 | return ErrorUnexpected; |
| 3351 | case clang::Stmt::CapturedStmtClass: | 3345 | case clang::Stmt::CapturedStmtClass: |
| 3352 | emit_warning(c, stmt->getBeginLoc(), "TODO handle C CapturedStmtClass"); | 3346 | emit_warning(c, bitcast(stmt->getBeginLoc()), "TODO handle C CapturedStmtClass"); |
| 3353 | return ErrorUnexpected; | 3347 | return ErrorUnexpected; |
| 3354 | case clang::Stmt::CoreturnStmtClass: | 3348 | case clang::Stmt::CoreturnStmtClass: |
| 3355 | emit_warning(c, stmt->getBeginLoc(), "TODO handle C CoreturnStmtClass"); | 3349 | emit_warning(c, bitcast(stmt->getBeginLoc()), "TODO handle C CoreturnStmtClass"); |
| 3356 | return ErrorUnexpected; | 3350 | return ErrorUnexpected; |
| 3357 | case clang::Stmt::CoroutineBodyStmtClass: | 3351 | case clang::Stmt::CoroutineBodyStmtClass: |
| 3358 | emit_warning(c, stmt->getBeginLoc(), "TODO handle C CoroutineBodyStmtClass"); | 3352 | emit_warning(c, bitcast(stmt->getBeginLoc()), "TODO handle C CoroutineBodyStmtClass"); |
| 3359 | return ErrorUnexpected; | 3353 | return ErrorUnexpected; |
| 3360 | case clang::Stmt::BinaryConditionalOperatorClass: | 3354 | case clang::Stmt::BinaryConditionalOperatorClass: |
| 3361 | emit_warning(c, stmt->getBeginLoc(), "TODO handle C BinaryConditionalOperatorClass"); | 3355 | emit_warning(c, bitcast(stmt->getBeginLoc()), "TODO handle C BinaryConditionalOperatorClass"); |
| 3362 | return ErrorUnexpected; | 3356 | return ErrorUnexpected; |
| 3363 | case clang::Stmt::AddrLabelExprClass: | 3357 | case clang::Stmt::AddrLabelExprClass: |
| 3364 | emit_warning(c, stmt->getBeginLoc(), "TODO handle C AddrLabelExprClass"); | 3358 | emit_warning(c, bitcast(stmt->getBeginLoc()), "TODO handle C AddrLabelExprClass"); |
| 3365 | return ErrorUnexpected; | 3359 | return ErrorUnexpected; |
| 3366 | case clang::Stmt::ArrayInitIndexExprClass: | 3360 | case clang::Stmt::ArrayInitIndexExprClass: |
| 3367 | emit_warning(c, stmt->getBeginLoc(), "TODO handle C ArrayInitIndexExprClass"); | 3361 | emit_warning(c, bitcast(stmt->getBeginLoc()), "TODO handle C ArrayInitIndexExprClass"); |
| 3368 | return ErrorUnexpected; | 3362 | return ErrorUnexpected; |
| 3369 | case clang::Stmt::ArrayInitLoopExprClass: | 3363 | case clang::Stmt::ArrayInitLoopExprClass: |
| 3370 | emit_warning(c, stmt->getBeginLoc(), "TODO handle C ArrayInitLoopExprClass"); | 3364 | emit_warning(c, bitcast(stmt->getBeginLoc()), "TODO handle C ArrayInitLoopExprClass"); |
| 3371 | return ErrorUnexpected; | 3365 | return ErrorUnexpected; |
| 3372 | case clang::Stmt::ArrayTypeTraitExprClass: | 3366 | case clang::Stmt::ArrayTypeTraitExprClass: |
| 3373 | emit_warning(c, stmt->getBeginLoc(), "TODO handle C ArrayTypeTraitExprClass"); | 3367 | emit_warning(c, bitcast(stmt->getBeginLoc()), "TODO handle C ArrayTypeTraitExprClass"); |
| 3374 | return ErrorUnexpected; | 3368 | return ErrorUnexpected; |
| 3375 | case clang::Stmt::AsTypeExprClass: | 3369 | case clang::Stmt::AsTypeExprClass: |
| 3376 | emit_warning(c, stmt->getBeginLoc(), "TODO handle C AsTypeExprClass"); | 3370 | emit_warning(c, bitcast(stmt->getBeginLoc()), "TODO handle C AsTypeExprClass"); |
| 3377 | return ErrorUnexpected; | 3371 | return ErrorUnexpected; |
| 3378 | case clang::Stmt::AtomicExprClass: | 3372 | case clang::Stmt::AtomicExprClass: |
| 3379 | emit_warning(c, stmt->getBeginLoc(), "TODO handle C AtomicExprClass"); | 3373 | emit_warning(c, bitcast(stmt->getBeginLoc()), "TODO handle C AtomicExprClass"); |
| 3380 | return ErrorUnexpected; | 3374 | return ErrorUnexpected; |
| 3381 | case clang::Stmt::BlockExprClass: | 3375 | case clang::Stmt::BlockExprClass: |
| 3382 | emit_warning(c, stmt->getBeginLoc(), "TODO handle C BlockExprClass"); | 3376 | emit_warning(c, bitcast(stmt->getBeginLoc()), "TODO handle C BlockExprClass"); |
| 3383 | return ErrorUnexpected; | 3377 | return ErrorUnexpected; |
| 3384 | case clang::Stmt::CXXBindTemporaryExprClass: | 3378 | case clang::Stmt::CXXBindTemporaryExprClass: |
| 3385 | emit_warning(c, stmt->getBeginLoc(), "TODO handle C CXXBindTemporaryExprClass"); | 3379 | emit_warning(c, bitcast(stmt->getBeginLoc()), "TODO handle C CXXBindTemporaryExprClass"); |
| 3386 | return ErrorUnexpected; | 3380 | return ErrorUnexpected; |
| 3387 | case clang::Stmt::CXXBoolLiteralExprClass: | 3381 | case clang::Stmt::CXXBoolLiteralExprClass: |
| 3388 | emit_warning(c, stmt->getBeginLoc(), "TODO handle C CXXBoolLiteralExprClass"); | 3382 | emit_warning(c, bitcast(stmt->getBeginLoc()), "TODO handle C CXXBoolLiteralExprClass"); |
| 3389 | return ErrorUnexpected; | 3383 | return ErrorUnexpected; |
| 3390 | case clang::Stmt::CXXConstructExprClass: | 3384 | case clang::Stmt::CXXConstructExprClass: |
| 3391 | emit_warning(c, stmt->getBeginLoc(), "TODO handle C CXXConstructExprClass"); | 3385 | emit_warning(c, bitcast(stmt->getBeginLoc()), "TODO handle C CXXConstructExprClass"); |
| 3392 | return ErrorUnexpected; | 3386 | return ErrorUnexpected; |
| 3393 | case clang::Stmt::CXXTemporaryObjectExprClass: | 3387 | case clang::Stmt::CXXTemporaryObjectExprClass: |
| 3394 | emit_warning(c, stmt->getBeginLoc(), "TODO handle C CXXTemporaryObjectExprClass"); | 3388 | emit_warning(c, bitcast(stmt->getBeginLoc()), "TODO handle C CXXTemporaryObjectExprClass"); |
| 3395 | return ErrorUnexpected; | 3389 | return ErrorUnexpected; |
| 3396 | case clang::Stmt::CXXDefaultArgExprClass: | 3390 | case clang::Stmt::CXXDefaultArgExprClass: |
| 3397 | emit_warning(c, stmt->getBeginLoc(), "TODO handle C CXXDefaultArgExprClass"); | 3391 | emit_warning(c, bitcast(stmt->getBeginLoc()), "TODO handle C CXXDefaultArgExprClass"); |
| 3398 | return ErrorUnexpected; | 3392 | return ErrorUnexpected; |
| 3399 | case clang::Stmt::CXXDefaultInitExprClass: | 3393 | case clang::Stmt::CXXDefaultInitExprClass: |
| 3400 | emit_warning(c, stmt->getBeginLoc(), "TODO handle C CXXDefaultInitExprClass"); | 3394 | emit_warning(c, bitcast(stmt->getBeginLoc()), "TODO handle C CXXDefaultInitExprClass"); |
| 3401 | return ErrorUnexpected; | 3395 | return ErrorUnexpected; |
| 3402 | case clang::Stmt::CXXDeleteExprClass: | 3396 | case clang::Stmt::CXXDeleteExprClass: |
| 3403 | emit_warning(c, stmt->getBeginLoc(), "TODO handle C CXXDeleteExprClass"); | 3397 | emit_warning(c, bitcast(stmt->getBeginLoc()), "TODO handle C CXXDeleteExprClass"); |
| 3404 | return ErrorUnexpected; | 3398 | return ErrorUnexpected; |
| 3405 | case clang::Stmt::CXXDependentScopeMemberExprClass: | 3399 | case clang::Stmt::CXXDependentScopeMemberExprClass: |
| 3406 | emit_warning(c, stmt->getBeginLoc(), "TODO handle C CXXDependentScopeMemberExprClass"); | 3400 | emit_warning(c, bitcast(stmt->getBeginLoc()), "TODO handle C CXXDependentScopeMemberExprClass"); |
| 3407 | return ErrorUnexpected; | 3401 | return ErrorUnexpected; |
| 3408 | case clang::Stmt::CXXFoldExprClass: | 3402 | case clang::Stmt::CXXFoldExprClass: |
| 3409 | emit_warning(c, stmt->getBeginLoc(), "TODO handle C CXXFoldExprClass"); | 3403 | emit_warning(c, bitcast(stmt->getBeginLoc()), "TODO handle C CXXFoldExprClass"); |
| 3410 | return ErrorUnexpected; | 3404 | return ErrorUnexpected; |
| 3411 | case clang::Stmt::CXXInheritedCtorInitExprClass: | 3405 | case clang::Stmt::CXXInheritedCtorInitExprClass: |
| 3412 | emit_warning(c, stmt->getBeginLoc(), "TODO handle C CXXInheritedCtorInitExprClass"); | 3406 | emit_warning(c, bitcast(stmt->getBeginLoc()), "TODO handle C CXXInheritedCtorInitExprClass"); |
| 3413 | return ErrorUnexpected; | 3407 | return ErrorUnexpected; |
| 3414 | case clang::Stmt::CXXNewExprClass: | 3408 | case clang::Stmt::CXXNewExprClass: |
| 3415 | emit_warning(c, stmt->getBeginLoc(), "TODO handle C CXXNewExprClass"); | 3409 | emit_warning(c, bitcast(stmt->getBeginLoc()), "TODO handle C CXXNewExprClass"); |
| 3416 | return ErrorUnexpected; | 3410 | return ErrorUnexpected; |
| 3417 | case clang::Stmt::CXXNoexceptExprClass: | 3411 | case clang::Stmt::CXXNoexceptExprClass: |
| 3418 | emit_warning(c, stmt->getBeginLoc(), "TODO handle C CXXNoexceptExprClass"); | 3412 | emit_warning(c, bitcast(stmt->getBeginLoc()), "TODO handle C CXXNoexceptExprClass"); |
| 3419 | return ErrorUnexpected; | 3413 | return ErrorUnexpected; |
| 3420 | case clang::Stmt::CXXNullPtrLiteralExprClass: | 3414 | case clang::Stmt::CXXNullPtrLiteralExprClass: |
| 3421 | emit_warning(c, stmt->getBeginLoc(), "TODO handle C CXXNullPtrLiteralExprClass"); | 3415 | emit_warning(c, bitcast(stmt->getBeginLoc()), "TODO handle C CXXNullPtrLiteralExprClass"); |
| 3422 | return ErrorUnexpected; | 3416 | return ErrorUnexpected; |
| 3423 | case clang::Stmt::CXXPseudoDestructorExprClass: | 3417 | case clang::Stmt::CXXPseudoDestructorExprClass: |
| 3424 | emit_warning(c, stmt->getBeginLoc(), "TODO handle C CXXPseudoDestructorExprClass"); | 3418 | emit_warning(c, bitcast(stmt->getBeginLoc()), "TODO handle C CXXPseudoDestructorExprClass"); |
| 3425 | return ErrorUnexpected; | 3419 | return ErrorUnexpected; |
| 3426 | case clang::Stmt::CXXScalarValueInitExprClass: | 3420 | case clang::Stmt::CXXScalarValueInitExprClass: |
| 3427 | emit_warning(c, stmt->getBeginLoc(), "TODO handle C CXXScalarValueInitExprClass"); | 3421 | emit_warning(c, bitcast(stmt->getBeginLoc()), "TODO handle C CXXScalarValueInitExprClass"); |
| 3428 | return ErrorUnexpected; | 3422 | return ErrorUnexpected; |
| 3429 | case clang::Stmt::CXXStdInitializerListExprClass: | 3423 | case clang::Stmt::CXXStdInitializerListExprClass: |
| 3430 | emit_warning(c, stmt->getBeginLoc(), "TODO handle C CXXStdInitializerListExprClass"); | 3424 | emit_warning(c, bitcast(stmt->getBeginLoc()), "TODO handle C CXXStdInitializerListExprClass"); |
| 3431 | return ErrorUnexpected; | 3425 | return ErrorUnexpected; |
| 3432 | case clang::Stmt::CXXThisExprClass: | 3426 | case clang::Stmt::CXXThisExprClass: |
| 3433 | emit_warning(c, stmt->getBeginLoc(), "TODO handle C CXXThisExprClass"); | 3427 | emit_warning(c, bitcast(stmt->getBeginLoc()), "TODO handle C CXXThisExprClass"); |
| 3434 | return ErrorUnexpected; | 3428 | return ErrorUnexpected; |
| 3435 | case clang::Stmt::CXXThrowExprClass: | 3429 | case clang::Stmt::CXXThrowExprClass: |
| 3436 | emit_warning(c, stmt->getBeginLoc(), "TODO handle C CXXThrowExprClass"); | 3430 | emit_warning(c, bitcast(stmt->getBeginLoc()), "TODO handle C CXXThrowExprClass"); |
| 3437 | return ErrorUnexpected; | 3431 | return ErrorUnexpected; |
| 3438 | case clang::Stmt::CXXTypeidExprClass: | 3432 | case clang::Stmt::CXXTypeidExprClass: |
| 3439 | emit_warning(c, stmt->getBeginLoc(), "TODO handle C CXXTypeidExprClass"); | 3433 | emit_warning(c, bitcast(stmt->getBeginLoc()), "TODO handle C CXXTypeidExprClass"); |
| 3440 | return ErrorUnexpected; | 3434 | return ErrorUnexpected; |
| 3441 | case clang::Stmt::CXXUnresolvedConstructExprClass: | 3435 | case clang::Stmt::CXXUnresolvedConstructExprClass: |
| 3442 | emit_warning(c, stmt->getBeginLoc(), "TODO handle C CXXUnresolvedConstructExprClass"); | 3436 | emit_warning(c, bitcast(stmt->getBeginLoc()), "TODO handle C CXXUnresolvedConstructExprClass"); |
| 3443 | return ErrorUnexpected; | 3437 | return ErrorUnexpected; |
| 3444 | case clang::Stmt::CXXUuidofExprClass: | 3438 | case clang::Stmt::CXXUuidofExprClass: |
| 3445 | emit_warning(c, stmt->getBeginLoc(), "TODO handle C CXXUuidofExprClass"); | 3439 | emit_warning(c, bitcast(stmt->getBeginLoc()), "TODO handle C CXXUuidofExprClass"); |
| 3446 | return ErrorUnexpected; | 3440 | return ErrorUnexpected; |
| 3447 | case clang::Stmt::CUDAKernelCallExprClass: | 3441 | case clang::Stmt::CUDAKernelCallExprClass: |
| 3448 | emit_warning(c, stmt->getBeginLoc(), "TODO handle C CUDAKernelCallExprClass"); | 3442 | emit_warning(c, bitcast(stmt->getBeginLoc()), "TODO handle C CUDAKernelCallExprClass"); |
| 3449 | return ErrorUnexpected; | 3443 | return ErrorUnexpected; |
| 3450 | case clang::Stmt::CXXMemberCallExprClass: | 3444 | case clang::Stmt::CXXMemberCallExprClass: |
| 3451 | emit_warning(c, stmt->getBeginLoc(), "TODO handle C CXXMemberCallExprClass"); | 3445 | emit_warning(c, bitcast(stmt->getBeginLoc()), "TODO handle C CXXMemberCallExprClass"); |
| 3452 | return ErrorUnexpected; | 3446 | return ErrorUnexpected; |
| 3453 | case clang::Stmt::CXXOperatorCallExprClass: | 3447 | case clang::Stmt::CXXOperatorCallExprClass: |
| 3454 | emit_warning(c, stmt->getBeginLoc(), "TODO handle C CXXOperatorCallExprClass"); | 3448 | emit_warning(c, bitcast(stmt->getBeginLoc()), "TODO handle C CXXOperatorCallExprClass"); |
| 3455 | return ErrorUnexpected; | 3449 | return ErrorUnexpected; |
| 3456 | case clang::Stmt::UserDefinedLiteralClass: | 3450 | case clang::Stmt::UserDefinedLiteralClass: |
| 3457 | emit_warning(c, stmt->getBeginLoc(), "TODO handle C UserDefinedLiteralClass"); | 3451 | emit_warning(c, bitcast(stmt->getBeginLoc()), "TODO handle C UserDefinedLiteralClass"); |
| 3458 | return ErrorUnexpected; | 3452 | return ErrorUnexpected; |
| 3459 | case clang::Stmt::CXXFunctionalCastExprClass: | 3453 | case clang::Stmt::CXXFunctionalCastExprClass: |
| 3460 | emit_warning(c, stmt->getBeginLoc(), "TODO handle C CXXFunctionalCastExprClass"); | 3454 | emit_warning(c, bitcast(stmt->getBeginLoc()), "TODO handle C CXXFunctionalCastExprClass"); |
| 3461 | return ErrorUnexpected; | 3455 | return ErrorUnexpected; |
| 3462 | case clang::Stmt::CXXConstCastExprClass: | 3456 | case clang::Stmt::CXXConstCastExprClass: |
| 3463 | emit_warning(c, stmt->getBeginLoc(), "TODO handle C CXXConstCastExprClass"); | 3457 | emit_warning(c, bitcast(stmt->getBeginLoc()), "TODO handle C CXXConstCastExprClass"); |
| 3464 | return ErrorUnexpected; | 3458 | return ErrorUnexpected; |
| 3465 | case clang::Stmt::CXXDynamicCastExprClass: | 3459 | case clang::Stmt::CXXDynamicCastExprClass: |
| 3466 | emit_warning(c, stmt->getBeginLoc(), "TODO handle C CXXDynamicCastExprClass"); | 3460 | emit_warning(c, bitcast(stmt->getBeginLoc()), "TODO handle C CXXDynamicCastExprClass"); |
| 3467 | return ErrorUnexpected; | 3461 | return ErrorUnexpected; |
| 3468 | case clang::Stmt::CXXReinterpretCastExprClass: | 3462 | case clang::Stmt::CXXReinterpretCastExprClass: |
| 3469 | emit_warning(c, stmt->getBeginLoc(), "TODO handle C CXXReinterpretCastExprClass"); | 3463 | emit_warning(c, bitcast(stmt->getBeginLoc()), "TODO handle C CXXReinterpretCastExprClass"); |
| 3470 | return ErrorUnexpected; | 3464 | return ErrorUnexpected; |
| 3471 | case clang::Stmt::CXXStaticCastExprClass: | 3465 | case clang::Stmt::CXXStaticCastExprClass: |
| 3472 | emit_warning(c, stmt->getBeginLoc(), "TODO handle C CXXStaticCastExprClass"); | 3466 | emit_warning(c, bitcast(stmt->getBeginLoc()), "TODO handle C CXXStaticCastExprClass"); |
| 3473 | return ErrorUnexpected; | 3467 | return ErrorUnexpected; |
| 3474 | case clang::Stmt::ObjCBridgedCastExprClass: | 3468 | case clang::Stmt::ObjCBridgedCastExprClass: |
| 3475 | emit_warning(c, stmt->getBeginLoc(), "TODO handle C ObjCBridgedCastExprClass"); | 3469 | emit_warning(c, bitcast(stmt->getBeginLoc()), "TODO handle C ObjCBridgedCastExprClass"); |
| 3476 | return ErrorUnexpected; | 3470 | return ErrorUnexpected; |
| 3477 | case clang::Stmt::CharacterLiteralClass: | 3471 | case clang::Stmt::CharacterLiteralClass: |
| 3478 | emit_warning(c, stmt->getBeginLoc(), "TODO handle C CharacterLiteralClass"); | 3472 | emit_warning(c, bitcast(stmt->getBeginLoc()), "TODO handle C CharacterLiteralClass"); |
| 3479 | return ErrorUnexpected; | 3473 | return ErrorUnexpected; |
| 3480 | case clang::Stmt::ChooseExprClass: | 3474 | case clang::Stmt::ChooseExprClass: |
| 3481 | emit_warning(c, stmt->getBeginLoc(), "TODO handle C ChooseExprClass"); | 3475 | emit_warning(c, bitcast(stmt->getBeginLoc()), "TODO handle C ChooseExprClass"); |
| 3482 | return ErrorUnexpected; | 3476 | return ErrorUnexpected; |
| 3483 | case clang::Stmt::CompoundLiteralExprClass: | 3477 | case clang::Stmt::CompoundLiteralExprClass: |
| 3484 | emit_warning(c, stmt->getBeginLoc(), "TODO handle C CompoundLiteralExprClass"); | 3478 | emit_warning(c, bitcast(stmt->getBeginLoc()), "TODO handle C CompoundLiteralExprClass"); |
| 3485 | return ErrorUnexpected; | 3479 | return ErrorUnexpected; |
| 3486 | case clang::Stmt::ConvertVectorExprClass: | 3480 | case clang::Stmt::ConvertVectorExprClass: |
| 3487 | emit_warning(c, stmt->getBeginLoc(), "TODO handle C ConvertVectorExprClass"); | 3481 | emit_warning(c, bitcast(stmt->getBeginLoc()), "TODO handle C ConvertVectorExprClass"); |
| 3488 | return ErrorUnexpected; | 3482 | return ErrorUnexpected; |
| 3489 | case clang::Stmt::CoawaitExprClass: | 3483 | case clang::Stmt::CoawaitExprClass: |
| 3490 | emit_warning(c, stmt->getBeginLoc(), "TODO handle C CoawaitExprClass"); | 3484 | emit_warning(c, bitcast(stmt->getBeginLoc()), "TODO handle C CoawaitExprClass"); |
| 3491 | return ErrorUnexpected; | 3485 | return ErrorUnexpected; |
| 3492 | case clang::Stmt::CoyieldExprClass: | 3486 | case clang::Stmt::CoyieldExprClass: |
| 3493 | emit_warning(c, stmt->getBeginLoc(), "TODO handle C CoyieldExprClass"); | 3487 | emit_warning(c, bitcast(stmt->getBeginLoc()), "TODO handle C CoyieldExprClass"); |
| 3494 | return ErrorUnexpected; | 3488 | return ErrorUnexpected; |
| 3495 | case clang::Stmt::DependentCoawaitExprClass: | 3489 | case clang::Stmt::DependentCoawaitExprClass: |
| 3496 | emit_warning(c, stmt->getBeginLoc(), "TODO handle C DependentCoawaitExprClass"); | 3490 | emit_warning(c, bitcast(stmt->getBeginLoc()), "TODO handle C DependentCoawaitExprClass"); |
| 3497 | return ErrorUnexpected; | 3491 | return ErrorUnexpected; |
| 3498 | case clang::Stmt::DependentScopeDeclRefExprClass: | 3492 | case clang::Stmt::DependentScopeDeclRefExprClass: |
| 3499 | emit_warning(c, stmt->getBeginLoc(), "TODO handle C DependentScopeDeclRefExprClass"); | 3493 | emit_warning(c, bitcast(stmt->getBeginLoc()), "TODO handle C DependentScopeDeclRefExprClass"); |
| 3500 | return ErrorUnexpected; | 3494 | return ErrorUnexpected; |
| 3501 | case clang::Stmt::DesignatedInitExprClass: | 3495 | case clang::Stmt::DesignatedInitExprClass: |
| 3502 | emit_warning(c, stmt->getBeginLoc(), "TODO handle C DesignatedInitExprClass"); | 3496 | emit_warning(c, bitcast(stmt->getBeginLoc()), "TODO handle C DesignatedInitExprClass"); |
| 3503 | return ErrorUnexpected; | 3497 | return ErrorUnexpected; |
| 3504 | case clang::Stmt::DesignatedInitUpdateExprClass: | 3498 | case clang::Stmt::DesignatedInitUpdateExprClass: |
| 3505 | emit_warning(c, stmt->getBeginLoc(), "TODO handle C DesignatedInitUpdateExprClass"); | 3499 | emit_warning(c, bitcast(stmt->getBeginLoc()), "TODO handle C DesignatedInitUpdateExprClass"); |
| 3506 | return ErrorUnexpected; | 3500 | return ErrorUnexpected; |
| 3507 | case clang::Stmt::ExpressionTraitExprClass: | 3501 | case clang::Stmt::ExpressionTraitExprClass: |
| 3508 | emit_warning(c, stmt->getBeginLoc(), "TODO handle C ExpressionTraitExprClass"); | 3502 | emit_warning(c, bitcast(stmt->getBeginLoc()), "TODO handle C ExpressionTraitExprClass"); |
| 3509 | return ErrorUnexpected; | 3503 | return ErrorUnexpected; |
| 3510 | case clang::Stmt::ExtVectorElementExprClass: | 3504 | case clang::Stmt::ExtVectorElementExprClass: |
| 3511 | emit_warning(c, stmt->getBeginLoc(), "TODO handle C ExtVectorElementExprClass"); | 3505 | emit_warning(c, bitcast(stmt->getBeginLoc()), "TODO handle C ExtVectorElementExprClass"); |
| 3512 | return ErrorUnexpected; | 3506 | return ErrorUnexpected; |
| 3513 | case clang::Stmt::FixedPointLiteralClass: | 3507 | case clang::Stmt::FixedPointLiteralClass: |
| 3514 | emit_warning(c, stmt->getBeginLoc(), "TODO handle C FixedPointLiteralClass"); | 3508 | emit_warning(c, bitcast(stmt->getBeginLoc()), "TODO handle C FixedPointLiteralClass"); |
| 3515 | return ErrorUnexpected; | 3509 | return ErrorUnexpected; |
| 3516 | case clang::Stmt::FloatingLiteralClass: | 3510 | case clang::Stmt::FloatingLiteralClass: |
| 3517 | emit_warning(c, stmt->getBeginLoc(), "TODO handle C FloatingLiteralClass"); | 3511 | emit_warning(c, bitcast(stmt->getBeginLoc()), "TODO handle C FloatingLiteralClass"); |
| 3518 | return ErrorUnexpected; | 3512 | return ErrorUnexpected; |
| 3519 | case clang::Stmt::ExprWithCleanupsClass: | 3513 | case clang::Stmt::ExprWithCleanupsClass: |
| 3520 | emit_warning(c, stmt->getBeginLoc(), "TODO handle C ExprWithCleanupsClass"); | 3514 | emit_warning(c, bitcast(stmt->getBeginLoc()), "TODO handle C ExprWithCleanupsClass"); |
| 3521 | return ErrorUnexpected; | 3515 | return ErrorUnexpected; |
| 3522 | case clang::Stmt::FunctionParmPackExprClass: | 3516 | case clang::Stmt::FunctionParmPackExprClass: |
| 3523 | emit_warning(c, stmt->getBeginLoc(), "TODO handle C FunctionParmPackExprClass"); | 3517 | emit_warning(c, bitcast(stmt->getBeginLoc()), "TODO handle C FunctionParmPackExprClass"); |
| 3524 | return ErrorUnexpected; | 3518 | return ErrorUnexpected; |
| 3525 | case clang::Stmt::GNUNullExprClass: | 3519 | case clang::Stmt::GNUNullExprClass: |
| 3526 | emit_warning(c, stmt->getBeginLoc(), "TODO handle C GNUNullExprClass"); | 3520 | emit_warning(c, bitcast(stmt->getBeginLoc()), "TODO handle C GNUNullExprClass"); |
| 3527 | return ErrorUnexpected; | 3521 | return ErrorUnexpected; |
| 3528 | case clang::Stmt::GenericSelectionExprClass: | 3522 | case clang::Stmt::GenericSelectionExprClass: |
| 3529 | emit_warning(c, stmt->getBeginLoc(), "TODO handle C GenericSelectionExprClass"); | 3523 | emit_warning(c, bitcast(stmt->getBeginLoc()), "TODO handle C GenericSelectionExprClass"); |
| 3530 | return ErrorUnexpected; | 3524 | return ErrorUnexpected; |
| 3531 | case clang::Stmt::ImaginaryLiteralClass: | 3525 | case clang::Stmt::ImaginaryLiteralClass: |
| 3532 | emit_warning(c, stmt->getBeginLoc(), "TODO handle C ImaginaryLiteralClass"); | 3526 | emit_warning(c, bitcast(stmt->getBeginLoc()), "TODO handle C ImaginaryLiteralClass"); |
| 3533 | return ErrorUnexpected; | 3527 | return ErrorUnexpected; |
| 3534 | case clang::Stmt::ImplicitValueInitExprClass: | 3528 | case clang::Stmt::ImplicitValueInitExprClass: |
| 3535 | emit_warning(c, stmt->getBeginLoc(), "TODO handle C ImplicitValueInitExprClass"); | 3529 | emit_warning(c, bitcast(stmt->getBeginLoc()), "TODO handle C ImplicitValueInitExprClass"); |
| 3536 | return ErrorUnexpected; | 3530 | return ErrorUnexpected; |
| 3537 | case clang::Stmt::InitListExprClass: | 3531 | case clang::Stmt::InitListExprClass: |
| 3538 | emit_warning(c, stmt->getBeginLoc(), "TODO handle C InitListExprClass"); | 3532 | emit_warning(c, bitcast(stmt->getBeginLoc()), "TODO handle C InitListExprClass"); |
| 3539 | return ErrorUnexpected; | 3533 | return ErrorUnexpected; |
| 3540 | case clang::Stmt::LambdaExprClass: | 3534 | case clang::Stmt::LambdaExprClass: |
| 3541 | emit_warning(c, stmt->getBeginLoc(), "TODO handle C LambdaExprClass"); | 3535 | emit_warning(c, bitcast(stmt->getBeginLoc()), "TODO handle C LambdaExprClass"); |
| 3542 | return ErrorUnexpected; | 3536 | return ErrorUnexpected; |
| 3543 | case clang::Stmt::MSPropertyRefExprClass: | 3537 | case clang::Stmt::MSPropertyRefExprClass: |
| 3544 | emit_warning(c, stmt->getBeginLoc(), "TODO handle C MSPropertyRefExprClass"); | 3538 | emit_warning(c, bitcast(stmt->getBeginLoc()), "TODO handle C MSPropertyRefExprClass"); |
| 3545 | return ErrorUnexpected; | 3539 | return ErrorUnexpected; |
| 3546 | case clang::Stmt::MSPropertySubscriptExprClass: | 3540 | case clang::Stmt::MSPropertySubscriptExprClass: |
| 3547 | emit_warning(c, stmt->getBeginLoc(), "TODO handle C MSPropertySubscriptExprClass"); | 3541 | emit_warning(c, bitcast(stmt->getBeginLoc()), "TODO handle C MSPropertySubscriptExprClass"); |
| 3548 | return ErrorUnexpected; | 3542 | return ErrorUnexpected; |
| 3549 | case clang::Stmt::MaterializeTemporaryExprClass: | 3543 | case clang::Stmt::MaterializeTemporaryExprClass: |
| 3550 | emit_warning(c, stmt->getBeginLoc(), "TODO handle C MaterializeTemporaryExprClass"); | 3544 | emit_warning(c, bitcast(stmt->getBeginLoc()), "TODO handle C MaterializeTemporaryExprClass"); |
| 3551 | return ErrorUnexpected; | 3545 | return ErrorUnexpected; |
| 3552 | case clang::Stmt::NoInitExprClass: | 3546 | case clang::Stmt::NoInitExprClass: |
| 3553 | emit_warning(c, stmt->getBeginLoc(), "TODO handle C NoInitExprClass"); | 3547 | emit_warning(c, bitcast(stmt->getBeginLoc()), "TODO handle C NoInitExprClass"); |
| 3554 | return ErrorUnexpected; | 3548 | return ErrorUnexpected; |
| 3555 | case clang::Stmt::OMPArraySectionExprClass: | 3549 | case clang::Stmt::OMPArraySectionExprClass: |
| 3556 | emit_warning(c, stmt->getBeginLoc(), "TODO handle C OMPArraySectionExprClass"); | 3550 | emit_warning(c, bitcast(stmt->getBeginLoc()), "TODO handle C OMPArraySectionExprClass"); |
| 3557 | return ErrorUnexpected; | 3551 | return ErrorUnexpected; |
| 3558 | case clang::Stmt::ObjCArrayLiteralClass: | 3552 | case clang::Stmt::ObjCArrayLiteralClass: |
| 3559 | emit_warning(c, stmt->getBeginLoc(), "TODO handle C ObjCArrayLiteralClass"); | 3553 | emit_warning(c, bitcast(stmt->getBeginLoc()), "TODO handle C ObjCArrayLiteralClass"); |
| 3560 | return ErrorUnexpected; | 3554 | return ErrorUnexpected; |
| 3561 | case clang::Stmt::ObjCAvailabilityCheckExprClass: | 3555 | case clang::Stmt::ObjCAvailabilityCheckExprClass: |
| 3562 | emit_warning(c, stmt->getBeginLoc(), "TODO handle C ObjCAvailabilityCheckExprClass"); | 3556 | emit_warning(c, bitcast(stmt->getBeginLoc()), "TODO handle C ObjCAvailabilityCheckExprClass"); |
| 3563 | return ErrorUnexpected; | 3557 | return ErrorUnexpected; |
| 3564 | case clang::Stmt::ObjCBoolLiteralExprClass: | 3558 | case clang::Stmt::ObjCBoolLiteralExprClass: |
| 3565 | emit_warning(c, stmt->getBeginLoc(), "TODO handle C ObjCBoolLiteralExprClass"); | 3559 | emit_warning(c, bitcast(stmt->getBeginLoc()), "TODO handle C ObjCBoolLiteralExprClass"); |
| 3566 | return ErrorUnexpected; | 3560 | return ErrorUnexpected; |
| 3567 | case clang::Stmt::ObjCBoxedExprClass: | 3561 | case clang::Stmt::ObjCBoxedExprClass: |
| 3568 | emit_warning(c, stmt->getBeginLoc(), "TODO handle C ObjCBoxedExprClass"); | 3562 | emit_warning(c, bitcast(stmt->getBeginLoc()), "TODO handle C ObjCBoxedExprClass"); |
| 3569 | return ErrorUnexpected; | 3563 | return ErrorUnexpected; |
| 3570 | case clang::Stmt::ObjCDictionaryLiteralClass: | 3564 | case clang::Stmt::ObjCDictionaryLiteralClass: |
| 3571 | emit_warning(c, stmt->getBeginLoc(), "TODO handle C ObjCDictionaryLiteralClass"); | 3565 | emit_warning(c, bitcast(stmt->getBeginLoc()), "TODO handle C ObjCDictionaryLiteralClass"); |
| 3572 | return ErrorUnexpected; | 3566 | return ErrorUnexpected; |
| 3573 | case clang::Stmt::ObjCEncodeExprClass: | 3567 | case clang::Stmt::ObjCEncodeExprClass: |
| 3574 | emit_warning(c, stmt->getBeginLoc(), "TODO handle C ObjCEncodeExprClass"); | 3568 | emit_warning(c, bitcast(stmt->getBeginLoc()), "TODO handle C ObjCEncodeExprClass"); |
| 3575 | return ErrorUnexpected; | 3569 | return ErrorUnexpected; |
| 3576 | case clang::Stmt::ObjCIndirectCopyRestoreExprClass: | 3570 | case clang::Stmt::ObjCIndirectCopyRestoreExprClass: |
| 3577 | emit_warning(c, stmt->getBeginLoc(), "TODO handle C ObjCIndirectCopyRestoreExprClass"); | 3571 | emit_warning(c, bitcast(stmt->getBeginLoc()), "TODO handle C ObjCIndirectCopyRestoreExprClass"); |
| 3578 | return ErrorUnexpected; | 3572 | return ErrorUnexpected; |
| 3579 | case clang::Stmt::ObjCIsaExprClass: | 3573 | case clang::Stmt::ObjCIsaExprClass: |
| 3580 | emit_warning(c, stmt->getBeginLoc(), "TODO handle C ObjCIsaExprClass"); | 3574 | emit_warning(c, bitcast(stmt->getBeginLoc()), "TODO handle C ObjCIsaExprClass"); |
| 3581 | return ErrorUnexpected; | 3575 | return ErrorUnexpected; |
| 3582 | case clang::Stmt::ObjCIvarRefExprClass: | 3576 | case clang::Stmt::ObjCIvarRefExprClass: |
| 3583 | emit_warning(c, stmt->getBeginLoc(), "TODO handle C ObjCIvarRefExprClass"); | 3577 | emit_warning(c, bitcast(stmt->getBeginLoc()), "TODO handle C ObjCIvarRefExprClass"); |
| 3584 | return ErrorUnexpected; | 3578 | return ErrorUnexpected; |
| 3585 | case clang::Stmt::ObjCMessageExprClass: | 3579 | case clang::Stmt::ObjCMessageExprClass: |
| 3586 | emit_warning(c, stmt->getBeginLoc(), "TODO handle C ObjCMessageExprClass"); | 3580 | emit_warning(c, bitcast(stmt->getBeginLoc()), "TODO handle C ObjCMessageExprClass"); |
| 3587 | return ErrorUnexpected; | 3581 | return ErrorUnexpected; |
| 3588 | case clang::Stmt::ObjCPropertyRefExprClass: | 3582 | case clang::Stmt::ObjCPropertyRefExprClass: |
| 3589 | emit_warning(c, stmt->getBeginLoc(), "TODO handle C ObjCPropertyRefExprClass"); | 3583 | emit_warning(c, bitcast(stmt->getBeginLoc()), "TODO handle C ObjCPropertyRefExprClass"); |
| 3590 | return ErrorUnexpected; | 3584 | return ErrorUnexpected; |
| 3591 | case clang::Stmt::ObjCProtocolExprClass: | 3585 | case clang::Stmt::ObjCProtocolExprClass: |
| 3592 | emit_warning(c, stmt->getBeginLoc(), "TODO handle C ObjCProtocolExprClass"); | 3586 | emit_warning(c, bitcast(stmt->getBeginLoc()), "TODO handle C ObjCProtocolExprClass"); |
| 3593 | return ErrorUnexpected; | 3587 | return ErrorUnexpected; |
| 3594 | case clang::Stmt::ObjCSelectorExprClass: | 3588 | case clang::Stmt::ObjCSelectorExprClass: |
| 3595 | emit_warning(c, stmt->getBeginLoc(), "TODO handle C ObjCSelectorExprClass"); | 3589 | emit_warning(c, bitcast(stmt->getBeginLoc()), "TODO handle C ObjCSelectorExprClass"); |
| 3596 | return ErrorUnexpected; | 3590 | return ErrorUnexpected; |
| 3597 | case clang::Stmt::ObjCStringLiteralClass: | 3591 | case clang::Stmt::ObjCStringLiteralClass: |
| 3598 | emit_warning(c, stmt->getBeginLoc(), "TODO handle C ObjCStringLiteralClass"); | 3592 | emit_warning(c, bitcast(stmt->getBeginLoc()), "TODO handle C ObjCStringLiteralClass"); |
| 3599 | return ErrorUnexpected; | 3593 | return ErrorUnexpected; |
| 3600 | case clang::Stmt::ObjCSubscriptRefExprClass: | 3594 | case clang::Stmt::ObjCSubscriptRefExprClass: |
| 3601 | emit_warning(c, stmt->getBeginLoc(), "TODO handle C ObjCSubscriptRefExprClass"); | 3595 | emit_warning(c, bitcast(stmt->getBeginLoc()), "TODO handle C ObjCSubscriptRefExprClass"); |
| 3602 | return ErrorUnexpected; | 3596 | return ErrorUnexpected; |
| 3603 | case clang::Stmt::OffsetOfExprClass: | 3597 | case clang::Stmt::OffsetOfExprClass: |
| 3604 | emit_warning(c, stmt->getBeginLoc(), "TODO handle C OffsetOfExprClass"); | 3598 | emit_warning(c, bitcast(stmt->getBeginLoc()), "TODO handle C OffsetOfExprClass"); |
| 3605 | return ErrorUnexpected; | 3599 | return ErrorUnexpected; |
| 3606 | case clang::Stmt::OpaqueValueExprClass: | 3600 | case clang::Stmt::OpaqueValueExprClass: |
| 3607 | emit_warning(c, stmt->getBeginLoc(), "TODO handle C OpaqueValueExprClass"); | 3601 | emit_warning(c, bitcast(stmt->getBeginLoc()), "TODO handle C OpaqueValueExprClass"); |
| 3608 | return ErrorUnexpected; | 3602 | return ErrorUnexpected; |
| 3609 | case clang::Stmt::UnresolvedLookupExprClass: | 3603 | case clang::Stmt::UnresolvedLookupExprClass: |
| 3610 | emit_warning(c, stmt->getBeginLoc(), "TODO handle C UnresolvedLookupExprClass"); | 3604 | emit_warning(c, bitcast(stmt->getBeginLoc()), "TODO handle C UnresolvedLookupExprClass"); |
| 3611 | return ErrorUnexpected; | 3605 | return ErrorUnexpected; |
| 3612 | case clang::Stmt::UnresolvedMemberExprClass: | 3606 | case clang::Stmt::UnresolvedMemberExprClass: |
| 3613 | emit_warning(c, stmt->getBeginLoc(), "TODO handle C UnresolvedMemberExprClass"); | 3607 | emit_warning(c, bitcast(stmt->getBeginLoc()), "TODO handle C UnresolvedMemberExprClass"); |
| 3614 | return ErrorUnexpected; | 3608 | return ErrorUnexpected; |
| 3615 | case clang::Stmt::PackExpansionExprClass: | 3609 | case clang::Stmt::PackExpansionExprClass: |
| 3616 | emit_warning(c, stmt->getBeginLoc(), "TODO handle C PackExpansionExprClass"); | 3610 | emit_warning(c, bitcast(stmt->getBeginLoc()), "TODO handle C PackExpansionExprClass"); |
| 3617 | return ErrorUnexpected; | 3611 | return ErrorUnexpected; |
| 3618 | case clang::Stmt::ParenListExprClass: | 3612 | case clang::Stmt::ParenListExprClass: |
| 3619 | emit_warning(c, stmt->getBeginLoc(), "TODO handle C ParenListExprClass"); | 3613 | emit_warning(c, bitcast(stmt->getBeginLoc()), "TODO handle C ParenListExprClass"); |
| 3620 | return ErrorUnexpected; | 3614 | return ErrorUnexpected; |
| 3621 | case clang::Stmt::PseudoObjectExprClass: | 3615 | case clang::Stmt::PseudoObjectExprClass: |
| 3622 | emit_warning(c, stmt->getBeginLoc(), "TODO handle C PseudoObjectExprClass"); | 3616 | emit_warning(c, bitcast(stmt->getBeginLoc()), "TODO handle C PseudoObjectExprClass"); |
| 3623 | return ErrorUnexpected; | 3617 | return ErrorUnexpected; |
| 3624 | case clang::Stmt::ShuffleVectorExprClass: | 3618 | case clang::Stmt::ShuffleVectorExprClass: |
| 3625 | emit_warning(c, stmt->getBeginLoc(), "TODO handle C ShuffleVectorExprClass"); | 3619 | emit_warning(c, bitcast(stmt->getBeginLoc()), "TODO handle C ShuffleVectorExprClass"); |
| 3626 | return ErrorUnexpected; | 3620 | return ErrorUnexpected; |
| 3627 | case clang::Stmt::SizeOfPackExprClass: | 3621 | case clang::Stmt::SizeOfPackExprClass: |
| 3628 | emit_warning(c, stmt->getBeginLoc(), "TODO handle C SizeOfPackExprClass"); | 3622 | emit_warning(c, bitcast(stmt->getBeginLoc()), "TODO handle C SizeOfPackExprClass"); |
| 3629 | return ErrorUnexpected; | 3623 | return ErrorUnexpected; |
| 3630 | case clang::Stmt::SubstNonTypeTemplateParmExprClass: | 3624 | case clang::Stmt::SubstNonTypeTemplateParmExprClass: |
| 3631 | emit_warning(c, stmt->getBeginLoc(), "TODO handle C SubstNonTypeTemplateParmExprClass"); | 3625 | emit_warning(c, bitcast(stmt->getBeginLoc()), "TODO handle C SubstNonTypeTemplateParmExprClass"); |
| 3632 | return ErrorUnexpected; | 3626 | return ErrorUnexpected; |
| 3633 | case clang::Stmt::SubstNonTypeTemplateParmPackExprClass: | 3627 | case clang::Stmt::SubstNonTypeTemplateParmPackExprClass: |
| 3634 | emit_warning(c, stmt->getBeginLoc(), "TODO handle C SubstNonTypeTemplateParmPackExprClass"); | 3628 | emit_warning(c, bitcast(stmt->getBeginLoc()), "TODO handle C SubstNonTypeTemplateParmPackExprClass"); |
| 3635 | return ErrorUnexpected; | 3629 | return ErrorUnexpected; |
| 3636 | case clang::Stmt::TypeTraitExprClass: | 3630 | case clang::Stmt::TypeTraitExprClass: |
| 3637 | emit_warning(c, stmt->getBeginLoc(), "TODO handle C TypeTraitExprClass"); | 3631 | emit_warning(c, bitcast(stmt->getBeginLoc()), "TODO handle C TypeTraitExprClass"); |
| 3638 | return ErrorUnexpected; | 3632 | return ErrorUnexpected; |
| 3639 | case clang::Stmt::TypoExprClass: | 3633 | case clang::Stmt::TypoExprClass: |
| 3640 | emit_warning(c, stmt->getBeginLoc(), "TODO handle C TypoExprClass"); | 3634 | emit_warning(c, bitcast(stmt->getBeginLoc()), "TODO handle C TypoExprClass"); |
| 3641 | return ErrorUnexpected; | 3635 | return ErrorUnexpected; |
| 3642 | case clang::Stmt::VAArgExprClass: | 3636 | case clang::Stmt::VAArgExprClass: |
| 3643 | emit_warning(c, stmt->getBeginLoc(), "TODO handle C VAArgExprClass"); | 3637 | emit_warning(c, bitcast(stmt->getBeginLoc()), "TODO handle C VAArgExprClass"); |
| 3644 | return ErrorUnexpected; | 3638 | return ErrorUnexpected; |
| 3645 | case clang::Stmt::GotoStmtClass: | 3639 | case clang::Stmt::GotoStmtClass: |
| 3646 | emit_warning(c, stmt->getBeginLoc(), "TODO handle C GotoStmtClass"); | 3640 | emit_warning(c, bitcast(stmt->getBeginLoc()), "TODO handle C GotoStmtClass"); |
| 3647 | return ErrorUnexpected; | 3641 | return ErrorUnexpected; |
| 3648 | case clang::Stmt::IndirectGotoStmtClass: | 3642 | case clang::Stmt::IndirectGotoStmtClass: |
| 3649 | emit_warning(c, stmt->getBeginLoc(), "TODO handle C IndirectGotoStmtClass"); | 3643 | emit_warning(c, bitcast(stmt->getBeginLoc()), "TODO handle C IndirectGotoStmtClass"); |
| 3650 | return ErrorUnexpected; | 3644 | return ErrorUnexpected; |
| 3651 | case clang::Stmt::LabelStmtClass: | 3645 | case clang::Stmt::LabelStmtClass: |
| 3652 | emit_warning(c, stmt->getBeginLoc(), "TODO handle C LabelStmtClass"); | 3646 | emit_warning(c, bitcast(stmt->getBeginLoc()), "TODO handle C LabelStmtClass"); |
| 3653 | return ErrorUnexpected; | 3647 | return ErrorUnexpected; |
| 3654 | case clang::Stmt::MSDependentExistsStmtClass: | 3648 | case clang::Stmt::MSDependentExistsStmtClass: |
| 3655 | emit_warning(c, stmt->getBeginLoc(), "TODO handle C MSDependentExistsStmtClass"); | 3649 | emit_warning(c, bitcast(stmt->getBeginLoc()), "TODO handle C MSDependentExistsStmtClass"); |
| 3656 | return ErrorUnexpected; | 3650 | return ErrorUnexpected; |
| 3657 | case clang::Stmt::OMPAtomicDirectiveClass: | 3651 | case clang::Stmt::OMPAtomicDirectiveClass: |
| 3658 | emit_warning(c, stmt->getBeginLoc(), "TODO handle C OMPAtomicDirectiveClass"); | 3652 | emit_warning(c, bitcast(stmt->getBeginLoc()), "TODO handle C OMPAtomicDirectiveClass"); |
| 3659 | return ErrorUnexpected; | 3653 | return ErrorUnexpected; |
| 3660 | case clang::Stmt::OMPBarrierDirectiveClass: | 3654 | case clang::Stmt::OMPBarrierDirectiveClass: |
| 3661 | emit_warning(c, stmt->getBeginLoc(), "TODO handle C OMPBarrierDirectiveClass"); | 3655 | emit_warning(c, bitcast(stmt->getBeginLoc()), "TODO handle C OMPBarrierDirectiveClass"); |
| 3662 | return ErrorUnexpected; | 3656 | return ErrorUnexpected; |
| 3663 | case clang::Stmt::OMPCancelDirectiveClass: | 3657 | case clang::Stmt::OMPCancelDirectiveClass: |
| 3664 | emit_warning(c, stmt->getBeginLoc(), "TODO handle C OMPCancelDirectiveClass"); | 3658 | emit_warning(c, bitcast(stmt->getBeginLoc()), "TODO handle C OMPCancelDirectiveClass"); |
| 3665 | return ErrorUnexpected; | 3659 | return ErrorUnexpected; |
| 3666 | case clang::Stmt::OMPCancellationPointDirectiveClass: | 3660 | case clang::Stmt::OMPCancellationPointDirectiveClass: |
| 3667 | emit_warning(c, stmt->getBeginLoc(), "TODO handle C OMPCancellationPointDirectiveClass"); | 3661 | emit_warning(c, bitcast(stmt->getBeginLoc()), "TODO handle C OMPCancellationPointDirectiveClass"); |
| 3668 | return ErrorUnexpected; | 3662 | return ErrorUnexpected; |
| 3669 | case clang::Stmt::OMPCriticalDirectiveClass: | 3663 | case clang::Stmt::OMPCriticalDirectiveClass: |
| 3670 | emit_warning(c, stmt->getBeginLoc(), "TODO handle C OMPCriticalDirectiveClass"); | 3664 | emit_warning(c, bitcast(stmt->getBeginLoc()), "TODO handle C OMPCriticalDirectiveClass"); |
| 3671 | return ErrorUnexpected; | 3665 | return ErrorUnexpected; |
| 3672 | case clang::Stmt::OMPFlushDirectiveClass: | 3666 | case clang::Stmt::OMPFlushDirectiveClass: |
| 3673 | emit_warning(c, stmt->getBeginLoc(), "TODO handle C OMPFlushDirectiveClass"); | 3667 | emit_warning(c, bitcast(stmt->getBeginLoc()), "TODO handle C OMPFlushDirectiveClass"); |
| 3674 | return ErrorUnexpected; | 3668 | return ErrorUnexpected; |
| 3675 | case clang::Stmt::OMPDistributeDirectiveClass: | 3669 | case clang::Stmt::OMPDistributeDirectiveClass: |
| 3676 | emit_warning(c, stmt->getBeginLoc(), "TODO handle C OMPDistributeDirectiveClass"); | 3670 | emit_warning(c, bitcast(stmt->getBeginLoc()), "TODO handle C OMPDistributeDirectiveClass"); |
| 3677 | return ErrorUnexpected; | 3671 | return ErrorUnexpected; |
| 3678 | case clang::Stmt::OMPDistributeParallelForDirectiveClass: | 3672 | case clang::Stmt::OMPDistributeParallelForDirectiveClass: |
| 3679 | emit_warning(c, stmt->getBeginLoc(), "TODO handle C OMPDistributeParallelForDirectiveClass"); | 3673 | emit_warning(c, bitcast(stmt->getBeginLoc()), "TODO handle C OMPDistributeParallelForDirectiveClass"); |
| 3680 | return ErrorUnexpected; | 3674 | return ErrorUnexpected; |
| 3681 | case clang::Stmt::OMPDistributeParallelForSimdDirectiveClass: | 3675 | case clang::Stmt::OMPDistributeParallelForSimdDirectiveClass: |
| 3682 | emit_warning(c, stmt->getBeginLoc(), "TODO handle C OMPDistributeParallelForSimdDirectiveClass"); | 3676 | emit_warning(c, bitcast(stmt->getBeginLoc()), "TODO handle C OMPDistributeParallelForSimdDirectiveClass"); |
| 3683 | return ErrorUnexpected; | 3677 | return ErrorUnexpected; |
| 3684 | case clang::Stmt::OMPDistributeSimdDirectiveClass: | 3678 | case clang::Stmt::OMPDistributeSimdDirectiveClass: |
| 3685 | emit_warning(c, stmt->getBeginLoc(), "TODO handle C OMPDistributeSimdDirectiveClass"); | 3679 | emit_warning(c, bitcast(stmt->getBeginLoc()), "TODO handle C OMPDistributeSimdDirectiveClass"); |
| 3686 | return ErrorUnexpected; | 3680 | return ErrorUnexpected; |
| 3687 | case clang::Stmt::OMPForDirectiveClass: | 3681 | case clang::Stmt::OMPForDirectiveClass: |
| 3688 | emit_warning(c, stmt->getBeginLoc(), "TODO handle C OMPForDirectiveClass"); | 3682 | emit_warning(c, bitcast(stmt->getBeginLoc()), "TODO handle C OMPForDirectiveClass"); |
| 3689 | return ErrorUnexpected; | 3683 | return ErrorUnexpected; |
| 3690 | case clang::Stmt::OMPForSimdDirectiveClass: | 3684 | case clang::Stmt::OMPForSimdDirectiveClass: |
| 3691 | emit_warning(c, stmt->getBeginLoc(), "TODO handle C OMPForSimdDirectiveClass"); | 3685 | emit_warning(c, bitcast(stmt->getBeginLoc()), "TODO handle C OMPForSimdDirectiveClass"); |
| 3692 | return ErrorUnexpected; | 3686 | return ErrorUnexpected; |
| 3693 | case clang::Stmt::OMPParallelForDirectiveClass: | 3687 | case clang::Stmt::OMPParallelForDirectiveClass: |
| 3694 | emit_warning(c, stmt->getBeginLoc(), "TODO handle C OMPParallelForDirectiveClass"); | 3688 | emit_warning(c, bitcast(stmt->getBeginLoc()), "TODO handle C OMPParallelForDirectiveClass"); |
| 3695 | return ErrorUnexpected; | 3689 | return ErrorUnexpected; |
| 3696 | case clang::Stmt::OMPParallelForSimdDirectiveClass: | 3690 | case clang::Stmt::OMPParallelForSimdDirectiveClass: |
| 3697 | emit_warning(c, stmt->getBeginLoc(), "TODO handle C OMPParallelForSimdDirectiveClass"); | 3691 | emit_warning(c, bitcast(stmt->getBeginLoc()), "TODO handle C OMPParallelForSimdDirectiveClass"); |
| 3698 | return ErrorUnexpected; | 3692 | return ErrorUnexpected; |
| 3699 | case clang::Stmt::OMPSimdDirectiveClass: | 3693 | case clang::Stmt::OMPSimdDirectiveClass: |
| 3700 | emit_warning(c, stmt->getBeginLoc(), "TODO handle C OMPSimdDirectiveClass"); | 3694 | emit_warning(c, bitcast(stmt->getBeginLoc()), "TODO handle C OMPSimdDirectiveClass"); |
| 3701 | return ErrorUnexpected; | 3695 | return ErrorUnexpected; |
| 3702 | case clang::Stmt::OMPTargetParallelForSimdDirectiveClass: | 3696 | case clang::Stmt::OMPTargetParallelForSimdDirectiveClass: |
| 3703 | emit_warning(c, stmt->getBeginLoc(), "TODO handle C OMPTargetParallelForSimdDirectiveClass"); | 3697 | emit_warning(c, bitcast(stmt->getBeginLoc()), "TODO handle C OMPTargetParallelForSimdDirectiveClass"); |
| 3704 | return ErrorUnexpected; | 3698 | return ErrorUnexpected; |
| 3705 | case clang::Stmt::OMPTargetSimdDirectiveClass: | 3699 | case clang::Stmt::OMPTargetSimdDirectiveClass: |
| 3706 | emit_warning(c, stmt->getBeginLoc(), "TODO handle C OMPTargetSimdDirectiveClass"); | 3700 | emit_warning(c, bitcast(stmt->getBeginLoc()), "TODO handle C OMPTargetSimdDirectiveClass"); |
| 3707 | return ErrorUnexpected; | 3701 | return ErrorUnexpected; |
| 3708 | case clang::Stmt::OMPTargetTeamsDistributeDirectiveClass: | 3702 | case clang::Stmt::OMPTargetTeamsDistributeDirectiveClass: |
| 3709 | emit_warning(c, stmt->getBeginLoc(), "TODO handle C OMPTargetTeamsDistributeDirectiveClass"); | 3703 | emit_warning(c, bitcast(stmt->getBeginLoc()), "TODO handle C OMPTargetTeamsDistributeDirectiveClass"); |
| 3710 | return ErrorUnexpected; | 3704 | return ErrorUnexpected; |
| 3711 | case clang::Stmt::OMPTargetTeamsDistributeParallelForDirectiveClass: | 3705 | case clang::Stmt::OMPTargetTeamsDistributeParallelForDirectiveClass: |
| 3712 | emit_warning(c, stmt->getBeginLoc(), "TODO handle C OMPTargetTeamsDistributeParallelForDirectiveClass"); | 3706 | emit_warning(c, bitcast(stmt->getBeginLoc()), "TODO handle C OMPTargetTeamsDistributeParallelForDirectiveClass"); |
| 3713 | return ErrorUnexpected; | 3707 | return ErrorUnexpected; |
| 3714 | case clang::Stmt::OMPTargetTeamsDistributeParallelForSimdDirectiveClass: | 3708 | case clang::Stmt::OMPTargetTeamsDistributeParallelForSimdDirectiveClass: |
| 3715 | emit_warning(c, stmt->getBeginLoc(), "TODO handle C OMPTargetTeamsDistributeParallelForSimdDirectiveClass"); | 3709 | emit_warning(c, bitcast(stmt->getBeginLoc()), "TODO handle C OMPTargetTeamsDistributeParallelForSimdDirectiveClass"); |
| 3716 | return ErrorUnexpected; | 3710 | return ErrorUnexpected; |
| 3717 | case clang::Stmt::OMPTargetTeamsDistributeSimdDirectiveClass: | 3711 | case clang::Stmt::OMPTargetTeamsDistributeSimdDirectiveClass: |
| 3718 | emit_warning(c, stmt->getBeginLoc(), "TODO handle C OMPTargetTeamsDistributeSimdDirectiveClass"); | 3712 | emit_warning(c, bitcast(stmt->getBeginLoc()), "TODO handle C OMPTargetTeamsDistributeSimdDirectiveClass"); |
| 3719 | return ErrorUnexpected; | 3713 | return ErrorUnexpected; |
| 3720 | case clang::Stmt::OMPTaskLoopDirectiveClass: | 3714 | case clang::Stmt::OMPTaskLoopDirectiveClass: |
| 3721 | emit_warning(c, stmt->getBeginLoc(), "TODO handle C OMPTaskLoopDirectiveClass"); | 3715 | emit_warning(c, bitcast(stmt->getBeginLoc()), "TODO handle C OMPTaskLoopDirectiveClass"); |
| 3722 | return ErrorUnexpected; | 3716 | return ErrorUnexpected; |
| 3723 | case clang::Stmt::OMPTaskLoopSimdDirectiveClass: | 3717 | case clang::Stmt::OMPTaskLoopSimdDirectiveClass: |
| 3724 | emit_warning(c, stmt->getBeginLoc(), "TODO handle C OMPTaskLoopSimdDirectiveClass"); | 3718 | emit_warning(c, bitcast(stmt->getBeginLoc()), "TODO handle C OMPTaskLoopSimdDirectiveClass"); |
| 3725 | return ErrorUnexpected; | 3719 | return ErrorUnexpected; |
| 3726 | case clang::Stmt::OMPTeamsDistributeDirectiveClass: | 3720 | case clang::Stmt::OMPTeamsDistributeDirectiveClass: |
| 3727 | emit_warning(c, stmt->getBeginLoc(), "TODO handle C OMPTeamsDistributeDirectiveClass"); | 3721 | emit_warning(c, bitcast(stmt->getBeginLoc()), "TODO handle C OMPTeamsDistributeDirectiveClass"); |
| 3728 | return ErrorUnexpected; | 3722 | return ErrorUnexpected; |
| 3729 | case clang::Stmt::OMPTeamsDistributeParallelForDirectiveClass: | 3723 | case clang::Stmt::OMPTeamsDistributeParallelForDirectiveClass: |
| 3730 | emit_warning(c, stmt->getBeginLoc(), "TODO handle C OMPTeamsDistributeParallelForDirectiveClass"); | 3724 | emit_warning(c, bitcast(stmt->getBeginLoc()), "TODO handle C OMPTeamsDistributeParallelForDirectiveClass"); |
| 3731 | return ErrorUnexpected; | 3725 | return ErrorUnexpected; |
| 3732 | case clang::Stmt::OMPTeamsDistributeParallelForSimdDirectiveClass: | 3726 | case clang::Stmt::OMPTeamsDistributeParallelForSimdDirectiveClass: |
| 3733 | emit_warning(c, stmt->getBeginLoc(), "TODO handle C OMPTeamsDistributeParallelForSimdDirectiveClass"); | 3727 | emit_warning(c, bitcast(stmt->getBeginLoc()), "TODO handle C OMPTeamsDistributeParallelForSimdDirectiveClass"); |
| 3734 | return ErrorUnexpected; | 3728 | return ErrorUnexpected; |
| 3735 | case clang::Stmt::OMPTeamsDistributeSimdDirectiveClass: | 3729 | case clang::Stmt::OMPTeamsDistributeSimdDirectiveClass: |
| 3736 | emit_warning(c, stmt->getBeginLoc(), "TODO handle C OMPTeamsDistributeSimdDirectiveClass"); | 3730 | emit_warning(c, bitcast(stmt->getBeginLoc()), "TODO handle C OMPTeamsDistributeSimdDirectiveClass"); |
| 3737 | return ErrorUnexpected; | 3731 | return ErrorUnexpected; |
| 3738 | case clang::Stmt::OMPMasterDirectiveClass: | 3732 | case clang::Stmt::OMPMasterDirectiveClass: |
| 3739 | emit_warning(c, stmt->getBeginLoc(), "TODO handle C OMPMasterDirectiveClass"); | 3733 | emit_warning(c, bitcast(stmt->getBeginLoc()), "TODO handle C OMPMasterDirectiveClass"); |
| 3740 | return ErrorUnexpected; | 3734 | return ErrorUnexpected; |
| 3741 | case clang::Stmt::OMPOrderedDirectiveClass: | 3735 | case clang::Stmt::OMPOrderedDirectiveClass: |
| 3742 | emit_warning(c, stmt->getBeginLoc(), "TODO handle C OMPOrderedDirectiveClass"); | 3736 | emit_warning(c, bitcast(stmt->getBeginLoc()), "TODO handle C OMPOrderedDirectiveClass"); |
| 3743 | return ErrorUnexpected; | 3737 | return ErrorUnexpected; |
| 3744 | case clang::Stmt::OMPParallelDirectiveClass: | 3738 | case clang::Stmt::OMPParallelDirectiveClass: |
| 3745 | emit_warning(c, stmt->getBeginLoc(), "TODO handle C OMPParallelDirectiveClass"); | 3739 | emit_warning(c, bitcast(stmt->getBeginLoc()), "TODO handle C OMPParallelDirectiveClass"); |
| 3746 | return ErrorUnexpected; | 3740 | return ErrorUnexpected; |
| 3747 | case clang::Stmt::OMPParallelSectionsDirectiveClass: | 3741 | case clang::Stmt::OMPParallelSectionsDirectiveClass: |
| 3748 | emit_warning(c, stmt->getBeginLoc(), "TODO handle C OMPParallelSectionsDirectiveClass"); | 3742 | emit_warning(c, bitcast(stmt->getBeginLoc()), "TODO handle C OMPParallelSectionsDirectiveClass"); |
| 3749 | return ErrorUnexpected; | 3743 | return ErrorUnexpected; |
| 3750 | case clang::Stmt::OMPSectionDirectiveClass: | 3744 | case clang::Stmt::OMPSectionDirectiveClass: |
| 3751 | emit_warning(c, stmt->getBeginLoc(), "TODO handle C OMPSectionDirectiveClass"); | 3745 | emit_warning(c, bitcast(stmt->getBeginLoc()), "TODO handle C OMPSectionDirectiveClass"); |
| 3752 | return ErrorUnexpected; | 3746 | return ErrorUnexpected; |
| 3753 | case clang::Stmt::OMPSectionsDirectiveClass: | 3747 | case clang::Stmt::OMPSectionsDirectiveClass: |
| 3754 | emit_warning(c, stmt->getBeginLoc(), "TODO handle C OMPSectionsDirectiveClass"); | 3748 | emit_warning(c, bitcast(stmt->getBeginLoc()), "TODO handle C OMPSectionsDirectiveClass"); |
| 3755 | return ErrorUnexpected; | 3749 | return ErrorUnexpected; |
| 3756 | case clang::Stmt::OMPSingleDirectiveClass: | 3750 | case clang::Stmt::OMPSingleDirectiveClass: |
| 3757 | emit_warning(c, stmt->getBeginLoc(), "TODO handle C OMPSingleDirectiveClass"); | 3751 | emit_warning(c, bitcast(stmt->getBeginLoc()), "TODO handle C OMPSingleDirectiveClass"); |
| 3758 | return ErrorUnexpected; | 3752 | return ErrorUnexpected; |
| 3759 | case clang::Stmt::OMPTargetDataDirectiveClass: | 3753 | case clang::Stmt::OMPTargetDataDirectiveClass: |
| 3760 | emit_warning(c, stmt->getBeginLoc(), "TODO handle C OMPTargetDataDirectiveClass"); | 3754 | emit_warning(c, bitcast(stmt->getBeginLoc()), "TODO handle C OMPTargetDataDirectiveClass"); |
| 3761 | return ErrorUnexpected; | 3755 | return ErrorUnexpected; |
| 3762 | case clang::Stmt::OMPTargetDirectiveClass: | 3756 | case clang::Stmt::OMPTargetDirectiveClass: |
| 3763 | emit_warning(c, stmt->getBeginLoc(), "TODO handle C OMPTargetDirectiveClass"); | 3757 | emit_warning(c, bitcast(stmt->getBeginLoc()), "TODO handle C OMPTargetDirectiveClass"); |
| 3764 | return ErrorUnexpected; | 3758 | return ErrorUnexpected; |
| 3765 | case clang::Stmt::OMPTargetEnterDataDirectiveClass: | 3759 | case clang::Stmt::OMPTargetEnterDataDirectiveClass: |
| 3766 | emit_warning(c, stmt->getBeginLoc(), "TODO handle C OMPTargetEnterDataDirectiveClass"); | 3760 | emit_warning(c, bitcast(stmt->getBeginLoc()), "TODO handle C OMPTargetEnterDataDirectiveClass"); |
| 3767 | return ErrorUnexpected; | 3761 | return ErrorUnexpected; |
| 3768 | case clang::Stmt::OMPTargetExitDataDirectiveClass: | 3762 | case clang::Stmt::OMPTargetExitDataDirectiveClass: |
| 3769 | emit_warning(c, stmt->getBeginLoc(), "TODO handle C OMPTargetExitDataDirectiveClass"); | 3763 | emit_warning(c, bitcast(stmt->getBeginLoc()), "TODO handle C OMPTargetExitDataDirectiveClass"); |
| 3770 | return ErrorUnexpected; | 3764 | return ErrorUnexpected; |
| 3771 | case clang::Stmt::OMPTargetParallelDirectiveClass: | 3765 | case clang::Stmt::OMPTargetParallelDirectiveClass: |
| 3772 | emit_warning(c, stmt->getBeginLoc(), "TODO handle C OMPTargetParallelDirectiveClass"); | 3766 | emit_warning(c, bitcast(stmt->getBeginLoc()), "TODO handle C OMPTargetParallelDirectiveClass"); |
| 3773 | return ErrorUnexpected; | 3767 | return ErrorUnexpected; |
| 3774 | case clang::Stmt::OMPTargetParallelForDirectiveClass: | 3768 | case clang::Stmt::OMPTargetParallelForDirectiveClass: |
| 3775 | emit_warning(c, stmt->getBeginLoc(), "TODO handle C OMPTargetParallelForDirectiveClass"); | 3769 | emit_warning(c, bitcast(stmt->getBeginLoc()), "TODO handle C OMPTargetParallelForDirectiveClass"); |
| 3776 | return ErrorUnexpected; | 3770 | return ErrorUnexpected; |
| 3777 | case clang::Stmt::OMPTargetTeamsDirectiveClass: | 3771 | case clang::Stmt::OMPTargetTeamsDirectiveClass: |
| 3778 | emit_warning(c, stmt->getBeginLoc(), "TODO handle C OMPTargetTeamsDirectiveClass"); | 3772 | emit_warning(c, bitcast(stmt->getBeginLoc()), "TODO handle C OMPTargetTeamsDirectiveClass"); |
| 3779 | return ErrorUnexpected; | 3773 | return ErrorUnexpected; |
| 3780 | case clang::Stmt::OMPTargetUpdateDirectiveClass: | 3774 | case clang::Stmt::OMPTargetUpdateDirectiveClass: |
| 3781 | emit_warning(c, stmt->getBeginLoc(), "TODO handle C OMPTargetUpdateDirectiveClass"); | 3775 | emit_warning(c, bitcast(stmt->getBeginLoc()), "TODO handle C OMPTargetUpdateDirectiveClass"); |
| 3782 | return ErrorUnexpected; | 3776 | return ErrorUnexpected; |
| 3783 | case clang::Stmt::OMPTaskDirectiveClass: | 3777 | case clang::Stmt::OMPTaskDirectiveClass: |
| 3784 | emit_warning(c, stmt->getBeginLoc(), "TODO handle C OMPTaskDirectiveClass"); | 3778 | emit_warning(c, bitcast(stmt->getBeginLoc()), "TODO handle C OMPTaskDirectiveClass"); |
| 3785 | return ErrorUnexpected; | 3779 | return ErrorUnexpected; |
| 3786 | case clang::Stmt::OMPTaskgroupDirectiveClass: | 3780 | case clang::Stmt::OMPTaskgroupDirectiveClass: |
| 3787 | emit_warning(c, stmt->getBeginLoc(), "TODO handle C OMPTaskgroupDirectiveClass"); | 3781 | emit_warning(c, bitcast(stmt->getBeginLoc()), "TODO handle C OMPTaskgroupDirectiveClass"); |
| 3788 | return ErrorUnexpected; | 3782 | return ErrorUnexpected; |
| 3789 | case clang::Stmt::OMPTaskwaitDirectiveClass: | 3783 | case clang::Stmt::OMPTaskwaitDirectiveClass: |
| 3790 | emit_warning(c, stmt->getBeginLoc(), "TODO handle C OMPTaskwaitDirectiveClass"); | 3784 | emit_warning(c, bitcast(stmt->getBeginLoc()), "TODO handle C OMPTaskwaitDirectiveClass"); |
| 3791 | return ErrorUnexpected; | 3785 | return ErrorUnexpected; |
| 3792 | case clang::Stmt::OMPTaskyieldDirectiveClass: | 3786 | case clang::Stmt::OMPTaskyieldDirectiveClass: |
| 3793 | emit_warning(c, stmt->getBeginLoc(), "TODO handle C OMPTaskyieldDirectiveClass"); | 3787 | emit_warning(c, bitcast(stmt->getBeginLoc()), "TODO handle C OMPTaskyieldDirectiveClass"); |
| 3794 | return ErrorUnexpected; | 3788 | return ErrorUnexpected; |
| 3795 | case clang::Stmt::OMPTeamsDirectiveClass: | 3789 | case clang::Stmt::OMPTeamsDirectiveClass: |
| 3796 | emit_warning(c, stmt->getBeginLoc(), "TODO handle C OMPTeamsDirectiveClass"); | 3790 | emit_warning(c, bitcast(stmt->getBeginLoc()), "TODO handle C OMPTeamsDirectiveClass"); |
| 3797 | return ErrorUnexpected; | 3791 | return ErrorUnexpected; |
| 3798 | case clang::Stmt::ObjCAtCatchStmtClass: | 3792 | case clang::Stmt::ObjCAtCatchStmtClass: |
| 3799 | emit_warning(c, stmt->getBeginLoc(), "TODO handle C ObjCAtCatchStmtClass"); | 3793 | emit_warning(c, bitcast(stmt->getBeginLoc()), "TODO handle C ObjCAtCatchStmtClass"); |
| 3800 | return ErrorUnexpected; | 3794 | return ErrorUnexpected; |
| 3801 | case clang::Stmt::ObjCAtFinallyStmtClass: | 3795 | case clang::Stmt::ObjCAtFinallyStmtClass: |
| 3802 | emit_warning(c, stmt->getBeginLoc(), "TODO handle C ObjCAtFinallyStmtClass"); | 3796 | emit_warning(c, bitcast(stmt->getBeginLoc()), "TODO handle C ObjCAtFinallyStmtClass"); |
| 3803 | return ErrorUnexpected; | 3797 | return ErrorUnexpected; |
| 3804 | case clang::Stmt::ObjCAtSynchronizedStmtClass: | 3798 | case clang::Stmt::ObjCAtSynchronizedStmtClass: |
| 3805 | emit_warning(c, stmt->getBeginLoc(), "TODO handle C ObjCAtSynchronizedStmtClass"); | 3799 | emit_warning(c, bitcast(stmt->getBeginLoc()), "TODO handle C ObjCAtSynchronizedStmtClass"); |
| 3806 | return ErrorUnexpected; | 3800 | return ErrorUnexpected; |
| 3807 | case clang::Stmt::ObjCAtThrowStmtClass: | 3801 | case clang::Stmt::ObjCAtThrowStmtClass: |
| 3808 | emit_warning(c, stmt->getBeginLoc(), "TODO handle C ObjCAtThrowStmtClass"); | 3802 | emit_warning(c, bitcast(stmt->getBeginLoc()), "TODO handle C ObjCAtThrowStmtClass"); |
| 3809 | return ErrorUnexpected; | 3803 | return ErrorUnexpected; |
| 3810 | case clang::Stmt::ObjCAtTryStmtClass: | 3804 | case clang::Stmt::ObjCAtTryStmtClass: |
| 3811 | emit_warning(c, stmt->getBeginLoc(), "TODO handle C ObjCAtTryStmtClass"); | 3805 | emit_warning(c, bitcast(stmt->getBeginLoc()), "TODO handle C ObjCAtTryStmtClass"); |
| 3812 | return ErrorUnexpected; | 3806 | return ErrorUnexpected; |
| 3813 | case clang::Stmt::ObjCAutoreleasePoolStmtClass: | 3807 | case clang::Stmt::ObjCAutoreleasePoolStmtClass: |
| 3814 | emit_warning(c, stmt->getBeginLoc(), "TODO handle C ObjCAutoreleasePoolStmtClass"); | 3808 | emit_warning(c, bitcast(stmt->getBeginLoc()), "TODO handle C ObjCAutoreleasePoolStmtClass"); |
| 3815 | return ErrorUnexpected; | 3809 | return ErrorUnexpected; |
| 3816 | case clang::Stmt::ObjCForCollectionStmtClass: | 3810 | case clang::Stmt::ObjCForCollectionStmtClass: |
| 3817 | emit_warning(c, stmt->getBeginLoc(), "TODO handle C ObjCForCollectionStmtClass"); | 3811 | emit_warning(c, bitcast(stmt->getBeginLoc()), "TODO handle C ObjCForCollectionStmtClass"); |
| 3818 | return ErrorUnexpected; | 3812 | return ErrorUnexpected; |
| 3819 | case clang::Stmt::SEHExceptStmtClass: | 3813 | case clang::Stmt::SEHExceptStmtClass: |
| 3820 | emit_warning(c, stmt->getBeginLoc(), "TODO handle C SEHExceptStmtClass"); | 3814 | emit_warning(c, bitcast(stmt->getBeginLoc()), "TODO handle C SEHExceptStmtClass"); |
| 3821 | return ErrorUnexpected; | 3815 | return ErrorUnexpected; |
| 3822 | case clang::Stmt::SEHFinallyStmtClass: | 3816 | case clang::Stmt::SEHFinallyStmtClass: |
| 3823 | emit_warning(c, stmt->getBeginLoc(), "TODO handle C SEHFinallyStmtClass"); | 3817 | emit_warning(c, bitcast(stmt->getBeginLoc()), "TODO handle C SEHFinallyStmtClass"); |
| 3824 | return ErrorUnexpected; | 3818 | return ErrorUnexpected; |
| 3825 | case clang::Stmt::SEHLeaveStmtClass: | 3819 | case clang::Stmt::SEHLeaveStmtClass: |
| 3826 | emit_warning(c, stmt->getBeginLoc(), "TODO handle C SEHLeaveStmtClass"); | 3820 | emit_warning(c, bitcast(stmt->getBeginLoc()), "TODO handle C SEHLeaveStmtClass"); |
| 3827 | return ErrorUnexpected; | 3821 | return ErrorUnexpected; |
| 3828 | case clang::Stmt::SEHTryStmtClass: | 3822 | case clang::Stmt::SEHTryStmtClass: |
| 3829 | emit_warning(c, stmt->getBeginLoc(), "TODO handle C SEHTryStmtClass"); | 3823 | emit_warning(c, bitcast(stmt->getBeginLoc()), "TODO handle C SEHTryStmtClass"); |
| 3830 | return ErrorUnexpected; | 3824 | return ErrorUnexpected; |
| 3831 | } | 3825 | } |
| 3832 | zig_unreachable(); | 3826 | zig_unreachable(); |
| ... | @@ -3855,16 +3849,16 @@ static TransScope *trans_stmt(Context *c, TransScope *scope, const clang::Stmt * | ... | @@ -3855,16 +3849,16 @@ static TransScope *trans_stmt(Context *c, TransScope *scope, const clang::Stmt * |
| 3855 | } | 3849 | } |
| 3856 | | 3850 | |
| 3857 | static void visit_fn_decl(Context *c, const clang::FunctionDecl *fn_decl) { | 3851 | static void visit_fn_decl(Context *c, const clang::FunctionDecl *fn_decl) { |
| 3858 | Buf *fn_name = buf_create_from_str(decl_name(fn_decl)); | 3852 | Buf *fn_name = buf_create_from_str(ZigClangDecl_getName_bytes_begin((const ZigClangDecl *)fn_decl)); |
| 3859 | | 3853 | |
| 3860 | if (get_global(c, fn_name)) { | 3854 | if (get_global(c, fn_name)) { |
| 3861 | // we already saw this function | 3855 | // we already saw this function |
| 3862 | return; | 3856 | return; |
| 3863 | } | 3857 | } |
| 3864 | | 3858 | |
| 3865 | AstNode *proto_node = trans_qual_type(c, fn_decl->getType(), fn_decl->getLocation()); | 3859 | AstNode *proto_node = trans_qual_type(c, fn_decl->getType(), bitcast(fn_decl->getLocation())); |
| 3866 | if (proto_node == nullptr) { | 3860 | if (proto_node == nullptr) { |
| 3867 | emit_warning(c, fn_decl->getLocation(), "unable to resolve prototype of function '%s'", buf_ptr(fn_name)); | 3861 | emit_warning(c, bitcast(fn_decl->getLocation()), "unable to resolve prototype of function '%s'", buf_ptr(fn_name)); |
| 3868 | return; | 3862 | return; |
| 3869 | } | 3863 | } |
| 3870 | | 3864 | |
| ... | @@ -3878,10 +3872,10 @@ static void visit_fn_decl(Context *c, const clang::FunctionDecl *fn_decl) { | ... | @@ -3878,10 +3872,10 @@ static void visit_fn_decl(Context *c, const clang::FunctionDecl *fn_decl) { |
| 3878 | } else if (sc == clang::SC_Extern || sc == clang::SC_Static) { | 3872 | } else if (sc == clang::SC_Extern || sc == clang::SC_Static) { |
| 3879 | proto_node->data.fn_proto.visib_mod = c->visib_mod; | 3873 | proto_node->data.fn_proto.visib_mod = c->visib_mod; |
| 3880 | } else if (sc == clang::SC_PrivateExtern) { | 3874 | } else if (sc == clang::SC_PrivateExtern) { |
| 3881 | emit_warning(c, fn_decl->getLocation(), "unsupported storage class: private extern"); | 3875 | emit_warning(c, bitcast(fn_decl->getLocation()), "unsupported storage class: private extern"); |
| 3882 | return; | 3876 | return; |
| 3883 | } else { | 3877 | } else { |
| 3884 | emit_warning(c, fn_decl->getLocation(), "unsupported storage class: unknown"); | 3878 | emit_warning(c, bitcast(fn_decl->getLocation()), "unsupported storage class: unknown"); |
| 3885 | return; | 3879 | return; |
| 3886 | } | 3880 | } |
| 3887 | | 3881 | |
| ... | @@ -3890,7 +3884,7 @@ static void visit_fn_decl(Context *c, const clang::FunctionDecl *fn_decl) { | ... | @@ -3890,7 +3884,7 @@ static void visit_fn_decl(Context *c, const clang::FunctionDecl *fn_decl) { |
| 3890 | for (size_t i = 0; i < proto_node->data.fn_proto.params.length; i += 1) { | 3884 | for (size_t i = 0; i < proto_node->data.fn_proto.params.length; i += 1) { |
| 3891 | AstNode *param_node = proto_node->data.fn_proto.params.at(i); | 3885 | AstNode *param_node = proto_node->data.fn_proto.params.at(i); |
| 3892 | const clang::ParmVarDecl *param = fn_decl->getParamDecl(i); | 3886 | const clang::ParmVarDecl *param = fn_decl->getParamDecl(i); |
| 3893 | const char *name = decl_name(param); | 3887 | const char *name = ZigClangDecl_getName_bytes_begin((const ZigClangDecl *)param); |
| 3894 | | 3888 | |
| 3895 | Buf *proto_param_name; | 3889 | Buf *proto_param_name; |
| 3896 | if (strlen(name) != 0) { | 3890 | if (strlen(name) != 0) { |
| ... | @@ -3920,7 +3914,7 @@ static void visit_fn_decl(Context *c, const clang::FunctionDecl *fn_decl) { | ... | @@ -3920,7 +3914,7 @@ static void visit_fn_decl(Context *c, const clang::FunctionDecl *fn_decl) { |
| 3920 | AstNode *actual_body_node; | 3914 | AstNode *actual_body_node; |
| 3921 | TransScope *result_scope = trans_stmt(c, scope, body, &actual_body_node); | 3915 | TransScope *result_scope = trans_stmt(c, scope, body, &actual_body_node); |
| 3922 | if (result_scope == nullptr) { | 3916 | if (result_scope == nullptr) { |
| 3923 | emit_warning(c, fn_decl->getLocation(), "unable to translate function"); | 3917 | emit_warning(c, bitcast(fn_decl->getLocation()), "unable to translate function"); |
| 3924 | return; | 3918 | return; |
| 3925 | } | 3919 | } |
| 3926 | assert(actual_body_node != nullptr); | 3920 | assert(actual_body_node != nullptr); |
| ... | @@ -3971,7 +3965,7 @@ static AstNode *resolve_typedef_decl(Context *c, const clang::TypedefNameDecl *t | ... | @@ -3971,7 +3965,7 @@ static AstNode *resolve_typedef_decl(Context *c, const clang::TypedefNameDecl *t |
| 3971 | } | 3965 | } |
| 3972 | | 3966 | |
| 3973 | clang::QualType child_qt = typedef_decl->getUnderlyingType(); | 3967 | clang::QualType child_qt = typedef_decl->getUnderlyingType(); |
| 3974 | Buf *type_name = buf_create_from_str(decl_name(typedef_decl)); | 3968 | Buf *type_name = buf_create_from_str(ZigClangDecl_getName_bytes_begin((const ZigClangDecl *)typedef_decl)); |
| 3975 | | 3969 | |
| 3976 | if (buf_eql_str(type_name, "uint8_t")) { | 3970 | if (buf_eql_str(type_name, "uint8_t")) { |
| 3977 | return resolve_typdef_as_builtin(c, typedef_decl, "u8"); | 3971 | return resolve_typdef_as_builtin(c, typedef_decl, "u8"); |
| ... | @@ -4007,9 +4001,9 @@ static AstNode *resolve_typedef_decl(Context *c, const clang::TypedefNameDecl *t | ... | @@ -4007,9 +4001,9 @@ static AstNode *resolve_typedef_decl(Context *c, const clang::TypedefNameDecl *t |
| 4007 | AstNode *symbol_node = trans_create_node_symbol(c, type_name); | 4001 | AstNode *symbol_node = trans_create_node_symbol(c, type_name); |
| 4008 | c->decl_table.put(typedef_decl->getCanonicalDecl(), symbol_node); | 4002 | c->decl_table.put(typedef_decl->getCanonicalDecl(), symbol_node); |
| 4009 | | 4003 | |
| 4010 | AstNode *type_node = trans_qual_type(c, child_qt, typedef_decl->getLocation()); | 4004 | AstNode *type_node = trans_qual_type(c, child_qt, bitcast(typedef_decl->getLocation())); |
| 4011 | if (type_node == nullptr) { | 4005 | if (type_node == nullptr) { |
| 4012 | emit_warning(c, typedef_decl->getLocation(), "typedef %s - unresolved child type", buf_ptr(type_name)); | 4006 | emit_warning(c, bitcast(typedef_decl->getLocation()), "typedef %s - unresolved child type", buf_ptr(type_name)); |
| 4013 | c->decl_table.put(typedef_decl, nullptr); | 4007 | c->decl_table.put(typedef_decl, nullptr); |
| 4014 | // TODO add global var with type_name equal to @compileError("unable to resolve C type") | 4008 | // TODO add global var with type_name equal to @compileError("unable to resolve C type") |
| 4015 | return nullptr; | 4009 | return nullptr; |
| ... | @@ -4040,7 +4034,7 @@ static AstNode *resolve_enum_decl(Context *c, const clang::EnumDecl *enum_decl) | ... | @@ -4040,7 +4034,7 @@ static AstNode *resolve_enum_decl(Context *c, const clang::EnumDecl *enum_decl) |
| 4040 | return existing_entry->value; | 4034 | return existing_entry->value; |
| 4041 | } | 4035 | } |
| 4042 | | 4036 | |
| 4043 | const char *raw_name = decl_name(enum_decl); | 4037 | const char *raw_name = ZigClangDecl_getName_bytes_begin((const ZigClangDecl *)enum_decl); |
| 4044 | bool is_anonymous = (raw_name[0] == 0); | 4038 | bool is_anonymous = (raw_name[0] == 0); |
| 4045 | Buf *bare_name = is_anonymous ? nullptr : buf_create_from_str(raw_name); | 4039 | Buf *bare_name = is_anonymous ? nullptr : buf_create_from_str(raw_name); |
| 4046 | Buf *full_type_name = is_anonymous ? nullptr : buf_sprintf("enum_%s", buf_ptr(bare_name)); | 4040 | Buf *full_type_name = is_anonymous ? nullptr : buf_sprintf("enum_%s", buf_ptr(bare_name)); |
| ... | @@ -4062,7 +4056,7 @@ static AstNode *resolve_enum_decl(Context *c, const clang::EnumDecl *enum_decl) | ... | @@ -4062,7 +4056,7 @@ static AstNode *resolve_enum_decl(Context *c, const clang::EnumDecl *enum_decl) |
| 4062 | pure_enum = false; | 4056 | pure_enum = false; |
| 4063 | } | 4057 | } |
| 4064 | } | 4058 | } |
| 4065 | AstNode *tag_int_type = trans_qual_type(c, enum_decl->getIntegerType(), enum_decl->getLocation()); | 4059 | AstNode *tag_int_type = trans_qual_type(c, enum_decl->getIntegerType(), bitcast(enum_decl->getLocation())); |
| 4066 | assert(tag_int_type); | 4060 | assert(tag_int_type); |
| 4067 | | 4061 | |
| 4068 | AstNode *enum_node = trans_create_node(c, NodeTypeContainerDecl); | 4062 | AstNode *enum_node = trans_create_node(c, NodeTypeContainerDecl); |
| ... | @@ -4084,7 +4078,7 @@ static AstNode *resolve_enum_decl(Context *c, const clang::EnumDecl *enum_decl) | ... | @@ -4084,7 +4078,7 @@ static AstNode *resolve_enum_decl(Context *c, const clang::EnumDecl *enum_decl) |
| 4084 | { | 4078 | { |
| 4085 | const clang::EnumConstantDecl *enum_const = *it; | 4079 | const clang::EnumConstantDecl *enum_const = *it; |
| 4086 | | 4080 | |
| 4087 | Buf *enum_val_name = buf_create_from_str(decl_name(enum_const)); | 4081 | Buf *enum_val_name = buf_create_from_str(ZigClangDecl_getName_bytes_begin((const ZigClangDecl *)enum_const)); |
| 4088 | Buf *field_name; | 4082 | Buf *field_name; |
| 4089 | if (bare_name != nullptr && buf_starts_with_buf(enum_val_name, bare_name)) { | 4083 | if (bare_name != nullptr && buf_starts_with_buf(enum_val_name, bare_name)) { |
| 4090 | field_name = buf_slice(enum_val_name, buf_len(bare_name), buf_len(enum_val_name)); | 4084 | field_name = buf_slice(enum_val_name, buf_len(bare_name), buf_len(enum_val_name)); |
| ... | @@ -4102,7 +4096,7 @@ static AstNode *resolve_enum_decl(Context *c, const clang::EnumDecl *enum_decl) | ... | @@ -4102,7 +4096,7 @@ static AstNode *resolve_enum_decl(Context *c, const clang::EnumDecl *enum_decl) |
| 4102 | // in C each enum value is in the global namespace. so we put them there too. | 4096 | // in C each enum value is in the global namespace. so we put them there too. |
| 4103 | // at this point we can rely on the enum emitting successfully | 4097 | // at this point we can rely on the enum emitting successfully |
| 4104 | if (is_anonymous) { | 4098 | if (is_anonymous) { |
| 4105 | Buf *enum_val_name = buf_create_from_str(decl_name(enum_const)); | 4099 | Buf *enum_val_name = buf_create_from_str(ZigClangDecl_getName_bytes_begin((const ZigClangDecl *)enum_const)); |
| 4106 | add_global_var(c, enum_val_name, int_node); | 4100 | add_global_var(c, enum_val_name, int_node); |
| 4107 | } else { | 4101 | } else { |
| 4108 | AstNode *field_access_node = trans_create_node_field_access(c, | 4102 | AstNode *field_access_node = trans_create_node_field_access(c, |
| ... | @@ -4123,62 +4117,63 @@ static AstNode *resolve_enum_decl(Context *c, const clang::EnumDecl *enum_decl) | ... | @@ -4123,62 +4117,63 @@ static AstNode *resolve_enum_decl(Context *c, const clang::EnumDecl *enum_decl) |
| 4123 | } | 4117 | } |
| 4124 | } | 4118 | } |
| 4125 | | 4119 | |
| 4126 | static AstNode *demote_struct_to_opaque(Context *c, const clang::RecordDecl *record_decl, | 4120 | static AstNode *demote_struct_to_opaque(Context *c, const ZigClangRecordDecl *record_decl, |
| 4127 | Buf *full_type_name, Buf *bare_name) | 4121 | Buf *full_type_name, Buf *bare_name) |
| 4128 | { | 4122 | { |
| 4129 | AstNode *opaque_node = trans_create_node_opaque(c); | 4123 | AstNode *opaque_node = trans_create_node_opaque(c); |
| 4130 | if (full_type_name == nullptr) { | 4124 | if (full_type_name == nullptr) { |
| 4131 | c->decl_table.put(record_decl->getCanonicalDecl(), opaque_node); | 4125 | c->decl_table.put(ZigClangRecordDecl_getCanonicalDecl(record_decl), opaque_node); |
| 4132 | return opaque_node; | 4126 | return opaque_node; |
| 4133 | } | 4127 | } |
| 4134 | AstNode *symbol_node = trans_create_node_symbol(c, full_type_name); | 4128 | AstNode *symbol_node = trans_create_node_symbol(c, full_type_name); |
| 4135 | add_global_weak_alias(c, bare_name, full_type_name); | 4129 | add_global_weak_alias(c, bare_name, full_type_name); |
| 4136 | add_global_var(c, full_type_name, opaque_node); | 4130 | add_global_var(c, full_type_name, opaque_node); |
| 4137 | c->decl_table.put(record_decl->getCanonicalDecl(), symbol_node); | 4131 | c->decl_table.put(ZigClangRecordDecl_getCanonicalDecl(record_decl), symbol_node); |
| 4138 | return symbol_node; | 4132 | return symbol_node; |
| 4139 | } | 4133 | } |
| 4140 | | 4134 | |
| 4141 | static AstNode *resolve_record_decl(Context *c, const clang::RecordDecl *record_decl) { | 4135 | static AstNode *resolve_record_decl(Context *c, const ZigClangRecordDecl *record_decl) { |
| 4142 | auto existing_entry = c->decl_table.maybe_get((void*)record_decl->getCanonicalDecl()); | 4136 | auto existing_entry = c->decl_table.maybe_get(ZigClangRecordDecl_getCanonicalDecl(record_decl)); |
| 4143 | if (existing_entry) { | 4137 | if (existing_entry) { |
| 4144 | return existing_entry->value; | 4138 | return existing_entry->value; |
| 4145 | } | 4139 | } |
| 4146 | | 4140 | |
| 4147 | const char *raw_name = decl_name(record_decl); | 4141 | const char *raw_name = ZigClangDecl_getName_bytes_begin((const ZigClangDecl *)record_decl); |
| 4148 | const char *container_kind_name; | 4142 | const char *container_kind_name; |
| 4149 | ContainerKind container_kind; | 4143 | ContainerKind container_kind; |
| 4150 | if (record_decl->isUnion()) { | 4144 | if (ZigClangRecordDecl_isUnion(record_decl)) { |
| 4151 | container_kind_name = "union"; | 4145 | container_kind_name = "union"; |
| 4152 | container_kind = ContainerKindUnion; | 4146 | container_kind = ContainerKindUnion; |
| 4153 | } else if (record_decl->isStruct()) { | 4147 | } else if (ZigClangRecordDecl_isStruct(record_decl)) { |
| 4154 | container_kind_name = "struct"; | 4148 | container_kind_name = "struct"; |
| 4155 | container_kind = ContainerKindStruct; | 4149 | container_kind = ContainerKindStruct; |
| 4156 | } else { | 4150 | } else { |
| 4157 | emit_warning(c, record_decl->getLocation(), "skipping record %s, not a struct or union", raw_name); | 4151 | emit_warning(c, ZigClangRecordDecl_getLocation(record_decl), |
| 4158 | c->decl_table.put(record_decl->getCanonicalDecl(), nullptr); | 4152 | "skipping record %s, not a struct or union", raw_name); |
| | 4153 | c->decl_table.put(ZigClangRecordDecl_getCanonicalDecl(record_decl), nullptr); |
| 4159 | return nullptr; | 4154 | return nullptr; |
| 4160 | } | 4155 | } |
| 4161 | | 4156 | |
| 4162 | bool is_anonymous = record_decl->isAnonymousStructOrUnion() || raw_name[0] == 0; | 4157 | bool is_anonymous = ZigClangRecordDecl_isAnonymousStructOrUnion(record_decl) || raw_name[0] == 0; |
| 4163 | Buf *bare_name = is_anonymous ? nullptr : buf_create_from_str(raw_name); | 4158 | Buf *bare_name = is_anonymous ? nullptr : buf_create_from_str(raw_name); |
| 4164 | Buf *full_type_name = (bare_name == nullptr) ? | 4159 | Buf *full_type_name = (bare_name == nullptr) ? |
| 4165 | nullptr : buf_sprintf("%s_%s", container_kind_name, buf_ptr(bare_name)); | 4160 | nullptr : buf_sprintf("%s_%s", container_kind_name, buf_ptr(bare_name)); |
| 4166 | | 4161 | |
| 4167 | clang::RecordDecl *record_def = record_decl->getDefinition(); | 4162 | const ZigClangRecordDecl *record_def = ZigClangRecordDecl_getDefinition(record_decl); |
| 4168 | if (record_def == nullptr) { | 4163 | if (record_def == nullptr) { |
| 4169 | return demote_struct_to_opaque(c, record_decl, full_type_name, bare_name); | 4164 | return demote_struct_to_opaque(c, record_decl, full_type_name, bare_name); |
| 4170 | } | 4165 | } |
| 4171 | | 4166 | |
| 4172 | // count fields and validate | 4167 | // count fields and validate |
| 4173 | uint32_t field_count = 0; | 4168 | uint32_t field_count = 0; |
| 4174 | for (auto it = record_def->field_begin(), | 4169 | for (auto it = reinterpret_cast<const clang::RecordDecl *>(record_def)->field_begin(), |
| 4175 | it_end = record_def->field_end(); | 4170 | it_end = reinterpret_cast<const clang::RecordDecl *>(record_def)->field_end(); |
| 4176 | it != it_end; ++it, field_count += 1) | 4171 | it != it_end; ++it, field_count += 1) |
| 4177 | { | 4172 | { |
| 4178 | const clang::FieldDecl *field_decl = *it; | 4173 | const clang::FieldDecl *field_decl = *it; |
| 4179 | | 4174 | |
| 4180 | if (field_decl->isBitField()) { | 4175 | if (field_decl->isBitField()) { |
| 4181 | emit_warning(c, field_decl->getLocation(), "%s %s demoted to opaque type - has bitfield", | 4176 | emit_warning(c, bitcast(field_decl->getLocation()), "%s %s demoted to opaque type - has bitfield", |
| 4182 | container_kind_name, | 4177 | container_kind_name, |
| 4183 | is_anonymous ? "(anon)" : buf_ptr(bare_name)); | 4178 | is_anonymous ? "(anon)" : buf_ptr(bare_name)); |
| 4184 | return demote_struct_to_opaque(c, record_decl, full_type_name, bare_name); | 4179 | return demote_struct_to_opaque(c, record_decl, full_type_name, bare_name); |
| ... | @@ -4195,24 +4190,25 @@ static AstNode *resolve_record_decl(Context *c, const clang::RecordDecl *record_ | ... | @@ -4195,24 +4190,25 @@ static AstNode *resolve_record_decl(Context *c, const clang::RecordDecl *record_ |
| 4195 | | 4190 | |
| 4196 | // must be before fields in case a circular reference happens | 4191 | // must be before fields in case a circular reference happens |
| 4197 | if (is_anonymous) { | 4192 | if (is_anonymous) { |
| 4198 | c->decl_table.put(record_decl->getCanonicalDecl(), struct_node); | 4193 | c->decl_table.put(ZigClangRecordDecl_getCanonicalDecl(record_decl), struct_node); |
| 4199 | } else { | 4194 | } else { |
| 4200 | c->decl_table.put(record_decl->getCanonicalDecl(), trans_create_node_symbol(c, full_type_name)); | 4195 | c->decl_table.put(ZigClangRecordDecl_getCanonicalDecl(record_decl), trans_create_node_symbol(c, full_type_name)); |
| 4201 | } | 4196 | } |
| 4202 | | 4197 | |
| 4203 | uint32_t i = 0; | 4198 | uint32_t i = 0; |
| 4204 | for (auto it = record_def->field_begin(), | 4199 | for (auto it = reinterpret_cast<const clang::RecordDecl *>(record_def)->field_begin(), |
| 4205 | it_end = record_def->field_end(); | 4200 | it_end = reinterpret_cast<const clang::RecordDecl *>(record_def)->field_end(); |
| 4206 | it != it_end; ++it, i += 1) | 4201 | it != it_end; ++it, i += 1) |
| 4207 | { | 4202 | { |
| 4208 | const clang::FieldDecl *field_decl = *it; | 4203 | const clang::FieldDecl *field_decl = *it; |
| 4209 | | 4204 | |
| 4210 | AstNode *field_node = trans_create_node(c, NodeTypeStructField); | 4205 | AstNode *field_node = trans_create_node(c, NodeTypeStructField); |
| 4211 | field_node->data.struct_field.name = buf_create_from_str(decl_name(field_decl)); | 4206 | field_node->data.struct_field.name = buf_create_from_str(ZigClangDecl_getName_bytes_begin((const ZigClangDecl *)field_decl)); |
| 4212 | field_node->data.struct_field.type = trans_qual_type(c, field_decl->getType(), field_decl->getLocation()); | 4207 | field_node->data.struct_field.type = trans_qual_type(c, field_decl->getType(), |
| | 4208 | bitcast(field_decl->getLocation())); |
| 4213 | | 4209 | |
| 4214 | if (field_node->data.struct_field.type == nullptr) { | 4210 | if (field_node->data.struct_field.type == nullptr) { |
| 4215 | emit_warning(c, field_decl->getLocation(), | 4211 | emit_warning(c, bitcast(field_decl->getLocation()), |
| 4216 | "%s %s demoted to opaque type - unresolved type", | 4212 | "%s %s demoted to opaque type - unresolved type", |
| 4217 | container_kind_name, | 4213 | container_kind_name, |
| 4218 | is_anonymous ? "(anon)" : buf_ptr(bare_name)); | 4214 | is_anonymous ? "(anon)" : buf_ptr(bare_name)); |
| ... | @@ -4232,7 +4228,7 @@ static AstNode *resolve_record_decl(Context *c, const clang::RecordDecl *record_ | ... | @@ -4232,7 +4228,7 @@ static AstNode *resolve_record_decl(Context *c, const clang::RecordDecl *record_ |
| 4232 | } | 4228 | } |
| 4233 | } | 4229 | } |
| 4234 | | 4230 | |
| 4235 | static AstNode *trans_ap_value(Context *c, clang::APValue *ap_value, clang::QualType qt, const clang::SourceLocation &source_loc) { | 4231 | static AstNode *trans_ap_value(Context *c, clang::APValue *ap_value, clang::QualType qt, ZigClangSourceLocation source_loc) { |
| 4236 | switch (ap_value->getKind()) { | 4232 | switch (ap_value->getKind()) { |
| 4237 | case clang::APValue::Int: | 4233 | case clang::APValue::Int: |
| 4238 | return trans_create_node_apint(c, ap_value->getInt()); | 4234 | return trans_create_node_apint(c, ap_value->getInt()); |
| ... | @@ -4331,25 +4327,25 @@ static AstNode *trans_ap_value(Context *c, clang::APValue *ap_value, clang::Qual | ... | @@ -4331,25 +4327,25 @@ static AstNode *trans_ap_value(Context *c, clang::APValue *ap_value, clang::Qual |
| 4331 | } | 4327 | } |
| 4332 | | 4328 | |
| 4333 | static void visit_var_decl(Context *c, const clang::VarDecl *var_decl) { | 4329 | static void visit_var_decl(Context *c, const clang::VarDecl *var_decl) { |
| 4334 | Buf *name = buf_create_from_str(decl_name(var_decl)); | 4330 | Buf *name = buf_create_from_str(ZigClangDecl_getName_bytes_begin((const ZigClangDecl *)var_decl)); |
| 4335 | | 4331 | |
| 4336 | switch (var_decl->getTLSKind()) { | 4332 | switch (var_decl->getTLSKind()) { |
| 4337 | case clang::VarDecl::TLS_None: | 4333 | case clang::VarDecl::TLS_None: |
| 4338 | break; | 4334 | break; |
| 4339 | case clang::VarDecl::TLS_Static: | 4335 | case clang::VarDecl::TLS_Static: |
| 4340 | emit_warning(c, var_decl->getLocation(), | 4336 | emit_warning(c, bitcast(var_decl->getLocation()), |
| 4341 | "ignoring variable '%s' - static thread local storage", buf_ptr(name)); | 4337 | "ignoring variable '%s' - static thread local storage", buf_ptr(name)); |
| 4342 | return; | 4338 | return; |
| 4343 | case clang::VarDecl::TLS_Dynamic: | 4339 | case clang::VarDecl::TLS_Dynamic: |
| 4344 | emit_warning(c, var_decl->getLocation(), | 4340 | emit_warning(c, bitcast(var_decl->getLocation()), |
| 4345 | "ignoring variable '%s' - dynamic thread local storage", buf_ptr(name)); | 4341 | "ignoring variable '%s' - dynamic thread local storage", buf_ptr(name)); |
| 4346 | return; | 4342 | return; |
| 4347 | } | 4343 | } |
| 4348 | | 4344 | |
| 4349 | clang::QualType qt = var_decl->getType(); | 4345 | clang::QualType qt = var_decl->getType(); |
| 4350 | AstNode *var_type = trans_qual_type(c, qt, var_decl->getLocation()); | 4346 | AstNode *var_type = trans_qual_type(c, qt, bitcast(var_decl->getLocation())); |
| 4351 | if (var_type == nullptr) { | 4347 | if (var_type == nullptr) { |
| 4352 | emit_warning(c, var_decl->getLocation(), "ignoring variable '%s' - unresolved type", buf_ptr(name)); | 4348 | emit_warning(c, bitcast(var_decl->getLocation()), "ignoring variable '%s' - unresolved type", buf_ptr(name)); |
| 4353 | return; | 4349 | return; |
| 4354 | } | 4350 | } |
| 4355 | | 4351 | |
| ... | @@ -4362,11 +4358,11 @@ static void visit_var_decl(Context *c, const clang::VarDecl *var_decl) { | ... | @@ -4362,11 +4358,11 @@ static void visit_var_decl(Context *c, const clang::VarDecl *var_decl) { |
| 4362 | if (var_decl->hasInit()) { | 4358 | if (var_decl->hasInit()) { |
| 4363 | clang::APValue *ap_value = var_decl->evaluateValue(); | 4359 | clang::APValue *ap_value = var_decl->evaluateValue(); |
| 4364 | if (ap_value == nullptr) { | 4360 | if (ap_value == nullptr) { |
| 4365 | emit_warning(c, var_decl->getLocation(), | 4361 | emit_warning(c, bitcast(var_decl->getLocation()), |
| 4366 | "ignoring variable '%s' - unable to evaluate initializer", buf_ptr(name)); | 4362 | "ignoring variable '%s' - unable to evaluate initializer", buf_ptr(name)); |
| 4367 | return; | 4363 | return; |
| 4368 | } | 4364 | } |
| 4369 | init_node = trans_ap_value(c, ap_value, qt, var_decl->getLocation()); | 4365 | init_node = trans_ap_value(c, ap_value, qt, bitcast(var_decl->getLocation())); |
| 4370 | if (init_node == nullptr) | 4366 | if (init_node == nullptr) |
| 4371 | return; | 4367 | return; |
| 4372 | } else { | 4368 | } else { |
| ... | @@ -4385,7 +4381,7 @@ static void visit_var_decl(Context *c, const clang::VarDecl *var_decl) { | ... | @@ -4385,7 +4381,7 @@ static void visit_var_decl(Context *c, const clang::VarDecl *var_decl) { |
| 4385 | return; | 4381 | return; |
| 4386 | } | 4382 | } |
| 4387 | | 4383 | |
| 4388 | emit_warning(c, var_decl->getLocation(), | 4384 | emit_warning(c, bitcast(var_decl->getLocation()), |
| 4389 | "ignoring variable '%s' - non-extern, non-static variable", buf_ptr(name)); | 4385 | "ignoring variable '%s' - non-extern, non-static variable", buf_ptr(name)); |
| 4390 | return; | 4386 | return; |
| 4391 | } | 4387 | } |
| ... | @@ -4405,13 +4401,13 @@ static bool decl_visitor(void *context, const ZigClangDecl *zdecl) { | ... | @@ -4405,13 +4401,13 @@ static bool decl_visitor(void *context, const ZigClangDecl *zdecl) { |
| 4405 | resolve_enum_decl(c, static_cast<const clang::EnumDecl *>(decl)); | 4401 | resolve_enum_decl(c, static_cast<const clang::EnumDecl *>(decl)); |
| 4406 | break; | 4402 | break; |
| 4407 | case clang::Decl::Record: | 4403 | case clang::Decl::Record: |
| 4408 | resolve_record_decl(c, static_cast<const clang::RecordDecl *>(decl)); | 4404 | resolve_record_decl(c, (const ZigClangRecordDecl *)(decl)); |
| 4409 | break; | 4405 | break; |
| 4410 | case clang::Decl::Var: | 4406 | case clang::Decl::Var: |
| 4411 | visit_var_decl(c, static_cast<const clang::VarDecl *>(decl)); | 4407 | visit_var_decl(c, static_cast<const clang::VarDecl *>(decl)); |
| 4412 | break; | 4408 | break; |
| 4413 | default: | 4409 | default: |
| 4414 | emit_warning(c, decl->getLocation(), "ignoring %s decl", decl->getDeclKindName()); | 4410 | emit_warning(c, bitcast(decl->getLocation()), "ignoring %s decl", decl->getDeclKindName()); |
| 4415 | } | 4411 | } |
| 4416 | | 4412 | |
| 4417 | return true; | 4413 | return true; |
| ... | @@ -4846,10 +4842,10 @@ static void process_preprocessor_entities(Context *c, ZigClangASTUnit *zunit) { | ... | @@ -4846,10 +4842,10 @@ static void process_preprocessor_entities(Context *c, ZigClangASTUnit *zunit) { |
| 4846 | clang::MacroDefinitionRecord *macro = static_cast<clang::MacroDefinitionRecord *>(entity); | 4842 | clang::MacroDefinitionRecord *macro = static_cast<clang::MacroDefinitionRecord *>(entity); |
| 4847 | const char *raw_name = macro->getName()->getNameStart(); | 4843 | const char *raw_name = macro->getName()->getNameStart(); |
| 4848 | clang::SourceRange range = macro->getSourceRange(); | 4844 | clang::SourceRange range = macro->getSourceRange(); |
| 4849 | clang::SourceLocation begin_loc = range.getBegin(); | 4845 | ZigClangSourceLocation begin_loc = bitcast(range.getBegin()); |
| 4850 | clang::SourceLocation end_loc = range.getEnd(); | 4846 | ZigClangSourceLocation end_loc = bitcast(range.getEnd()); |
| 4851 | | 4847 | |
| 4852 | if (begin_loc == end_loc) { | 4848 | if (ZigClangSourceLocation_eq(begin_loc, end_loc)) { |
| 4853 | // this means it is a macro without a value | 4849 | // this means it is a macro without a value |
| 4854 | // we don't care about such things | 4850 | // we don't care about such things |
| 4855 | continue; | 4851 | continue; |
| ... | @@ -4859,7 +4855,7 @@ static void process_preprocessor_entities(Context *c, ZigClangASTUnit *zunit) { | ... | @@ -4859,7 +4855,7 @@ static void process_preprocessor_entities(Context *c, ZigClangASTUnit *zunit) { |
| 4859 | continue; | 4855 | continue; |
| 4860 | } | 4856 | } |
| 4861 | | 4857 | |
| 4862 | const char *begin_c = ZigClangSourceManager_getCharacterData(c->source_manager, bitcast(begin_loc)); | 4858 | const char *begin_c = ZigClangSourceManager_getCharacterData(c->source_manager, begin_loc); |
| 4863 | process_macro(c, &ctok, name, begin_c); | 4859 | process_macro(c, &ctok, name, begin_c); |
| 4864 | } | 4860 | } |
| 4865 | } | 4861 | } |