[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
parent
f516ad61
Please register or sign in to comment