On 09/12/14 10:33, Jason Merrill wrote:
On 09/12/2014 01:10 PM, Aldy Hernandez wrote:
TV_PHASE_DEFERRED, on the other hand, is a bit problematic because it
was originally wrapping the code inside LANG_HOOKS_WRITE_GLOBALS, which
will now reside inside the parser (and is thus included in
TV_PHASE_PARSING now).  Originally it was mutually exclusive with
TV_PHASE_PARSING, but now resides within the parser, so I decided to get
rid of it since it's all technically in the parser.

There is code in timevar*.c that makes sure that TV_PHASE_* elapsed
times add up to the total time.  So we either get rid of
TV_PHASE_DEFERRED and include its time in TV_PHASE_PARSING (avoiding
double counting), or we include a separate, non PHASE timer for it, with
timevar_push(TV_blah) where "blah" is NOT "PHASE".

Why can't it keep the same name and just timevar_push/pop instead of
timevar_start/stop?

Unless I'm misunderstanding something, validate_phases() verifies that the numbers add up by looking at the actual string name of the phase, irregardless of if you timevar_push/pop'ed it:

        static char phase_prefix[] = "phase ";
        ...
        if (strncmp (tv->name, phase_prefix, sizeof phase_prefix - 1)

I could timevar_push/pop it but we'd have to change the name:

DEFTIMEVAR (TV_PHASE_DEFERRED        , "phase lang. deferred")

Did I miss something?
Aldy

Reply via email to