Patchwork Split Parse Timevar (rev 2) (issue4433076)

login
register
mail settings
Submitter Jason Merrill
Date May 13, 2011, 10:24 p.m.
Message ID <4DCDAF89.9010804@redhat.com>
Download mbox | patch
Permalink /patch/95535/
State New
Headers show

Comments

Jason Merrill - May 13, 2011, 10:24 p.m.
I'm applying this patch to fix a crash that I get when running cc1plus 
directly without -quiet; all the other TV_OVERLOAD bits use 
timevar_cond_*, so it seems that these should too.

Tested x86_64-pc-linux-gnu, applying to trunk.
Lawrence Crowl - May 13, 2011, 10:30 p.m.
On 5/13/11, Jason Merrill <jason@redhat.com> wrote:
> I'm applying this patch to fix a crash that I get when running cc1plus
> directly without -quiet; all the other TV_OVERLOAD bits use
> timevar_cond_*, so it seems that these should too.
>
> Tested x86_64-pc-linux-gnu, applying to trunk.

Looks good to me.

Patch

commit 8de1530fc6ca07e3ca37ff7689c65931025d9f0d
Author: Jason Merrill <jason@redhat.com>
Date:   Fri May 13 14:56:33 2011 -0400

    	* call.c (build_op_call): Use timevar_cond_start/stop.
    	(build_user_type_conversion): Likewise.

diff --git a/gcc/cp/call.c b/gcc/cp/call.c
index 095d1b0..09ad4ae 100644
--- a/gcc/cp/call.c
+++ b/gcc/cp/call.c
@@ -3521,7 +3521,7 @@  build_user_type_conversion (tree totype, tree expr, int flags)
   struct z_candidate *cand;
   tree ret;
 
-  timevar_start (TV_OVERLOAD);
+  bool subtime = timevar_cond_start (TV_OVERLOAD);
   cand = build_user_type_conversion_1 (totype, expr, flags);
 
   if (cand)
@@ -3537,7 +3537,7 @@  build_user_type_conversion (tree totype, tree expr, int flags)
   else
     ret = NULL_TREE;
 
-  timevar_stop (TV_OVERLOAD);
+  timevar_cond_stop (TV_OVERLOAD, subtime);
   return ret;
 }
 
@@ -4029,9 +4029,9 @@  tree
 build_op_call (tree obj, VEC(tree,gc) **args, tsubst_flags_t complain)
 {
   tree ret;
-  timevar_start (TV_OVERLOAD);
+  bool 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;
 }