[PATCH] D148042: [MSP430] Get the DWARF pointer size from MCAsmInfo instead of DataLayout.

Ilia Kuklin via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Apr 11 12:58:49 PDT 2023


kuilpd created this revision.
kuilpd added reviewers: asl, bkramer.
kuilpd added a project: LLVM.
Herald added a subscriber: hiraditya.
Herald added a project: All.
kuilpd requested review of this revision.
Herald added a subscriber: llvm-commits.

This change will allow to put code pointers in DWARF info fields that are larger than actual pointer size, e.g. 16-bit pointers into 32-bit fields.

The need for this came up while creating support for MSP430 in LLDB. MSP430-GCC already generates DWARF info with 32-bit fields, so this change is necessary for LLDB to maintain compatibility with both GCC and LLVM binaries. Moreover, right now in LLDB there is no support for having DWARF pointer size different from ELF header type, e.g. 16-bit DWARF info within ELF32, and it seems there is no such thing as ELF16.

Since other mainline targets are made to have the same pointer size in both MCAsmInfo and DataLayout, there is no need to change anything there.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D148042

Files:
  llvm/lib/CodeGen/AsmPrinter/AddressPool.cpp
  llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp
  llvm/lib/CodeGen/AsmPrinter/AsmPrinterDwarf.cpp
  llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp
  llvm/lib/Target/MSP430/MCTargetDesc/MSP430MCAsmInfo.cpp
  llvm/test/DebugInfo/MSP430/cu-ranges.ll
  llvm/test/DebugInfo/MSP430/dwarf-basics-v5.ll
  llvm/test/DebugInfo/MSP430/dwarf-basics.ll
  llvm/test/DebugInfo/MSP430/ranges_always.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D148042.512557.patch
Type: text/x-patch
Size: 18473 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230411/46478337/attachment-0001.bin>


More information about the llvm-commits mailing list