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 {
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)
ExceptionTimer(0) {
if (TimePassesIsEnabled)
ExceptionTimer = new Timer("Dwarf Exception Writer",
- *getDwarfTimerGroup());
+ getDwarfTimerGroup());
}
virtual ~DwarfException() {
DwarfWriter::~DwarfWriter() {
delete DE;
delete DD;
- delete DwarfTimerGroup; DwarfTimerGroup = 0;
}
/// BeginModule - Emit all Dwarf sections that should come prior to the