diff options
author | Alexey Samsonov <samsonov@google.com> | 2014-04-30 21:44:17 +0000 |
---|---|---|
committer | Alexey Samsonov <samsonov@google.com> | 2014-04-30 21:44:17 +0000 |
commit | c74503ea21a415f43f51f878085613581419f673 (patch) | |
tree | 229dae37ac55b2a129e8b666103de033a6edfdd3 /llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp | |
parent | b8aae5405b968753461082c0d78308b91f113256 (diff) | |
download | bcm5719-llvm-c74503ea21a415f43f51f878085613581419f673.tar.gz bcm5719-llvm-c74503ea21a415f43f51f878085613581419f673.zip |
Slightly simplify code in DwarfDebug::beginFunction
llvm-svn: 207710
Diffstat (limited to 'llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp')
-rw-r--r-- | llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp b/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp index e0bc4bd7239..8de084abff1 100644 --- a/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp +++ b/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp @@ -1440,9 +1440,8 @@ void DwarfDebug::beginFunction(const MachineFunction *MF) { Asm->OutStreamer.EmitLabel(FunctionBeginSym); // Collect user variables, find the end of the prologue. - for (MachineFunction::const_iterator I = MF->begin(), E = MF->end(); I != E; - ++I) { - for (MachineBasicBlock::const_iterator II = I->begin(), IE = I->end(); + for (const auto &MBB : *MF) { + for (MachineBasicBlock::const_iterator II = MBB.begin(), IE = MBB.end(); II != IE; ++II) { const MachineInstr *MI = II; if (MI->isDebugValue()) { @@ -1454,12 +1453,11 @@ void DwarfDebug::beginFunction(const MachineFunction *MF) { std::make_pair(Var, SmallVector<const MachineInstr *, 4>())); if (IterPair.second) UserVariables.push_back(Var); - } else { + } else if (!MI->getFlag(MachineInstr::FrameSetup) && + PrologEndLoc.isUnknown() && !MI->getDebugLoc().isUnknown()) { // First known non-DBG_VALUE and non-frame setup location marks // the beginning of the function body. - if (!MI->getFlag(MachineInstr::FrameSetup) && - (PrologEndLoc.isUnknown() && !MI->getDebugLoc().isUnknown())) - PrologEndLoc = MI->getDebugLoc(); + PrologEndLoc = MI->getDebugLoc(); } } } |