aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp/parser.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/cp/parser.c')
-rw-r--r--gcc/cp/parser.c32
1 files changed, 30 insertions, 2 deletions
diff --git a/gcc/cp/parser.c b/gcc/cp/parser.c
index 5e3ac70..9ec571e 100644
--- a/gcc/cp/parser.c
+++ b/gcc/cp/parser.c
@@ -23,6 +23,7 @@ along with GCC; see the file COPYING3. If not see
#include "system.h"
#include "coretypes.h"
#include "tm.h"
+#include "timevar.h"
#include "cpplib.h"
#include "tree.h"
#include "cp-tree.h"
@@ -12152,6 +12153,8 @@ cp_parser_explicit_instantiation (cp_parser* parser)
cp_decl_specifier_seq decl_specifiers;
tree extension_specifier = NULL_TREE;
+ timevar_push (TV_TEMPLATE_INST);
+
/* Look for an (optional) storage-class-specifier or
function-specifier. */
if (cp_parser_allow_gnu_extensions_p (parser))
@@ -12235,6 +12238,8 @@ cp_parser_explicit_instantiation (cp_parser* parser)
end_explicit_instantiation ();
cp_parser_consume_semicolon_at_end_of_statement (parser);
+
+ timevar_pop (TV_TEMPLATE_INST);
}
/* Parse an explicit-specialization.
@@ -13446,6 +13451,7 @@ cp_parser_enum_specifier (cp_parser* parser)
elaborated-type-specifier. */
if (cp_lexer_next_token_is (parser->lexer, CPP_OPEN_BRACE))
{
+ timevar_push (TV_PARSE_ENUM);
if (nested_name_specifier)
{
/* The following catches invalid code such as:
@@ -13507,6 +13513,7 @@ cp_parser_enum_specifier (cp_parser* parser)
if (scoped_enum_p)
finish_scope ();
+ timevar_pop (TV_PARSE_ENUM);
}
else
{
@@ -16742,7 +16749,7 @@ cp_parser_class_name (cp_parser *parser,
Returns the TREE_TYPE representing the class. */
static tree
-cp_parser_class_specifier (cp_parser* parser)
+cp_parser_class_specifier_1 (cp_parser* parser)
{
tree type;
tree attributes = NULL_TREE;
@@ -17005,6 +17012,16 @@ cp_parser_class_specifier (cp_parser* parser)
return type;
}
+static tree
+cp_parser_class_specifier (cp_parser* parser)
+{
+ tree ret;
+ timevar_push (TV_PARSE_STRUCT);
+ ret = cp_parser_class_specifier_1 (parser);
+ timevar_pop (TV_PARSE_STRUCT);
+ return ret;
+}
+
/* Parse a class-head.
class-head:
@@ -19650,8 +19667,17 @@ cp_parser_function_definition_from_specifiers_and_declarator
pop_nested_class ();
}
else
- fn = cp_parser_function_definition_after_declarator (parser,
+ {
+ timevar_id_t tv;
+ if (DECL_DECLARED_INLINE_P (current_function_decl))
+ tv = TV_PARSE_INLINE;
+ else
+ tv = TV_PARSE_FUNC;
+ timevar_push (tv);
+ fn = cp_parser_function_definition_after_declarator (parser,
/*inline_p=*/false);
+ timevar_pop (tv);
+ }
return fn;
}
@@ -20268,6 +20294,7 @@ cp_parser_enclosed_template_argument_list (cp_parser* parser)
static void
cp_parser_late_parsing_for_member (cp_parser* parser, tree member_function)
{
+ timevar_push (TV_PARSE_INMETH);
/* If this member is a template, get the underlying
FUNCTION_DECL. */
if (DECL_FUNCTION_TEMPLATE_P (member_function))
@@ -20334,6 +20361,7 @@ cp_parser_late_parsing_for_member (cp_parser* parser, tree member_function)
/* Restore the queue. */
pop_unparsed_function_queues (parser);
+ timevar_pop (TV_PARSE_INMETH);
}
/* If DECL contains any default args, remember it on the unparsed