diff options
author | Alexey Bataev <a.bataev@hotmail.com> | 2018-07-26 16:29:52 +0000 |
---|---|---|
committer | Alexey Bataev <a.bataev@hotmail.com> | 2018-07-26 16:29:52 +0000 |
commit | 4dd7558fab0da7889c1e31bcc741880d0e6cbb52 (patch) | |
tree | 8a1aafb3d78f88ef5d8bec991a4beb3fe74864ce /llvm/lib/CodeGen | |
parent | b381e7e59a182c418c44cea54c127ec2366a40d2 (diff) | |
download | bcm5719-llvm-4dd7558fab0da7889c1e31bcc741880d0e6cbb52.tar.gz bcm5719-llvm-4dd7558fab0da7889c1e31bcc741880d0e6cbb52.zip |
[DEBUGINFO, NVPTX] Emit correct debug information for local variables.
Summary:
NVPTX target dos not use register-based frame information. Instead it
relies on the artificial local_depot that is used instead of the frame
and the data for variables must be emitted relatively to this
local_depot.
Reviewers: tra, jlebar, echristo
Subscribers: jholewinski, aprantl, JDevlieghere, llvm-commits
Differential Revision: https://reviews.llvm.org/D45963
llvm-svn: 338039
Diffstat (limited to 'llvm/lib/CodeGen')
-rw-r--r-- | llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp b/llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp index aec161c6dd7..5c3e6c865f5 100644 --- a/llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp +++ b/llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp @@ -578,8 +578,11 @@ DIE *DwarfCompileUnit::constructVariableDIEImpl(const DbgVariable &DV, Ops.append(Expr->elements_begin(), Expr->elements_end()); DIExpressionCursor Cursor(Ops); DwarfExpr.setMemoryLocationKind(); - DwarfExpr.addMachineRegExpression( - *Asm->MF->getSubtarget().getRegisterInfo(), Cursor, FrameReg); + if (const MCSymbol *FrameSymbol = Asm->getFunctionFrameSymbol()) + addOpAddress(*Loc, FrameSymbol); + else + DwarfExpr.addMachineRegExpression( + *Asm->MF->getSubtarget().getRegisterInfo(), Cursor, FrameReg); DwarfExpr.addExpression(std::move(Cursor)); } addBlock(*VariableDie, dwarf::DW_AT_location, DwarfExpr.finalize()); |