[all-commits] [llvm/llvm-project] d421f5: [X86] Use the CFA as the DWARF frame base for bett...

Kyle Huey via All-commits all-commits at lists.llvm.org
Mon May 15 07:10:22 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: d421f5226048e4a5d88aab157d0f4d434c43f208
      https://github.com/llvm/llvm-project/commit/d421f5226048e4a5d88aab157d0f4d434c43f208
  Author: Kyle Huey <khuey at pernos.co>
  Date:   2023-05-15 (Mon, 15 May 2023)

  Changed paths:
    M llvm/include/llvm/CodeGen/TargetFrameLowering.h
    M llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp
    M llvm/lib/Target/X86/X86FrameLowering.cpp
    M llvm/lib/Target/X86/X86FrameLowering.h
    M llvm/test/CodeGen/X86/dbg-baseptr.ll
    M llvm/test/DebugInfo/X86/dwarf-public-names.ll
    M llvm/test/ExecutionEngine/OrcLazy/debug-objects-elf-minimal.ll
    M llvm/test/MC/X86/dwarf-size-field-overflow.test
    M llvm/test/tools/llvm-dwarfdump/X86/statistics.ll

  Log Message:
  -----------
  [X86] Use the CFA as the DWARF frame base for better variable locations around calls.

Prior to this patch, for the DWARF frame base LLVM uses the frame pointer
register if available, otherwise the stack pointer register. If the stack
pointer register is being used and a call or other code modifies the stack
pointer during the body of the function this results in the locations being
wrong and the debugger displaying the wrong values for variables.

By using DW_OP_call_frame_cfa in these situations the emitted location for
the variable will automatically handle changes in the stack pointer.
The CFA needs to be adjusted for the offset between the frame pointer/stack
pointer to allow the variable locations themselves to remain unchanged by
this patch.

Reviewed By: #debug-info, scott.linder, jryans

Differential Revision: https://reviews.llvm.org/D143463




More information about the All-commits mailing list