diff options
Diffstat (limited to 'gcc/c-parser.c')
-rw-r--r-- | gcc/c-parser.c | 23 |
1 files changed, 20 insertions, 3 deletions
diff --git a/gcc/c-parser.c b/gcc/c-parser.c index b61ebdd..698a080 100644 --- a/gcc/c-parser.c +++ b/gcc/c-parser.c @@ -1570,6 +1570,7 @@ c_parser_declaration_or_fndef (c_parser *parser, bool fndef_ok, { struct c_declarator *declarator; bool dummy = false; + timevar_id_t tv; tree fnbody; /* Declaring either one or more declarators (in which case we should diagnose if there were no declaration specifiers) or a @@ -1699,6 +1700,13 @@ c_parser_declaration_or_fndef (c_parser *parser, bool fndef_ok, c_pop_function_context (); break; } + + if (DECL_DECLARED_INLINE_P (current_function_decl)) + tv = TV_PARSE_INLINE; + else + tv = TV_PARSE_FUNC; + timevar_push (tv); + /* Parse old-style parameter declarations. ??? Attributes are not allowed to start declaration specifiers here because of a syntax conflict between a function declaration with attribute @@ -1737,6 +1745,8 @@ c_parser_declaration_or_fndef (c_parser *parser, bool fndef_ok, add_stmt (fnbody); finish_function (); } + + timevar_pop (tv); break; } } @@ -2189,11 +2199,14 @@ c_parser_enum_specifier (c_parser *parser) { /* Parse an enum definition. */ struct c_enum_contents the_enum; - tree type = start_enum (enum_loc, &the_enum, ident); + tree type; tree postfix_attrs; /* We chain the enumerators in reverse order, then put them in forward order at the end. */ - tree values = NULL_TREE; + tree values; + timevar_push (TV_PARSE_ENUM); + type = start_enum (enum_loc, &the_enum, ident); + values = NULL_TREE; c_parser_consume_token (parser); while (true) { @@ -2257,6 +2270,7 @@ c_parser_enum_specifier (c_parser *parser) ret.kind = ctsk_tagdef; ret.expr = NULL_TREE; ret.expr_const_operands = true; + timevar_pop (TV_PARSE_ENUM); return ret; } else if (!ident) @@ -2370,7 +2384,9 @@ c_parser_struct_or_union_specifier (c_parser *parser) semicolon separated fields than comma separated fields, and so we'll be minimizing the number of node traversals required by chainon. */ - tree contents = NULL_TREE; + tree contents; + timevar_push (TV_PARSE_STRUCT); + contents = NULL_TREE; c_parser_consume_token (parser); /* Handle the Objective-C @defs construct, e.g. foo(sizeof(struct{ @defs(ClassName) }));. */ @@ -2457,6 +2473,7 @@ c_parser_struct_or_union_specifier (c_parser *parser) ret.kind = ctsk_tagdef; ret.expr = NULL_TREE; ret.expr_const_operands = true; + timevar_pop (TV_PARSE_STRUCT); return ret; } else if (!ident) |