diff options
author | Reid Kleckner <rnk@google.com> | 2017-08-31 15:56:49 +0000 |
---|---|---|
committer | Reid Kleckner <rnk@google.com> | 2017-08-31 15:56:49 +0000 |
commit | 08f5fd51cc1690c86bac2f1dd841d27da2eefe44 (patch) | |
tree | 1d0792b0d3d2da9dd2f1b61d7d919e474c394b8b /llvm/lib/CodeGen/AsmPrinter/DebugHandlerBase.cpp | |
parent | 341317fda43ba257be63836d6ddb3e3d3865ac33 (diff) | |
download | bcm5719-llvm-08f5fd51cc1690c86bac2f1dd841d27da2eefe44.tar.gz bcm5719-llvm-08f5fd51cc1690c86bac2f1dd841d27da2eefe44.zip |
[codeview] Generalize DIExpression parsing to handle load chains
Summary:
Hopefully this also clarifies exactly when and why we're rewriting
certiain S_LOCALs using reference types: We're using the reference type
to stand in for a zero-offset load.
Reviewers: inglorion
Subscribers: llvm-commits, hiraditya
Differential Revision: https://reviews.llvm.org/D37309
llvm-svn: 312247
Diffstat (limited to 'llvm/lib/CodeGen/AsmPrinter/DebugHandlerBase.cpp')
-rw-r--r-- | llvm/lib/CodeGen/AsmPrinter/DebugHandlerBase.cpp | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/llvm/lib/CodeGen/AsmPrinter/DebugHandlerBase.cpp b/llvm/lib/CodeGen/AsmPrinter/DebugHandlerBase.cpp index ee8b38f6502..de3bc914d8d 100644 --- a/llvm/lib/CodeGen/AsmPrinter/DebugHandlerBase.cpp +++ b/llvm/lib/CodeGen/AsmPrinter/DebugHandlerBase.cpp @@ -34,8 +34,6 @@ DbgVariableLocation::extractFromMachineInstruction( if (!Instruction.getOperand(0).isReg()) return None; Location.Register = Instruction.getOperand(0).getReg(); - Location.InMemory = Instruction.getOperand(1).isImm(); - Location.Deref = false; Location.FragmentInfo.reset(); // We only handle expressions generated by DIExpression::appendOffset, // which doesn't require a full stack machine. @@ -67,7 +65,8 @@ DbgVariableLocation::extractFromMachineInstruction( Location.FragmentInfo = {Op->getArg(1), Op->getArg(0)}; break; case dwarf::DW_OP_deref: - Location.Deref = true; + Location.LoadChain.push_back(Offset); + Offset = 0; break; default: return None; @@ -75,7 +74,12 @@ DbgVariableLocation::extractFromMachineInstruction( ++Op; } - Location.Offset = Offset; + // Do one final implicit DW_OP_deref if this was an indirect DBG_VALUE + // instruction. + // FIXME: Replace these with DIExpression. + if (Instruction.isIndirectDebugValue()) + Location.LoadChain.push_back(Offset); + return Location; } |