summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
diff options
context:
space:
mode:
authorEric Christopher <echristo@gmail.com>2014-01-29 23:05:43 +0000
committerEric Christopher <echristo@gmail.com>2014-01-29 23:05:43 +0000
commit1a97215050709055a7eaada96098362f213737e4 (patch)
treed42ed5982f3da5319ced648065b1122cb7e62053 /llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
parent8873adaa60d3fff28758d341f136c650fc1314db (diff)
downloadbcm5719-llvm-1a97215050709055a7eaada96098362f213737e4.tar.gz
bcm5719-llvm-1a97215050709055a7eaada96098362f213737e4.zip
Move range handling for a function to endFunction rather than
when we create the subprogram DIE. llvm-svn: 200426
Diffstat (limited to 'llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp')
-rw-r--r--llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp b/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
index 326c4482d2e..43297d23dbe 100644
--- a/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
+++ b/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
@@ -422,10 +422,6 @@ DIE *DwarfDebug::updateSubprogramScopeDIE(DwarfCompileUnit *SPCU,
SPCU->addLabelAddress(SPDie, dwarf::DW_AT_low_pc, FunctionBeginSym);
SPCU->addLabelAddress(SPDie, dwarf::DW_AT_high_pc, FunctionEndSym);
- // Add this range to the list of ranges for the CU.
- RangeSpan Span(FunctionBeginSym, FunctionEndSym);
- SPCU->addRange(llvm_move(Span));
-
const TargetRegisterInfo *RI = Asm->TM.getRegisterInfo();
MachineLocation Location(RI->getFrameRegister(*Asm->MF));
SPCU->addAddress(SPDie, dwarf::DW_AT_frame_base, Location);
@@ -1810,6 +1806,7 @@ void DwarfDebug::endFunction(const MachineFunction *MF) {
FunctionEndSym = Asm->GetTempSymbol("func_end", Asm->getFunctionNumber());
// Assumes in correct section after the entry point.
Asm->OutStreamer.EmitLabel(FunctionEndSym);
+
// Set DwarfDwarfCompileUnitID in MCContext to default value.
Asm->OutStreamer.getContext().setDwarfCompileUnitID(0);
@@ -1847,10 +1844,13 @@ void DwarfDebug::endFunction(const MachineFunction *MF) {
}
DIE *CurFnDIE = constructScopeDIE(TheCU, FnScope);
-
if (!CurFn->getTarget().Options.DisableFramePointerElim(*CurFn))
TheCU->addFlag(CurFnDIE, dwarf::DW_AT_APPLE_omit_frame_ptr);
+ // Add the range of this function to the list of ranges for the CU.
+ RangeSpan Span(FunctionBeginSym, FunctionEndSym);
+ TheCU->addRange(llvm_move(Span));
+
// Clear debug info
for (ScopeVariablesMap::iterator I = ScopeVariables.begin(),
E = ScopeVariables.end();
OpenPOWER on IntegriCloud