| ... | @@ -118,7 +118,7 @@ static int trans_stmt_extra(Context *c, TransScope *scope, const Stmt *stmt, | ... | @@ -118,7 +118,7 @@ static int trans_stmt_extra(Context *c, TransScope *scope, const Stmt *stmt, |
| 118 | static TransScope *trans_stmt(Context *c, TransScope *scope, const Stmt *stmt, AstNode **out_node); | 118 | static TransScope *trans_stmt(Context *c, TransScope *scope, const Stmt *stmt, AstNode **out_node); |
| 119 | static AstNode *trans_expr(Context *c, ResultUsed result_used, TransScope *scope, const Expr *expr, TransLRValue lrval); | 119 | static AstNode *trans_expr(Context *c, ResultUsed result_used, TransScope *scope, const Expr *expr, TransLRValue lrval); |
| 120 | static AstNode *trans_qual_type(Context *c, QualType qt, const SourceLocation &source_loc); | 120 | static AstNode *trans_qual_type(Context *c, QualType qt, const SourceLocation &source_loc); |
| 121 | | 121 | static AstNode *trans_to_bool_expr(Context *c, TransScope *scope, AstNode *expr); |
| 122 | | 122 | |
| 123 | ATTRIBUTE_PRINTF(3, 4) | 123 | ATTRIBUTE_PRINTF(3, 4) |
| 124 | static void emit_warning(Context *c, const SourceLocation &sl, const char *format, ...) { | 124 | static void emit_warning(Context *c, const SourceLocation &sl, const char *format, ...) { |
| ... | @@ -632,7 +632,7 @@ static bool c_is_signed_integer(Context *c, QualType qt) { | ... | @@ -632,7 +632,7 @@ static bool c_is_signed_integer(Context *c, QualType qt) { |
| 632 | case BuiltinType::Int128: | 632 | case BuiltinType::Int128: |
| 633 | case BuiltinType::WChar_S: | 633 | case BuiltinType::WChar_S: |
| 634 | return true; | 634 | return true; |
| 635 | default: | 635 | default: |
| 636 | return false; | 636 | return false; |
| 637 | } | 637 | } |
| 638 | } | 638 | } |
| ... | @@ -653,7 +653,7 @@ static bool c_is_unsigned_integer(Context *c, QualType qt) { | ... | @@ -653,7 +653,7 @@ static bool c_is_unsigned_integer(Context *c, QualType qt) { |
| 653 | case BuiltinType::UInt128: | 653 | case BuiltinType::UInt128: |
| 654 | case BuiltinType::WChar_U: | 654 | case BuiltinType::WChar_U: |
| 655 | return true; | 655 | return true; |
| 656 | default: | 656 | default: |
| 657 | return false; | 657 | return false; |
| 658 | } | 658 | } |
| 659 | } | 659 | } |
| ... | @@ -678,7 +678,7 @@ static bool c_is_float(Context *c, QualType qt) { | ... | @@ -678,7 +678,7 @@ static bool c_is_float(Context *c, QualType qt) { |
| 678 | case BuiltinType::Float128: | 678 | case BuiltinType::Float128: |
| 679 | case BuiltinType::LongDouble: | 679 | case BuiltinType::LongDouble: |
| 680 | return true; | 680 | return true; |
| 681 | default: | 681 | default: |
| 682 | return false; | 682 | return false; |
| 683 | } | 683 | } |
| 684 | } | 684 | } |
| ... | @@ -1389,7 +1389,7 @@ static AstNode *trans_create_compound_assign_shift(Context *c, ResultUsed result | ... | @@ -1389,7 +1389,7 @@ static AstNode *trans_create_compound_assign_shift(Context *c, ResultUsed result |
| 1389 | if (result_used == ResultUsedYes) { | 1389 | if (result_used == ResultUsedYes) { |
| 1390 | // break :x *_ref | 1390 | // break :x *_ref |
| 1391 | child_scope->node->data.block.statements.append( | 1391 | child_scope->node->data.block.statements.append( |
| 1392 | trans_create_node_break(c, label_name, | 1392 | trans_create_node_break(c, label_name, |
| 1393 | trans_create_node_prefix_op(c, PrefixOpDereference, | 1393 | trans_create_node_prefix_op(c, PrefixOpDereference, |
| 1394 | trans_create_node_symbol(c, tmp_var_name)))); | 1394 | trans_create_node_symbol(c, tmp_var_name)))); |
| 1395 | } | 1395 | } |
| ... | @@ -1918,7 +1918,7 @@ static AstNode *trans_unary_operator(Context *c, ResultUsed result_used, TransSc | ... | @@ -1918,7 +1918,7 @@ static AstNode *trans_unary_operator(Context *c, ResultUsed result_used, TransSc |
| 1918 | switch (stmt->getOpcode()) { | 1918 | switch (stmt->getOpcode()) { |
| 1919 | case UO_LNot: | 1919 | case UO_LNot: |
| 1920 | // TODO: Handle int, float, pointer negation | 1920 | // TODO: Handle int, float, pointer negation |
| 1921 | return trans_create_node_prefix_op(c, PrefixOpBoolNot, sub_node); | 1921 | return trans_create_node_prefix_op(c, PrefixOpBoolNot, trans_to_bool_expr(c, scope, sub_node)); |
| 1922 | case UO_Not: | 1922 | case UO_Not: |
| 1923 | return trans_create_node_prefix_op(c, PrefixOpBinNot, sub_node); | 1923 | return trans_create_node_prefix_op(c, PrefixOpBinNot, sub_node); |
| 1924 | default: | 1924 | default: |
| ... | @@ -2291,7 +2291,7 @@ static AstNode *trans_while_loop(Context *c, TransScope *scope, const WhileStmt | ... | @@ -2291,7 +2291,7 @@ static AstNode *trans_while_loop(Context *c, TransScope *scope, const WhileStmt |
| 2291 | | 2291 | |
| 2292 | TransScope *body_scope = trans_stmt(c, &while_scope->base, stmt->getBody(), | 2292 | TransScope *body_scope = trans_stmt(c, &while_scope->base, stmt->getBody(), |
| 2293 | &while_scope->node->data.while_expr.body); | 2293 | &while_scope->node->data.while_expr.body); |
| 2294 | if (body_scope == nullptr) | 2294 | if (body_scope == nullptr) |
| 2295 | return nullptr; | 2295 | return nullptr; |
| 2296 | | 2296 | |
| 2297 | return while_scope->node; | 2297 | return while_scope->node; |