diff options
| author | Bill Wendling <isanbard@gmail.com> | 2010-04-07 09:28:04 +0000 |
|---|---|---|
| committer | Bill Wendling <isanbard@gmail.com> | 2010-04-07 09:28:04 +0000 |
| commit | fcc14141c766549cdc7f5dd035ceccfd733102e8 (patch) | |
| tree | 7ce530eb4604b6f68a70ae86057c4e402e7ebe75 /llvm/lib/CodeGen/AsmPrinter/DwarfException.cpp | |
| parent | 43c275fa56668286b7886e79f78d58a47671db0d (diff) | |
| download | bcm5719-llvm-fcc14141c766549cdc7f5dd035ceccfd733102e8.tar.gz bcm5719-llvm-fcc14141c766549cdc7f5dd035ceccfd733102e8.zip | |
Use the "NamedGroupTimer" class to categorize DWARF emission better.
llvm-svn: 100616
Diffstat (limited to 'llvm/lib/CodeGen/AsmPrinter/DwarfException.cpp')
| -rw-r--r-- | llvm/lib/CodeGen/AsmPrinter/DwarfException.cpp | 23 |
1 files changed, 11 insertions, 12 deletions
diff --git a/llvm/lib/CodeGen/AsmPrinter/DwarfException.cpp b/llvm/lib/CodeGen/AsmPrinter/DwarfException.cpp index 72c97a43085..b73147d2065 100644 --- a/llvm/lib/CodeGen/AsmPrinter/DwarfException.cpp +++ b/llvm/lib/CodeGen/AsmPrinter/DwarfException.cpp @@ -39,17 +39,16 @@ #include "llvm/ADT/Twine.h" using namespace llvm; +namespace { + const char *DWARFGroupName = "DWARF Emission"; + const char *EHTimerName = "DWARF Exception Writer"; +} // end anonymous namespace + DwarfException::DwarfException(AsmPrinter *A) : Asm(A), MMI(Asm->MMI), shouldEmitTable(false), shouldEmitMoves(false), - shouldEmitTableModule(false), shouldEmitMovesModule(false), - ExceptionTimer(0) { - if (TimePassesIsEnabled) - ExceptionTimer = new Timer("DWARF Exception Writer"); -} + shouldEmitTableModule(false), shouldEmitMovesModule(false) {} -DwarfException::~DwarfException() { - delete ExceptionTimer; -} +DwarfException::~DwarfException() {} /// EmitCIE - Emit a Common Information Entry (CIE). This holds information that /// is shared among many Frame Description Entries. There is at least one CIE @@ -897,14 +896,14 @@ void DwarfException::EmitExceptionTable() { /// EndModule - Emit all exception information that should come after the /// content. void DwarfException::EndModule() { + NamedRegionTimer T(EHTimerName, DWARFGroupName); + if (Asm->MAI->getExceptionHandlingType() != ExceptionHandling::Dwarf) return; if (!shouldEmitMovesModule && !shouldEmitTableModule) return; - TimeRegion Timer(ExceptionTimer); - const std::vector<Function *> Personalities = MMI->getPersonalities(); for (unsigned I = 0, E = Personalities.size(); I < E; ++I) @@ -918,7 +917,7 @@ void DwarfException::EndModule() { /// BeginFunction - Gather pre-function exception information. Assumes it's /// being emitted immediately after the function entry point. void DwarfException::BeginFunction(const MachineFunction *MF) { - TimeRegion Timer(ExceptionTimer); + NamedRegionTimer T(EHTimerName, DWARFGroupName); shouldEmitTable = shouldEmitMoves = false; // If any landing pads survive, we need an EH table. @@ -940,9 +939,9 @@ void DwarfException::BeginFunction(const MachineFunction *MF) { /// EndFunction - Gather and emit post-function exception information. /// void DwarfException::EndFunction() { + NamedRegionTimer T(EHTimerName, DWARFGroupName); if (!shouldEmitMoves && !shouldEmitTable) return; - TimeRegion Timer(ExceptionTimer); Asm->OutStreamer.EmitLabel(Asm->GetTempSymbol("eh_func_end", Asm->getFunctionNumber())); |

