# HG changeset patch # User Nobuyasu Oshiro # Date 1332490293 -32400 # Node ID edcadcec937db95bc1ba4a53b5181539314eff4d # Parent fdc380f80c0711c4f5810bfec3190bd1ec203b16 modify __rectype diff -r fdc380f80c07 -r edcadcec937d gcc/c-parser.c --- a/gcc/c-parser.c Mon Feb 20 15:38:52 2012 +0900 +++ b/gcc/c-parser.c Fri Mar 23 17:11:33 2012 +0900 @@ -1638,6 +1638,7 @@ chainon (postfix_attrs, all_prefix_attrs)); #ifndef noCbC + /* if(specs->storage_class == csc_typedef) { tree tmp = TREE_TYPE(d); while(TREE_CODE(tmp) == POINTER_TYPE) tmp = TREE_TYPE(tmp); @@ -1659,6 +1660,32 @@ } } } + */ + 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); + } + } + #endif if (d) finish_decl (d, UNKNOWN_LOCATION, NULL_TREE,