diff options
author | Bill Wendling <isanbard@gmail.com> | 2009-03-10 22:58:53 +0000 |
---|---|---|
committer | Bill Wendling <isanbard@gmail.com> | 2009-03-10 22:58:53 +0000 |
commit | 86c2656416b5d5594d0e70aeb429fa3609eb1b16 (patch) | |
tree | 3617fe914e78299c7887d17d5e5930bb50287002 /llvm | |
parent | b74d650727014029f54260e27f6908789b71b0bc (diff) | |
download | bcm5719-llvm-86c2656416b5d5594d0e70aeb429fa3609eb1b16.tar.gz bcm5719-llvm-86c2656416b5d5594d0e70aeb429fa3609eb1b16.zip |
Just make the Dwarf timer group static inside of the getter function. No need to alloc/dealloc.
llvm-svn: 66591
Diffstat (limited to 'llvm')
-rw-r--r-- | llvm/lib/CodeGen/AsmPrinter/DwarfWriter.cpp | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/llvm/lib/CodeGen/AsmPrinter/DwarfWriter.cpp b/llvm/lib/CodeGen/AsmPrinter/DwarfWriter.cpp index 88c0714bfa6..e9fb32c441c 100644 --- a/llvm/lib/CodeGen/AsmPrinter/DwarfWriter.cpp +++ b/llvm/lib/CodeGen/AsmPrinter/DwarfWriter.cpp @@ -48,10 +48,9 @@ static RegisterPass<DwarfWriter> X("dwarfwriter", "DWARF Information Writer"); char DwarfWriter::ID = 0; -static TimerGroup *DwarfTimerGroup = 0; -static TimerGroup *getDwarfTimerGroup() { - if (DwarfTimerGroup) return DwarfTimerGroup; - return DwarfTimerGroup = new TimerGroup("Dwarf Exception and Debugging"); +static TimerGroup &getDwarfTimerGroup() { + static TimerGroup DwarfTimerGroup("Dwarf Exception and Debugging"); + return DwarfTimerGroup; } namespace llvm { @@ -3022,7 +3021,7 @@ public: RootDbgScope(0), DebugTimer(0) { if (TimePassesIsEnabled) DebugTimer = new Timer("Dwarf Debug Writer", - *getDwarfTimerGroup()); + getDwarfTimerGroup()); } virtual ~DwarfDebug() { for (unsigned j = 0, M = Values.size(); j < M; ++j) @@ -4068,7 +4067,7 @@ public: ExceptionTimer(0) { if (TimePassesIsEnabled) ExceptionTimer = new Timer("Dwarf Exception Writer", - *getDwarfTimerGroup()); + getDwarfTimerGroup()); } virtual ~DwarfException() { @@ -4491,7 +4490,6 @@ DwarfWriter::DwarfWriter() DwarfWriter::~DwarfWriter() { delete DE; delete DD; - delete DwarfTimerGroup; DwarfTimerGroup = 0; } /// BeginModule - Emit all Dwarf sections that should come prior to the |