[llvm-commits] [llvm] r66571 - in /llvm/trunk: include/llvm/CodeGen/DwarfWriter.h lib/CodeGen/AsmPrinter/DwarfWriter.cpp

Bill Wendling isanbard at gmail.com
Tue Mar 10 15:58:04 PDT 2009


On Tue, Mar 10, 2009 at 2:37 PM, Chris Lattner <clattner at apple.com> wrote:
>
> On Mar 10, 2009, at 3:35 PM, Bill Wendling wrote:
>
>> On Tue, Mar 10, 2009 at 2:29 PM, Chris Lattner <clattner at apple.com>
>> wrote:
>>>
>>> On Mar 10, 2009, at 1:41 PM, Bill Wendling wrote:
>>>
>>>> Author: void
>>>> Date: Tue Mar 10 15:41:52 2009
>>>> New Revision: 66571
>>>>
>>>> URL: http://llvm.org/viewvc/llvm-project?rev=66571&view=rev
>>>> Log:
>>>> Add a timer to the DwarfWriter pass that measures the total time it
>>>> takes to
>>>> emit exception and debug Dwarf info.
>>>
>>> Cool
>>>> +
>>>> +static TimerGroup *DwarfTimerGroup = 0;
>>>> +static TimerGroup *getDwarfTimerGroup() {
>>>> +  if (DwarfTimerGroup) return DwarfTimerGroup;
>>>> +  return DwarfTimerGroup = new TimerGroup("Dwarf Exception and
>>>> Debugging");
>>>> +}
>>>
>>> How is this freed?
>>>
>> In the ~DwarfWriter() method.
>
> Weird and subtle.  Would it make sense to just make it a static in the
> function?
>
>
> static TimerGroup &getDwarfTimerGroup() {
>   static TimerGroup DwarfTimerGroup("Dwarf Exception and Debugging");
>   return DwarfTimerGroup;
> }
>
> ?
>
I suppose it couldn't hurt. It's not a particularly big object. So I
guess it could stick around for awhile and not hurt things. :-)

-bw

-bw




More information about the llvm-commits mailing list