Mercurial > hg > CbC > CbC_gcc
diff gcc/c/c-parser.c @ 113:bdf41c9fa0b7
remove RECTYPE
author | mir3636 |
---|---|
date | Fri, 17 Nov 2017 06:33:55 +0900 |
parents | ab0bcb71f44d |
children | e234ee7b7292 |
line wrap: on
line diff
--- a/gcc/c/c-parser.c Fri Nov 10 19:46:38 2017 +0900 +++ b/gcc/c/c-parser.c Fri Nov 17 06:33:55 2017 +0900 @@ -512,7 +512,6 @@ case RID_AUTO_TYPE: #ifndef noCbC case RID_CbC_CODE: - case RID_CbC_REC: #endif return true; default: @@ -2106,41 +2105,6 @@ its initializer is parsed. */ d = start_decl (declarator, specs, true, chainon (postfix_attrs, all_prefix_attrs)); -#ifndef noCbC - if (specs->typespec_word == cts_CbC_code) { - /* - * func_tree is TYPE_DECL or FUNCTION_DECL. - * tmp is POINTER_TYPE or FUNCTION_TYPE. - */ - tree func_tree = TREE_TYPE(d); - // parm is PARM_DECL - tree parm = declarator->u.arg_info->parms; - while (parm) { - tree tmptype = parm; - if (!IS_RECTYPE(TREE_TYPE(tmptype))) { - parm = TREE_CHAIN(parm); - continue; - } - tree t = TREE_TYPE(tmptype); - while (TREE_CODE(t) == POINTER_TYPE) { - tmptype = t; - t = TREE_TYPE(tmptype); - } - TREE_TYPE(tmptype) = func_tree; - parm = TREE_CHAIN(parm); - } - } - if (specs->typespec_word == cts_CbC_rec) { - tree t = TREE_TYPE(d); - tree tmptype = t; - while (TREE_CODE(t) == POINTER_TYPE) { - tmptype = t; - t = TREE_TYPE(tmptype); - } - TREE_TYPE(tmptype) = TREE_TYPE(current_function_decl); - } - -#endif if (!d) d = error_mark_node; if (omp_declare_simd_clauses.exists () @@ -2795,7 +2759,6 @@ break; #ifndef noCbC case RID_CbC_CODE: - case RID_CbC_REC: if (!typespec_ok) goto out; attrs_ok = true; @@ -2806,38 +2769,13 @@ t.spec = c_parser_peek_token (parser)->value; declspecs_add_type (loc, specs, t); - IS_RECTYPE(t.spec) = 1; - /* - attrs = get_identifier("fastcall"); - attrs = build_tree_list(attrs, NULL_TREE); - declspecs_add_attrs(specs, attrs); - */ if(!TARGET_64BIT) { attrs = build_tree_list (get_identifier("fastcall"), NULL_TREE); - /*attrs = build_tree_list (get_identifier("noreturn"), attrs);*/ declspecs_add_attrs(specs, attrs); } c_parser_consume_token (parser); break; - case RID_CbC_SELFTYPE: - if (!typespec_ok) - goto out; - attrs_ok = true; - seen_type = true; - enum tree_code code = RECORD_TYPE; - location_t loc = c_parser_peek_token (parser)->location; - - c_parser_set_source_position_from_token (c_parser_peek_token (parser)); - tree value; - struct c_typespec ret; - value = make_node (IDENTIFIER_NODE); - ret = parser_xref_tag (loc, code, value); - - IS_SELFTYPE (ret.spec) = 1; - declspecs_add_type (loc, specs, ret); - c_parser_consume_token (parser); - break; #endif case RID_ENUM: if (!typespec_ok) @@ -3277,19 +3215,6 @@ /* Parse some comma-separated declarations, but not the trailing semicolon if any. */ decls = c_parser_struct_declaration (parser); -#ifndef noCbC - /* If tree type of tmptype is selftype, tmptype modify to RECORD_TYPE of struct [CPP_NAME]. */ - if(TREE_CODE(decls) == FIELD_DECL && TREE_CODE(type) == RECORD_TYPE) { - tree tmptype = decls; - while(TREE_CODE (TREE_TYPE (tmptype)) == POINTER_TYPE) - tmptype = TREE_TYPE(tmptype); - if(IS_SELFTYPE ( TREE_TYPE (tmptype))) TREE_TYPE(tmptype) = type; - // if(IS_RECTYPE ( TREE_TYPE (tmptype))) - if(IS_RECTYPE (tmptype)) - TREE_TYPE(tmptype) = type; - } - -#endif contents = chainon (decls, contents); /* If no semicolon follows, either we have a parse error or are at the end of the struct or union and should