aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp/lex.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/cp/lex.c')
-rw-r--r--gcc/cp/lex.c19
1 files changed, 11 insertions, 8 deletions
diff --git a/gcc/cp/lex.c b/gcc/cp/lex.c
index 4558940d675..6660c848bf2 100644
--- a/gcc/cp/lex.c
+++ b/gcc/cp/lex.c
@@ -1138,6 +1138,7 @@ do_identifier (token, parsing, args)
register tree id;
int lexing = (parsing == 1 || parsing == 3);
+ timevar_push (TV_NAME_LOOKUP);
if (! lexing)
id = lookup_name (token, 0);
else
@@ -1168,21 +1169,22 @@ do_identifier (token, parsing, args)
being used as a declarator. So we call it again to get the error
message. */
id = lookup_name (token, 0);
- return error_mark_node;
+ POP_TIMEVAR_AND_RETURN (TV_NAME_LOOKUP, error_mark_node);
}
if (!id || (TREE_CODE (id) == FUNCTION_DECL
&& DECL_ANTICIPATED (id)))
{
if (current_template_parms)
- return build_min_nt (LOOKUP_EXPR, token);
+ POP_TIMEVAR_AND_RETURN (TV_NAME_LOOKUP,
+ build_min_nt (LOOKUP_EXPR, token));
else if (IDENTIFIER_TYPENAME_P (token))
/* A templated conversion operator might exist. */
- return token;
+ POP_TIMEVAR_AND_RETURN (TV_NAME_LOOKUP, token);
else
{
unqualified_name_lookup_error (token);
- return error_mark_node;
+ POP_TIMEVAR_AND_RETURN (TV_NAME_LOOKUP, error_mark_node);
}
}
@@ -1218,7 +1220,7 @@ do_identifier (token, parsing, args)
|| TREE_CODE (id) == USING_DECL))
id = build_min_nt (LOOKUP_EXPR, token);
- return id;
+ POP_TIMEVAR_AND_RETURN (TV_NAME_LOOKUP, id);
}
tree
@@ -1226,6 +1228,7 @@ do_scoped_id (token, id)
tree token;
tree id;
{
+ timevar_push (TV_NAME_LOOKUP);
if (!id || (TREE_CODE (id) == FUNCTION_DECL
&& DECL_ANTICIPATED (id)))
{
@@ -1233,7 +1236,7 @@ do_scoped_id (token, id)
{
id = build_min_nt (LOOKUP_EXPR, token);
LOOKUP_EXPR_GLOBAL (id) = 1;
- return id;
+ POP_TIMEVAR_AND_RETURN (TV_NAME_LOOKUP, id);
}
if (IDENTIFIER_NAMESPACE_VALUE (token) != error_mark_node)
error ("`::%D' undeclared (first use here)", token);
@@ -1264,11 +1267,11 @@ do_scoped_id (token, id)
{
id = build_min_nt (LOOKUP_EXPR, token);
LOOKUP_EXPR_GLOBAL (id) = 1;
- return id;
+ POP_TIMEVAR_AND_RETURN (TV_NAME_LOOKUP, id);
}
/* else just use the decl */
}
- return convert_from_reference (id);
+ POP_TIMEVAR_AND_RETURN (TV_NAME_LOOKUP, convert_from_reference (id));
}
tree