diff options
author | RamNalamothu <VenkataRamanaiah.Nalamothu@amd.com> | 2021-06-14 06:57:58 +0530 |
---|---|---|
committer | RamNalamothu <VenkataRamanaiah.Nalamothu@amd.com> | 2021-06-14 08:51:50 +0530 |
commit | 167e7afcd52bc1438d60320ec1d1bc53b8eae4a3 (patch) | |
tree | dc3cb0f9a309f05e26771ff7cbce689425c409a1 /llvm/lib/MC/MCDwarf.cpp | |
parent | dcbbc69cc58294cedc865259c6fd5ba80ecd9bd3 (diff) | |
download | llvm-167e7afcd52bc1438d60320ec1d1bc53b8eae4a3.zip llvm-167e7afcd52bc1438d60320ec1d1bc53b8eae4a3.tar.gz llvm-167e7afcd52bc1438d60320ec1d1bc53b8eae4a3.tar.bz2 |
Implement DW_CFA_LLVM_* for Heterogeneous Debugging
Add support in MC/MIR for writing/parsing, and DebugInfo.
This is part of the Extensions for Heterogeneous Debugging defined at
https://llvm.org/docs/AMDGPUDwarfExtensionsForHeterogeneousDebugging.html
Specifically the CFI instructions implemented here are defined at
https://llvm.org/docs/AMDGPUDwarfExtensionsForHeterogeneousDebugging.html#cfa-definition-instructions
Reviewed By: clayborg
Differential Revision: https://reviews.llvm.org/D76877
Diffstat (limited to 'llvm/lib/MC/MCDwarf.cpp')
-rw-r--r-- | llvm/lib/MC/MCDwarf.cpp | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/llvm/lib/MC/MCDwarf.cpp b/llvm/lib/MC/MCDwarf.cpp index 51e3ac9..217584e 100644 --- a/llvm/lib/MC/MCDwarf.cpp +++ b/llvm/lib/MC/MCDwarf.cpp @@ -1405,6 +1405,19 @@ void FrameEmitterImpl::emitCFIInstruction(const MCCFIInstruction &Instr) { return; } + // TODO: Implement `_sf` variants if/when they need to be emitted. + case MCCFIInstruction::OpLLVMDefAspaceCfa: { + unsigned Reg = Instr.getRegister(); + if (!IsEH) + Reg = MRI->getDwarfRegNumFromDwarfEHRegNum(Reg); + Streamer.emitIntValue(dwarf::DW_CFA_LLVM_def_aspace_cfa, 1); + Streamer.emitULEB128IntValue(Reg); + CFAOffset = Instr.getOffset(); + Streamer.emitULEB128IntValue(CFAOffset); + Streamer.emitULEB128IntValue(Instr.getAddressSpace()); + + return; + } case MCCFIInstruction::OpOffset: case MCCFIInstruction::OpRelOffset: { const bool IsRelative = |