Fix -ftime-report for C++ lookup.
authorDiego Novillo <dnovillo@google.com>
Mon, 20 Aug 2012 14:23:32 +0000 (10:23 -0400)
committerDiego Novillo <dnovillo@gcc.gnu.org>
Mon, 20 Aug 2012 14:23:32 +0000 (10:23 -0400)
Found this while running -ftime-report on a largish C++ source file.
We need to start TV_NAME_LOOKUP conditionally inside poplevel()
because it may be called from another lookup routine that already has
TV_NAME_LOOKUP going.

Tested on x86_64.  Committed to trunk.

2012-08-20  Diego Novillo  <dnovillo@google.com>

* decl.c (poplevel): Start TV_NAME_LOOKUP conditionally.

From-SVN: r190535

gcc/cp/ChangeLog
gcc/cp/decl.c

index b5961554d8b246589b1116672d9dad9bc95be862..5c4f362f24d5cc61e76fb077a916c3d18d332c98 100644 (file)
@@ -1,3 +1,7 @@
+2012-08-20  Diego Novillo  <dnovillo@google.com>
+
+       * decl.c (poplevel): Start TV_NAME_LOOKUP conditionally.
+
 2012-08-20  Richard Guenther  <rguenther@suse.de>
 
        * name-lookup.c (store_binding_p): New predicate, split out from ...
index 5908996c2dc82f4b8c39f167926160c0b37f6290..0dad597c9aca2dd5a123c6ae20216eb834511c2d 100644 (file)
@@ -552,7 +552,7 @@ poplevel (int keep, int reverse, int functionbody)
   unsigned ix;
   cp_label_binding *label_bind;
 
-  timevar_start (TV_NAME_LOOKUP);
+  bool subtime = timevar_cond_start (TV_NAME_LOOKUP);
  restart:
 
   block = NULL_TREE;
@@ -818,7 +818,7 @@ poplevel (int keep, int reverse, int functionbody)
   if (kind == sk_cleanup)
     goto restart;
 
-  timevar_stop (TV_NAME_LOOKUP);
+  timevar_cond_stop (TV_NAME_LOOKUP, subtime);
   return block;
 }