Moving PassTimingInfo from legacy pass manager code into a separate header.
Making it suitable for both legacy and new pass manager.
Adding a test on -time-passes main functionality.
Added some nits on comments. These could be done in a follow-up patch. I think a lot of these comments could use a style update.
LGTM otherwise, since this is mostly just code motion.
This can probably be simplified, and made a bit more Doxygen-ey.
Provides pass managers a generic interface for collecting pass timing information. Legacy pass managers should provide a \p PassInfo* as \p PassInfoT. New pass managers should provide a \p StringRef as \p PassInfoT.
Might make more sense to say something like
Default constructor. Use \p init() to for initialization.
Doxygen style, plus some style nits.
Initializes \p TheTimeInfo to a non-null value when -time-passes is enabled. Leaves it null otherwise. This method may be called multiple times.
Comments are a little redundant here. If we moved it all into the header comment it'd be a bit clearer.
Print out timing information and delete all timers, along with their \p TimerGroup. The timing report is printed on deletion of the \p TimerGroup.
The init() in PassTimingInfo.h already has this comment. So, this one can be removed.
Oh, well... it appears that this NFC was not exactly NFC after all :(
Before this change time information was aggregated per instance of Pass (Pass*), after this change time information is aggregated per name of Pass (P->getArgument()),
which causes information about multiple instances of the same pass to be aggregated into a single line.
Will do a followup that solves this problem.