comparison gcc/c-parser.c @ 61:60c1b2f8487a

remove expand_cbc_goto, and added warnig process.
author ryoma <e075725@ie.u-ryukyu.ac.jp>
date Sun, 25 Apr 2010 17:03:45 +0900
parents 5b5b9ea5b220
children 1b10fe6932e1
comparison
equal deleted inserted replaced
60:bd49c42ec43e 61:60c1b2f8487a
3879 /* Parse a statement, other than a labeled statement. */ 3879 /* Parse a statement, other than a labeled statement. */
3880 3880
3881 static void 3881 static void
3882 c_parser_statement_after_labels (c_parser *parser) 3882 c_parser_statement_after_labels (c_parser *parser)
3883 { 3883 {
3884 struct c_expr expr;
3884 location_t loc = c_parser_peek_token (parser)->location; 3885 location_t loc = c_parser_peek_token (parser)->location;
3885 tree stmt = NULL_TREE; 3886 tree stmt = NULL_TREE;
3886 bool in_if_block = parser->in_if_block; 3887 bool in_if_block = parser->in_if_block;
3887 parser->in_if_block = false; 3888 parser->in_if_block = false;
3888 switch (c_parser_peek_token (parser)->type) 3889 switch (c_parser_peek_token (parser)->type)
3929 c_parser_expression (parser).value); 3930 c_parser_expression (parser).value);
3930 } 3931 }
3931 else 3932 else
3932 #ifndef noCbC 3933 #ifndef noCbC
3933 { 3934 {
3934 struct c_expr expr;
3935 if (c_parser_next_token_is (parser, CPP_NAME)) 3935 if (c_parser_next_token_is (parser, CPP_NAME))
3936 { 3936 {
3937 tree id = c_parser_peek_token (parser)->value; 3937 tree id = c_parser_peek_token (parser)->value;
3938 location_t loc = c_parser_peek_token (parser)->location; 3938 location_t loc = c_parser_peek_token (parser)->location;
3939 /** build_external_ref (id,RID_CbC_CODE , loc); **/ 3939 /** build_external_ref (id,RID_CbC_CODE , loc); **/
3940 build_external_ref (loc, id, RID_CbC_CODE, &expr.original_type); 3940 build_external_ref (loc, id, RID_CbC_CODE, &expr.original_type);
3941 } 3941 }
3942 expr = c_parser_expr_no_commas (parser, NULL); 3942 expr = c_parser_expr_no_commas (parser, NULL);
3943 if (TREE_CODE(expr.value) == CALL_EXPR ) 3943 if (TREE_CODE(expr.value) == CALL_EXPR )
3944 { 3944 {
3945 location_t loc = c_parser_peek_token (parser)->location; 3945 location_t loc = c_parser_peek_token (parser)->location;
3946 cbc_replace_arguments (loc, expr.value); 3946 cbc_replace_arguments (loc, expr.value);
3947 3947
3948 TREE_TYPE(expr.value) = void_type_node; 3948 TREE_TYPE(expr.value) = void_type_node;
3949 /*tree env = NULL_TREE;**/ 3949 /*tree env = NULL_TREE;**/
3950 CbC_IS_CbC_GOTO (expr.value) = 1; 3950 CbC_IS_CbC_GOTO (expr.value) = 1;
3951 CALL_EXPR_TAILCALL (expr.value) = 1; 3951 CALL_EXPR_TAILCALL (expr.value) = 1;
3952 add_stmt(expr.value); 3952 add_stmt(expr.value);
3953 stmt = c_finish_return(loc, NULL_TREE, NULL_TREE); /* stmt = c_finish_return (0); */ 3953 stmt = c_finish_return(loc, NULL_TREE, NULL_TREE); /* stmt = c_finish_return (0); */
3954 } 3954 }
3955 else 3955 else
3956 c_parser_error (parser, "expected code segment jump or %<*%>"); 3956 c_parser_error (parser, "expected code segment jump or %<*%>");
3957 } 3957 }
3958 #else 3958 #else
3959 c_parser_error (parser, "expected identifier or %<*%>"); 3959 c_parser_error (parser, "expected identifier or %<*%>");
3960 #endif 3960 #endif
3961 goto expect_semicolon; 3961 goto expect_semicolon;
5654 c_parser_error (parser, "expected expression"); 5654 c_parser_error (parser, "expected expression");
5655 expr.value = error_mark_node; 5655 expr.value = error_mark_node;
5656 break; 5656 break;
5657 } 5657 }
5658 { 5658 {
5659 tree id = c_parser_peek_token (parser)->value; 5659 tree id = c_parser_peek_token (parser)->value;
5660 c_parser_consume_token (parser); 5660 c_parser_consume_token (parser);
5661 expr.value = build_external_ref (loc, id, 5661 expr.value = build_external_ref (loc, id,
5662 (c_parser_peek_token (parser)->type 5662 (c_parser_peek_token (parser)->type
5663 == CPP_OPEN_PAREN), 5663 == CPP_OPEN_PAREN),
5664 &expr.original_type); 5664 &expr.original_type);
5665 } 5665 }
5666 break; 5666 break;
5667 case CPP_OPEN_PAREN: 5667 case CPP_OPEN_PAREN:
5668 /* A parenthesized expression, statement expression or compound 5668 /* A parenthesized expression, statement expression or compound
5669 literal. */ 5669 literal. */