[3.3] PATCH to timevar

Gabriel Dos Reis gdr@integrable-solutions.net
Fri Jan 24 16:10:00 GMT 2003


This patch has been committed to 3.3 branch, based on previous comments.
Its purpose is to install preliminary time-report infrastructure to
measure the compile time performance regression. It just adds "name
lookup", "overloading resolution" and "template instantiation" slots
in the timevar stack.  It does not contain any actual code that does
those timings.  That is the subject of future patches

Bootstrapped and regtested on an i686-pc-linux-gnu.

Part of this patch is already existing on the mainline.

-- Gaby

2003-01-23  Gabriel Dos Reis  <gdr@integrable-solutions.net>

	* timevar.def (TV_NAME_LOOKUP, TV_OVERLOAD,
	TV_TEMPLATE_INSTANTIATION):  New timevar_id eumerations.
	* timevar.h (POP_TIMEVAR_AND_RETURN): New macro.
	* timevar.c (timevar_pop): Be verbose when aborting.  Include
	"toplev.h". 

Index: timevar.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/timevar.c,v
retrieving revision 1.22
diff -p -r1.22 timevar.c
*** timevar.c	10 Oct 2002 18:32:00 -0000	1.22
--- timevar.c	24 Jan 2003 16:01:33 -0000
*************** static float clocks_to_msec;
*** 111,116 ****
--- 111,117 ----
  
  #include "flags.h"
  #include "timevar.h"
+ #include "toplev.h"
  
  /* See timevar.h for an explanation of timing variables.  */
  
*************** timevar_pop (timevar)
*** 317,323 ****
      return;
  
    if (&timevars[timevar] != stack->timevar)
!     abort ();
  
    /* What time is it?  */
    get_time (&now);
--- 318,328 ----
      return;
  
    if (&timevars[timevar] != stack->timevar)
!     {
!       sorry ("cannot timevar_pop '%s' when top of timevars stack is '%s'",
!              timevars[timevar].name, stack->timevar->name);
!       abort ();
!     }
  
    /* What time is it?  */
    get_time (&now);
Index: timevar.def
===================================================================
RCS file: /cvs/gcc/gcc/gcc/timevar.def,v
retrieving revision 1.14
diff -p -r1.14 timevar.def
*** timevar.def	1 Jun 2002 21:31:35 -0000	1.14
--- timevar.def	24 Jan 2003 16:01:33 -0000
*************** DEFTIMEVAR (TV_LIFE_UPDATE	     , "life 
*** 51,56 ****
--- 51,59 ----
  DEFTIMEVAR (TV_CPP		     , "preprocessing")
  DEFTIMEVAR (TV_LEX		     , "lexical analysis")
  DEFTIMEVAR (TV_PARSE                 , "parser")
+ DEFTIMEVAR (TV_NAME_LOOKUP           , "name lookup")
+ DEFTIMEVAR (TV_OVERLOAD              , "overload resolution")
+ DEFTIMEVAR (TV_TEMPLATE_INSTANTIATION, "template instantiation")
  DEFTIMEVAR (TV_EXPAND		     , "expand")
  DEFTIMEVAR (TV_VARCONST              , "varconst")
  DEFTIMEVAR (TV_INTEGRATION           , "integration")
Index: timevar.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/timevar.h,v
retrieving revision 1.8
diff -p -r1.8 timevar.h
*** timevar.h	31 May 2002 22:15:33 -0000	1.8
--- timevar.h	24 Jan 2003 16:01:33 -0000
*************** typedef enum
*** 76,81 ****
--- 76,84 ----
  timevar_id_t;
  #undef DEFTIMEVAR
  
+ /* Execute the sequence: timevar_pop (TV), return (E);  */
+ #define POP_TIMEVAR_AND_RETURN(TV, E)  return (timevar_pop (TV), (E))
+ 
  extern void init_timevar PARAMS ((void));
  extern void timevar_push PARAMS ((timevar_id_t));
  extern void timevar_pop PARAMS ((timevar_id_t));



More information about the Gcc-patches mailing list