timevar: Add auto_cond_timevar class
commit9bf69a8558638ce0cdd69e83a68776deb9b8e053
authorJason Merrill <jason@redhat.com>
Sat, 16 Oct 2021 04:04:25 +0000 (16 00:04 -0400)
committerJason Merrill <jason@redhat.com>
Wed, 24 Nov 2021 01:25:47 +0000 (23 20:25 -0500)
treeda3c262a201ef128d64aaf930512fc4767eb2ea8
parent7df89377a7ae3906255e38a79be8e5d962c3a0df
timevar: Add auto_cond_timevar class

The auto_timevar sentinel class for starting and stopping timevars was added
in 2014, but doesn't work for the many uses of timevar_cond_start/stop in
the C++ front end.  So let's add one that does.

This allows us to remove a lot of wrapper functions that were just used to
call timevar_cond_stop on all exits from the function.

gcc/ChangeLog:

* timevar.h (class auto_cond_timevar): New.

gcc/cp/ChangeLog:

* call.c
* decl.c
* name-lookup.c:
Use auto_cond_timevar instead of timevar_cond_start/stop.
Remove wrapper functions.
gcc/cp/call.c
gcc/cp/decl.c
gcc/cp/name-lookup.c
gcc/timevar.h