Mercurial > hg > CbC > CbC_gcc
comparison gcc/c-parser.c @ 71:e334828451cb
modify gcc/c-parser.c
author | Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp> |
---|---|
date | Sun, 21 Aug 2011 14:50:19 +0900 |
parents | b81903832de2 |
children | f26ecf70364b |
comparison
equal
deleted
inserted
replaced
70:b81903832de2 | 71:e334828451cb |
---|---|
54 #include "c-family/c-common.h" | 54 #include "c-family/c-common.h" |
55 #include "c-family/c-objc.h" | 55 #include "c-family/c-objc.h" |
56 #include "vec.h" | 56 #include "vec.h" |
57 #include "target.h" | 57 #include "target.h" |
58 #include "cgraph.h" | 58 #include "cgraph.h" |
59 #ifndef noCbC | |
60 #include "cbc-tree.h" | |
61 #endif | |
59 #include "plugin.h" | 62 #include "plugin.h" |
60 | 63 |
61 | 64 |
62 /* Initialization routine for this file. */ | 65 /* Initialization routine for this file. */ |
63 | 66 |
648 case RID_RESTRICT: | 651 case RID_RESTRICT: |
649 case RID_ATTRIBUTE: | 652 case RID_ATTRIBUTE: |
650 case RID_FRACT: | 653 case RID_FRACT: |
651 case RID_ACCUM: | 654 case RID_ACCUM: |
652 case RID_SAT: | 655 case RID_SAT: |
656 #ifndef noCbC | |
657 case RID_CbC_CODE: | |
658 #endif | |
653 return true; | 659 return true; |
654 default: | 660 default: |
655 return false; | 661 return false; |
656 } | 662 } |
657 case CPP_LESS: | 663 case CPP_LESS: |
2088 t.expr = NULL_TREE; | 2094 t.expr = NULL_TREE; |
2089 t.expr_const_operands = true; | 2095 t.expr_const_operands = true; |
2090 declspecs_add_type (loc, specs, t); | 2096 declspecs_add_type (loc, specs, t); |
2091 c_parser_consume_token (parser); | 2097 c_parser_consume_token (parser); |
2092 break; | 2098 break; |
2099 #ifndef noCbC | |
2100 case RID_CbC_CODE: | |
2101 if (!typespec_ok) | |
2102 goto out; | |
2103 attrs_ok = true; | |
2104 seen_type = true; | |
2105 if (c_dialect_objc ()) | |
2106 parser->objc_need_raw_identifier = true; | |
2107 t.kind = ctsk_resword; | |
2108 t.spec = c_parser_peek_token (parser)->value; | |
2109 declspecs_add_type (loc, specs, t); | |
2110 | |
2111 /* | |
2112 attrs = get_identifier("fastcall"); | |
2113 attrs = build_tree_list(attrs, NULL_TREE); | |
2114 declspecs_add_attrs(specs, attrs); | |
2115 */ | |
2116 attrs = build_tree_list (get_identifier("fastcall"), NULL_TREE); | |
2117 /*attrs = build_tree_list (get_identifier("noreturn"), attrs);*/ | |
2118 declspecs_add_attrs(specs, attrs); | |
2119 | |
2120 c_parser_consume_token (parser); | |
2121 break; | |
2122 #endif | |
2093 case RID_ENUM: | 2123 case RID_ENUM: |
2094 if (!typespec_ok) | 2124 if (!typespec_ok) |
2095 goto out; | 2125 goto out; |
2096 attrs_ok = true; | 2126 attrs_ok = true; |
2097 seen_type = true; | 2127 seen_type = true; |
4304 && c_parser_peek_2nd_token (parser)->type == CPP_COLON)) | 4334 && c_parser_peek_2nd_token (parser)->type == CPP_COLON)) |
4305 c_parser_label (parser); | 4335 c_parser_label (parser); |
4306 c_parser_statement_after_labels (parser); | 4336 c_parser_statement_after_labels (parser); |
4307 } | 4337 } |
4308 | 4338 |
4339 #if 0 | |
4340 static tree | |
4341 c_parser_cbc_make_env(c_parser *parser) | |
4342 { | |
4343 struct c_expr env; | |
4344 tree field, fields=NULL_TREE; | |
4345 tree env_struct, env_struct_type; | |
4346 tree ebp, argsp; | |
4347 tree tmp; | |
4348 | |
4349 c_parser_consume_token (parser); | |
4350 env = c_parser_expr_no_commas (parser, NULL); | |
4351 env = default_function_array_conversion (env); | |
4352 | |
4353 /* build type_node of environment structure */ | |
4354 env_struct_type = start_struct (RECORD_TYPE, NULL_TREE); | |
4355 field = build_decl (FIELD_DECL, get_identifier("sp"), ptr_type_node); | |
4356 fields = chainon (field, fields); | |
4357 field = build_decl (FIELD_DECL, get_identifier("argsp"), ptr_type_node); | |
4358 fields = chainon (field, fields); | |
4359 //field = build_decl (FIELD_DECL, get_identifier("retval"), intSI_type_node); | |
4360 //fields = chainon (field, fields); | |
4361 fields = nreverse(fields); | |
4362 finish_struct (env_struct_type, fields, NULL_TREE); | |
4363 | |
4364 env_struct = build_c_cast (build_pointer_type(env_struct_type), env.value); | |
4365 //build_component_ref (cbc_env, get_identifier("argsp")); | |
4366 ebp = build_component_ref (build_indirect_ref (loc,env_struct, "CbCenv->sp"), get_identifier("sp")); | |
4367 argsp = build_component_ref (build_indirect_ref (loc, env_struct, "CbCenv->sp"), get_identifier("argsp")); | |
4368 //ebp = chainon (ebp, argsp); | |
4369 tmp = build_tree_list (ebp, argsp); | |
4370 | |
4371 return tmp; | |
4372 } | |
4373 #endif | |
4374 | |
4375 static tree | |
4376 cbc_replace_arguments (location_t loc, tree call) | |
4377 { | |
4378 tree args; | |
4379 tree fn; | |
4380 tree tmp_decl; | |
4381 int i=0; | |
4382 | |
4383 fn = CALL_EXPR_FN (call); | |
4384 if ( TREE_CODE (fn)==PARM_DECL || !TREE_CONSTANT (fn) ) | |
4385 { | |
4386 tmp_decl = build_decl (loc, VAR_DECL, NULL_TREE, TREE_TYPE(fn)); | |
4387 pushdecl (tmp_decl); | |
4388 | |
4389 add_stmt (build_modify_expr (loc, tmp_decl, NULL_TREE, NOP_EXPR, loc, fn, NULL_TREE)); | |
4390 CALL_EXPR_FN (call) = tmp_decl; | |
4391 } | |
4392 | |
4393 args = CALL_EXPR_ARGS (call); | |
4394 for ( ;args; args = TREE_CHAIN (args), i++) | |
4395 { | |
4396 tree arg = TREE_VALUE (args); | |
4397 | |
4398 //if ( !CONSTANT_CLASS_P (arg) && !VAR_OR_FUNCTION_DECL_P (arg) ) | |
4399 if ( TREE_CODE (arg)==PARM_DECL || !TREE_CONSTANT (arg) ) | |
4400 { | |
4401 tmp_decl = build_decl (loc, VAR_DECL, NULL_TREE, TREE_TYPE(arg)); | |
4402 pushdecl (tmp_decl); | |
4403 | |
4404 add_stmt (build_modify_expr (loc, tmp_decl, NULL_TREE, NOP_EXPR, loc, arg, NULL_TREE)); | |
4405 CALL_EXPR_ARG (call, i) = tmp_decl; | |
4406 } | |
4407 } | |
4408 | |
4409 return call; | |
4410 } | |
4411 | |
4309 /* Parse a statement, other than a labeled statement. */ | 4412 /* Parse a statement, other than a labeled statement. */ |
4310 | 4413 |
4311 static void | 4414 static void |
4312 c_parser_statement_after_labels (c_parser *parser) | 4415 c_parser_statement_after_labels (c_parser *parser) |
4313 { | 4416 { |
4338 case RID_FOR: | 4441 case RID_FOR: |
4339 c_parser_for_statement (parser); | 4442 c_parser_for_statement (parser); |
4340 break; | 4443 break; |
4341 case RID_GOTO: | 4444 case RID_GOTO: |
4342 c_parser_consume_token (parser); | 4445 c_parser_consume_token (parser); |
4446 #ifndef noCbC | |
4447 if ( c_parser_next_token_is (parser, CPP_NAME) | |
4448 && c_parser_peek_2nd_token (parser)->type == CPP_SEMICOLON ) | |
4449 { | |
4450 #else | |
4451 if (c_parser_next_token_is (parser, CPP_NAME)) | |
4452 { | |
4453 #endif | |
4343 if (c_parser_next_token_is (parser, CPP_NAME)) | 4454 if (c_parser_next_token_is (parser, CPP_NAME)) |
4344 { | 4455 { |
4345 stmt = c_finish_goto_label (loc, | 4456 stmt = c_finish_goto_label (loc, |
4346 c_parser_peek_token (parser)->value); | 4457 c_parser_peek_token (parser)->value); |
4347 c_parser_consume_token (parser); | 4458 c_parser_consume_token (parser); |
4354 val = c_parser_expression (parser).value; | 4465 val = c_parser_expression (parser).value; |
4355 mark_exp_read (val); | 4466 mark_exp_read (val); |
4356 stmt = c_finish_goto_ptr (loc, val); | 4467 stmt = c_finish_goto_ptr (loc, val); |
4357 } | 4468 } |
4358 else | 4469 else |
4470 #ifndef noCbC | |
4471 { | |
4472 if (c_parser_next_token_is (parser, CPP_NAME)) | |
4473 { | |
4474 tree id = c_parser_peek_token (parser)->value; | |
4475 location_t loc = c_parser_peek_token (parser)->location; | |
4476 /** build_external_ref (id,RID_CbC_CODE , loc); **/ | |
4477 build_external_ref (loc, id, RID_CbC_CODE, &expr.original_type); | |
4478 } | |
4479 expr = c_parser_expr_no_commas (parser, NULL); | |
4480 if (TREE_CODE(expr.value) == CALL_EXPR ) | |
4481 { | |
4482 location_t loc = c_parser_peek_token (parser)->location; | |
4483 cbc_replace_arguments (loc, expr.value); | |
4484 | |
4485 TREE_TYPE(expr.value) = void_type_node; | |
4486 /*tree env = NULL_TREE;**/ | |
4487 CbC_IS_CbC_GOTO (expr.value) = 1; | |
4488 CALL_EXPR_TAILCALL (expr.value) = 1; | |
4489 add_stmt(expr.value); | |
4490 stmt = c_finish_return(loc, NULL_TREE, NULL_TREE); /* stmt = c_finish_return (0); */ | |
4491 } | |
4492 else | |
4493 c_parser_error (parser, "expected code segment jump or %<*%>"); | |
4494 } | |
4495 #else | |
4359 c_parser_error (parser, "expected identifier or %<*%>"); | 4496 c_parser_error (parser, "expected identifier or %<*%>"); |
4497 #endif | |
4360 goto expect_semicolon; | 4498 goto expect_semicolon; |
4361 case RID_CONTINUE: | 4499 case RID_CONTINUE: |
4362 c_parser_consume_token (parser); | 4500 c_parser_consume_token (parser); |
4363 stmt = c_finish_bc_stmt (loc, &c_cont_label, false); | 4501 stmt = c_finish_bc_stmt (loc, &c_cont_label, false); |
4364 goto expect_semicolon; | 4502 goto expect_semicolon; |
6007 @encode ( type-name ) | 6145 @encode ( type-name ) |
6008 objc-string-literal | 6146 objc-string-literal |
6009 Classname . identifier | 6147 Classname . identifier |
6010 */ | 6148 */ |
6011 | 6149 |
6150 static void | |
6151 cbc_finish_labeled_goto (location_t loc, tree label, tree retval) | |
6152 { | |
6153 /* add statement below. | |
6154 * | |
6155 * if (0) { | |
6156 * _cbc_exit0: | |
6157 * return retval; | |
6158 * } | |
6159 */ | |
6160 tree tlab; | |
6161 tree cond; | |
6162 | |
6163 tree cstmt = c_begin_compound_stmt (true); | |
6164 | |
6165 tlab = define_label (loc, label); | |
6166 gcc_assert (tlab); | |
6167 decl_attributes (&tlab, NULL_TREE, 0); | |
6168 add_stmt (build_stmt (loc, LABEL_EXPR, tlab)); | |
6169 | |
6170 tree ret = c_finish_return (loc, retval, retval); /*tree ret = c_finish_return (retval);*/ | |
6171 TREE_USED(ret) = 1; | |
6172 | |
6173 cond = integer_zero_node; | |
6174 tree if_body = c_end_compound_stmt (loc, cstmt, true); | |
6175 TREE_SIDE_EFFECTS (cstmt) = 1; | |
6176 c_finish_if_stmt (loc, cond, if_body, NULL_TREE, false); | |
6177 } | |
6178 | |
6179 static tree | |
6180 cbc_finish_nested_function (location_t loc, tree label, tree retval_decl) | |
6181 { | |
6182 | |
6183 /* add statement below. | |
6184 * void __return_func(int _retval, void *_envp){ | |
6185 * retval = _retval; | |
6186 * goto exit0; | |
6187 * } | |
6188 */ | |
6189 /* TODO: | |
6190 * retval(lhs)のTREE_DECLを引数から取得するように | |
6191 * int _retvalパラメータのタイプはretvalに合わせる | |
6192 */ | |
6193 | |
6194 tree fnbody; | |
6195 tree _retval_decl, _envp_decl; | |
6196 struct c_declarator *declarator; | |
6197 //tree ident; | |
6198 struct c_arg_info *args; | |
6199 struct c_declspecs *specs; | |
6200 struct c_typespec t; | |
6201 { | |
6202 push_scope (); | |
6203 declare_parm_level (); | |
6204 /*tree retval_type = TREE_TYPE(retval_decl);*/ | |
6205 | |
6206 _retval_decl = build_decl (loc, PARM_DECL, get_identifier ("_retval"), TREE_TYPE(retval_decl)); | |
6207 DECL_SOURCE_LOCATION (_retval_decl) = loc; | |
6208 DECL_ARTIFICIAL (_retval_decl) = 1; | |
6209 DECL_ARG_TYPE (_retval_decl) = TREE_TYPE(retval_decl); | |
6210 pushdecl (_retval_decl); | |
6211 finish_decl (_retval_decl, loc, NULL_TREE, NULL_TREE, NULL_TREE); | |
6212 | |
6213 _envp_decl = build_decl (loc, PARM_DECL, get_identifier ("_envp"), ptr_type_node); | |
6214 DECL_SOURCE_LOCATION (_envp_decl) = loc; | |
6215 DECL_ARTIFICIAL (_envp_decl) = 1; | |
6216 DECL_ARG_TYPE (_envp_decl) = ptr_type_node; | |
6217 pushdecl (_envp_decl); | |
6218 finish_decl (_envp_decl, loc, NULL_TREE, NULL_TREE, NULL_TREE); | |
6219 | |
6220 args = get_parm_info(false); | |
6221 pop_scope(); | |
6222 } | |
6223 | |
6224 t.kind = ctsk_resword; | |
6225 t.spec = get_identifier("void"); | |
6226 specs = build_null_declspecs(); | |
6227 declspecs_add_type (loc, specs, t); | |
6228 finish_declspecs (specs); | |
6229 | |
6230 /* make nested function. */ | |
6231 declarator = build_id_declarator (get_identifier ("_cbc_internal_return")); | |
6232 declarator = build_function_declarator (args, declarator); | |
6233 | |
6234 c_push_function_context (); | |
6235 | |
6236 if (!start_function (specs, declarator, NULL_TREE)) | |
6237 { | |
6238 c_pop_function_context(); | |
6239 gcc_assert (0); | |
6240 } | |
6241 store_parm_decls (); | |
6242 | |
6243 | |
6244 /* start compound statement. */ | |
6245 tree cstmt = c_begin_compound_stmt (true); | |
6246 | |
6247 add_stmt (build_modify_expr (loc, retval_decl, NULL_TREE, NOP_EXPR, loc, _retval_decl, NULL_TREE)); | |
6248 //tree stmt = c_finish_goto_label (loc, label); | |
6249 | |
6250 /* end compound statement. */ | |
6251 fnbody = c_end_compound_stmt (loc, cstmt, true); | |
6252 TREE_SIDE_EFFECTS (cstmt) = 1; | |
6253 | |
6254 /* finish declaration of nested function. */ | |
6255 tree decl = current_function_decl; | |
6256 add_stmt (fnbody); | |
6257 finish_function (); | |
6258 c_pop_function_context (); | |
6259 | |
6260 add_stmt (build_stmt (loc, DECL_EXPR, decl)); | |
6261 return decl; | |
6262 | |
6263 } | |
6264 | |
6012 static struct c_expr | 6265 static struct c_expr |
6013 c_parser_postfix_expression (c_parser *parser) | 6266 c_parser_postfix_expression (c_parser *parser) |
6014 { | 6267 { |
6015 struct c_expr expr, e1, e2, e3; | 6268 struct c_expr expr, e1, e2, e3; |
6016 struct c_type_name *t1, *t2; | 6269 struct c_type_name *t1, *t2; |
6270 //cbc? static tree return_label1; | |
6017 location_t loc = c_parser_peek_token (parser)->location;; | 6271 location_t loc = c_parser_peek_token (parser)->location;; |
6018 expr.original_code = ERROR_MARK; | 6272 expr.original_code = ERROR_MARK; |
6019 expr.original_type = NULL; | 6273 expr.original_type = NULL; |
6020 switch (c_parser_peek_token (parser)->type) | 6274 switch (c_parser_peek_token (parser)->type) |
6021 { | 6275 { |
6433 { | 6687 { |
6434 tree type = groktypename (t1, NULL, NULL); | 6688 tree type = groktypename (t1, NULL, NULL); |
6435 expr.value = objc_build_encode_expr (type); | 6689 expr.value = objc_build_encode_expr (type); |
6436 } | 6690 } |
6437 break; | 6691 break; |
6692 #ifndef noCbC | |
6693 case RID_CbC_ENV: | |
6694 { | |
6695 c_parser_consume_token (parser); | |
6696 /* get value of %ebp. */ | |
6697 /*tree env_tree = build_external_ref ( | |
6698 get_identifier ("__builtin_frame_address"), 0, | |
6699 c_parser_peek_token (parser)->location);*/ | |
6700 loc = c_parser_peek_token (parser)->location; | |
6701 tree env_tree = build_external_ref (loc, | |
6702 get_identifier ("__builtin_frame_address"), 0, &expr.original_type); | |
6703 expr.value = build_function_call(loc, env_tree, | |
6704 build_tree_list (NULL_TREE, build_int_cst (NULL_TREE,0))); | |
6705 expr.original_code = ERROR_MARK; | |
6706 | |
6707 } | |
6708 break; | |
6709 case RID_CbC_RET: | |
6710 case RID_RETURN: | |
6711 | |
6712 #if 0 | |
6713 if (cbc_return_f==0) | |
6714 { tree retval; | |
6715 | |
6716 /* | |
6717 Generates something like... | |
6718 | |
6719 int retval = 1; | |
6720 void (*ret)(int retval_,void *fp) ; | |
6721 | |
6722 ret = ({ | |
6723 __label__ exit0; | |
6724 volatile static flag = 0; | |
6725 void __return_func(int retval_,void *fp) { | |
6726 retval = retval_; | |
6727 goto exit0; | |
6728 } | |
6729 if (flag) { | |
6730 exit0: | |
6731 printf("f1: fp = 0x%x\n",__builtin_frame_address(0)); | |
6732 return retval; | |
6733 } | |
6734 __return_func; | |
6735 }); | |
6736 | |
6737 */ | |
6738 | |
6739 tree stmt = c_begin_stmt_expr (); | |
6740 cbc_return_f = c_parser_peek_token (parser)->value; | |
6741 cbc_return = c_parser_peek_token (parser)->location; | |
6742 c_parser_consume_token (parser); | |
6743 location_t next = c_parser_peek_token (parser)->location; | |
6744 | |
6745 // dummy variable for hidden condition | |
6746 struct c_expr cexpr; | |
6747 tree cond; | |
6748 location_t loc; | |
6749 loc = next; | |
6750 tree decl_cond = | |
6751 build_decl (VAR_DECL, get_identifier ("__return"), | |
6752 intHI_type_node); | |
6753 TREE_STATIC (decl_cond) = 1; | |
6754 cexpr.value = lang_hooks.decls.pushdecl(decl_cond); | |
6755 | |
6756 cexpr.original_code = ERROR_MARK; | |
6757 cond = c_objc_common_truthvalue_conversion(loc, cexpr.value); | |
6758 if (EXPR_P (cond)) | |
6759 SET_EXPR_LOCATION (cond, loc); | |
6760 | |
6761 | |
6762 | |
6763 | |
6764 tree fwlabel = create_artificial_label (); | |
6765 //TREE_USED(fwlabel) = 1; | |
6766 | |
6767 //add_stmt (build1 (GOTO_EXPR, void_type_node, fwlabel)); | |
6768 tree block = c_begin_compound_stmt (flag_isoc99); | |
6769 | |
6770 tree tlab = lookup_label(cbc_return_f); | |
6771 | |
6772 tree decl= build_stmt (LABEL_EXPR, tlab); | |
6773 //TREE_USED(decl) = 1; | |
6774 add_stmt(decl); | |
6775 | |
6776 //tree hoge = build_int_cst(NULL_TREE,55); | |
6777 retval = build_component_ref (cbc_env, get_identifier("retval")); | |
6778 tree ret = c_finish_return (retval); | |
6779 TREE_USED(ret) = 1; | |
6780 tree first_body = c_end_compound_stmt (block, flag_isoc99); | |
6781 | |
6782 c_finish_if_stmt (loc, cond, first_body, NULL_TREE, false); | |
6783 | |
6784 // define_label(EXPR_LOCATION(decl) ,cbc_return_f); | |
6785 return_label1 = | |
6786 define_label(cbc_return ,cbc_return_f); | |
6787 tree fwdef= build_stmt (LABEL_EXPR, fwlabel); | |
6788 | |
6789 //TREE_USED(fwdef) = 1; | |
6790 add_stmt(fwdef); | |
6791 TREE_SIDE_EFFECTS (block) = 1; | |
6792 | |
6793 // tree label = lookup_label(c_parser_peek_token (parser)->value); | |
6794 //TREE_USED(label) = 1; | |
6795 | |
6796 tree value = build1(ADDR_EXPR, ptr_type_node, return_label1); | |
6797 SET_EXPR_LOCATION (value, next); | |
6798 TREE_SIDE_EFFECTS (value) = 1; | |
6799 add_stmt(value); | |
6800 | |
6801 TREE_SIDE_EFFECTS (stmt) = 1; | |
6802 expr.value = c_finish_stmt_expr (stmt); | |
6803 expr.original_code = ERROR_MARK; | |
6804 | |
6805 | |
6806 } | |
6807 else | |
6808 { | |
6809 //tree label = lookup_label(c_parser_peek_token (parser)->value); | |
6810 //TREE_USED(label) = 1; | |
6811 //expr.value = build1(ADDR_EXPR, ptr_type_node, label); | |
6812 expr.value = build1(ADDR_EXPR, ptr_type_node, return_label1); | |
6813 c_parser_consume_token (parser); | |
6814 } | |
6815 #else //by KENT. | |
6816 { | |
6817 /* | |
6818 ({ | |
6819 __label__ _cbc_exit0; | |
6820 void __return_func(int retval_, void *_envp){ | |
6821 retval = retval_; | |
6822 goto exit0; | |
6823 } | |
6824 if (0) { | |
6825 _cbc_exit0: | |
6826 return retval; | |
6827 } | |
6828 __return_func; | |
6829 }); | |
6830 */ | |
6831 tree value, stmt, label, tlab, decl; | |
6832 c_parser_consume_token (parser); | |
6833 | |
6834 stmt = c_begin_stmt_expr (); | |
6835 cbc_return_f = c_parser_peek_token (parser)->value; | |
6836 location_t location = c_parser_peek_token (parser)->location; | |
6837 | |
6838 /* create label. (__label__ _cbc_exit0;) */ | |
6839 label = get_identifier ("_cbc_exit0"); | |
6840 tlab = declare_label (label); | |
6841 C_DECLARED_LABEL_FLAG (tlab) = 1; | |
6842 add_stmt (build_stmt (location, DECL_EXPR, tlab)); | |
6843 | |
6844 /* declare retval. (int retval;) */ | |
6845 tree decl_cond = | |
6846 build_decl (location, VAR_DECL, get_identifier ("retval"), | |
6847 TREE_TYPE (TREE_TYPE (current_function_decl))); | |
6848 TREE_STATIC (decl_cond) = 1; | |
6849 DECL_ARTIFICIAL (decl_cond) = 1; | |
6850 pushdecl (decl_cond); | |
6851 | |
6852 /* define nested function. */ | |
6853 decl = | |
6854 cbc_finish_nested_function (location, label, decl_cond); | |
6855 | |
6856 /* define if-ed goto label and return statement. */ | |
6857 cbc_finish_labeled_goto (location, label, decl_cond); | |
6858 | |
6859 /* get pointer to nested function. */ | |
6860 value = build_addr (decl , current_function_decl); | |
6861 SET_EXPR_LOCATION (value, location); | |
6862 add_stmt (value); | |
6863 /*value = build_external_ref (get_identifier("_cbc_internal_return"), false, location);*/ | |
6864 /*value = build_unary_op (location, ADDR_EXPR, value, 0);*/ | |
6865 /*add_stmt (value);*/ | |
6866 | |
6867 TREE_SIDE_EFFECTS (stmt) = 1; | |
6868 expr.value = c_finish_stmt_expr (location, stmt); | |
6869 expr.original_code = ERROR_MARK; | |
6870 } | |
6871 | |
6872 #endif //0 | |
6873 break; | |
6874 #endif //noCbC | |
6875 | |
6438 default: | 6876 default: |
6439 c_parser_error (parser, "expected expression"); | 6877 c_parser_error (parser, "expected expression"); |
6440 expr.value = error_mark_node; | 6878 expr.value = error_mark_node; |
6441 break; | 6879 break; |
6442 } | 6880 } |