summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/AsmPrinter/DwarfException.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2010-03-29 20:39:38 +0000
committerChris Lattner <sabre@nondot.org>2010-03-29 20:39:38 +0000
commit6efa201f7f5ee23cfc5938819829df6972c479ba (patch)
treebbc2ae7bd67c0ac225d3857218437c7e405f7a88 /llvm/lib/CodeGen/AsmPrinter/DwarfException.cpp
parent4787975994927b49b8dc16d6e2bc45bddf9fb211 (diff)
downloadbcm5719-llvm-6efa201f7f5ee23cfc5938819829df6972c479ba.tar.gz
bcm5719-llvm-6efa201f7f5ee23cfc5938819829df6972c479ba.zip
use RAII for ExceptionTimer too
llvm-svn: 99833
Diffstat (limited to 'llvm/lib/CodeGen/AsmPrinter/DwarfException.cpp')
-rw-r--r--llvm/lib/CodeGen/AsmPrinter/DwarfException.cpp20
1 files changed, 3 insertions, 17 deletions
diff --git a/llvm/lib/CodeGen/AsmPrinter/DwarfException.cpp b/llvm/lib/CodeGen/AsmPrinter/DwarfException.cpp
index 4946b4c3c25..7cc6b439426 100644
--- a/llvm/lib/CodeGen/AsmPrinter/DwarfException.cpp
+++ b/llvm/lib/CodeGen/AsmPrinter/DwarfException.cpp
@@ -885,8 +885,7 @@ void DwarfException::EndModule() {
if (!shouldEmitMovesModule && !shouldEmitTableModule)
return;
- if (TimePassesIsEnabled)
- ExceptionTimer->startTimer();
+ TimeRegion Timer(ExceptionTimer);
const std::vector<Function *> Personalities = MMI->getPersonalities();
@@ -896,9 +895,6 @@ void DwarfException::EndModule() {
for (std::vector<FunctionEHFrameInfo>::iterator
I = EHFrames.begin(), E = EHFrames.end(); I != E; ++I)
EmitFDE(*I);
-
- if (TimePassesIsEnabled)
- ExceptionTimer->stopTimer();
}
/// BeginFunction - Gather pre-function exception information. Assumes it's
@@ -906,9 +902,7 @@ void DwarfException::EndModule() {
void DwarfException::BeginFunction(const MachineFunction *MF) {
if (!MMI || !MAI->doesSupportExceptionHandling()) return;
- if (TimePassesIsEnabled)
- ExceptionTimer->startTimer();
-
+ TimeRegion Timer(ExceptionTimer);
this->MF = MF;
shouldEmitTable = shouldEmitMoves = false;
@@ -924,9 +918,6 @@ void DwarfException::BeginFunction(const MachineFunction *MF) {
shouldEmitTableModule |= shouldEmitTable;
shouldEmitMovesModule |= shouldEmitMoves;
-
- if (TimePassesIsEnabled)
- ExceptionTimer->stopTimer();
}
/// EndFunction - Gather and emit post-function exception information.
@@ -934,9 +925,7 @@ void DwarfException::BeginFunction(const MachineFunction *MF) {
void DwarfException::EndFunction() {
if (!shouldEmitMoves && !shouldEmitTable) return;
- if (TimePassesIsEnabled)
- ExceptionTimer->startTimer();
-
+ TimeRegion Timer(ExceptionTimer);
Asm->OutStreamer.EmitLabel(getDWLabel("eh_func_end", SubprogramCount));
// Record if this personality index uses a landing pad.
@@ -961,7 +950,4 @@ void DwarfException::EndFunction() {
!MMI->getLandingPads().empty(),
MMI->getFrameMoves(),
MF->getFunction()));
-
- if (TimePassesIsEnabled)
- ExceptionTimer->stopTimer();
}
OpenPOWER on IntegriCloud