diff mbox

[4.6/4.7] Fix some parser timers (issue4894054)

Message ID 20110818171500.F1130AE1DF@tobiano.tor.corp.google.com
State New
Headers show

Commit Message

Diego Novillo Aug. 18, 2011, 5:15 p.m. UTC
Found while building our internal code base with -ftime-report.  This
patch is against google/gcc-4_6, but the bug also exists in 4.7 and
gcc-4_6-branch.

OK for gcc-4_6-branch and trunk?

Tested on x86_64.  Applied to google/gcc-4_6.


Diego.

	* name-lookup.c (lookup_arg_dependent): Use conditional
	timevars.
	* decl.c (xref_tag): Likewise.
	* call.c (build_op_call): Likewise.


--
This patch is available for review at http://codereview.appspot.com/4894054

Comments

Jason Merrill Aug. 18, 2011, 8:18 p.m. UTC | #1
OK.

Jason
Jason Merrill Aug. 18, 2011, 8:18 p.m. UTC | #2
On 08/18/2011 04:18 PM, Jason Merrill wrote:
> OK.

For trunk.  The 4.6 branch looks very different.

Jason
Diego Novillo Aug. 18, 2011, 8:23 p.m. UTC | #3
On 11-08-18 16:18 , Jason Merrill wrote:
> On 08/18/2011 04:18 PM, Jason Merrill wrote:
>> OK.
>
> For trunk. The 4.6 branch looks very different.

Yes, I later realized that we had originally backported this timer patch 
from trunk to google's 4.6 branch.


Thanks.  Diego.
diff mbox

Patch

Index: cp/decl.c
===================================================================
--- cp/decl.c	(revision 177856)
+++ cp/decl.c	(working copy)
@@ -11354,9 +11354,10 @@  xref_tag (enum tag_types tag_code, tree 
           tag_scope scope, bool template_header_p)
 {
   tree ret;
-  timevar_start (TV_NAME_LOOKUP);
+  bool subtime;
+  subtime = timevar_cond_start (TV_NAME_LOOKUP);
   ret = xref_tag_1 (tag_code, name, scope, template_header_p);
-  timevar_stop (TV_NAME_LOOKUP);
+  timevar_cond_stop (TV_NAME_LOOKUP, subtime);
   return ret;
 }
 
Index: cp/call.c
===================================================================
--- cp/call.c	(revision 177856)
+++ cp/call.c	(working copy)
@@ -3965,9 +3965,10 @@  tree
 build_op_call (tree obj, VEC(tree,gc) **args, tsubst_flags_t complain)
 {
   tree ret;
-  timevar_start (TV_OVERLOAD);
+  bool subtime;
+  subtime = timevar_cond_start (TV_OVERLOAD);
   ret = build_op_call_1 (obj, args, complain);
-  timevar_stop (TV_OVERLOAD);
+  timevar_cond_stop (TV_OVERLOAD, subtime);
   return ret;
 }
 
Index: cp/name-lookup.c
===================================================================
--- cp/name-lookup.c	(revision 177856)
+++ cp/name-lookup.c	(working copy)
@@ -5441,9 +5441,10 @@  lookup_arg_dependent (tree name, tree fn
                       bool include_std)
 {
   tree ret;
-  timevar_start (TV_NAME_LOOKUP);
+  bool subtime;
+  subtime = timevar_cond_start (TV_NAME_LOOKUP);
   ret = lookup_arg_dependent_1 (name, fns, args, include_std);
-  timevar_stop (TV_NAME_LOOKUP);
+  timevar_cond_stop (TV_NAME_LOOKUP, subtime);
   return ret;
 }