comparison gcc/c-parser.c @ 107:a3a2f64cf8f4

modify implementation of rectype
author Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
date Thu, 14 Jun 2012 19:44:54 +0900
parents 85047c4f1ca4
children
comparison
equal deleted inserted replaced
106:85047c4f1ca4 107:a3a2f64cf8f4
2142 if (c_dialect_objc ()) 2142 if (c_dialect_objc ())
2143 parser->objc_need_raw_identifier = true; 2143 parser->objc_need_raw_identifier = true;
2144 t.kind = ctsk_resword; 2144 t.kind = ctsk_resword;
2145 t.spec = c_parser_peek_token (parser)->value; 2145 t.spec = c_parser_peek_token (parser)->value;
2146 declspecs_add_type (loc, specs, t); 2146 declspecs_add_type (loc, specs, t);
2147 2147
2148 IS_RECTYPE(t.spec) = 1;
2148 /* 2149 /*
2149 attrs = get_identifier("fastcall"); 2150 attrs = get_identifier("fastcall");
2150 attrs = build_tree_list(attrs, NULL_TREE); 2151 attrs = build_tree_list(attrs, NULL_TREE);
2151 declspecs_add_attrs(specs, attrs); 2152 declspecs_add_attrs(specs, attrs);
2152 */ 2153 */
2518 if(TREE_CODE(decls) == FIELD_DECL && TREE_CODE(type) == RECORD_TYPE) { 2519 if(TREE_CODE(decls) == FIELD_DECL && TREE_CODE(type) == RECORD_TYPE) {
2519 tree tmptype = decls; 2520 tree tmptype = decls;
2520 while(TREE_CODE (TREE_TYPE (tmptype)) == POINTER_TYPE) 2521 while(TREE_CODE (TREE_TYPE (tmptype)) == POINTER_TYPE)
2521 tmptype = TREE_TYPE(tmptype); 2522 tmptype = TREE_TYPE(tmptype);
2522 if(IS_SELFTYPE ( TREE_TYPE (tmptype))) TREE_TYPE(tmptype) = type; 2523 if(IS_SELFTYPE ( TREE_TYPE (tmptype))) TREE_TYPE(tmptype) = type;
2523 if(IS_RECTYPE ( TREE_TYPE (tmptype))) TREE_TYPE(tmptype) = type; 2524 // if(IS_RECTYPE ( TREE_TYPE (tmptype)))
2525 if(IS_RECTYPE (tmptype))
2526 TREE_TYPE(tmptype) = type;
2524 } 2527 }
2525 2528
2526 #endif 2529 #endif
2527 2530
2528 contents = chainon (decls, contents); 2531 contents = chainon (decls, contents);