[PATCH] D119315: [RISCV] Add CFI directives for RISCV epilog

LiqinWeng via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Feb 9 00:59:06 PST 2022


Miss_Grape added a comment.

In D119315#3306940 <https://reviews.llvm.org/D119315#3306940>, @kito-cheng wrote:

> Do you mind add a test case to demonstrate that we've emit `.cfi_def_cfa` after this patch?

The CFI directives is emitted to ensure that it can correctly print the stack relationship in the case of debugging
The following shows the difference between the debug_frame sections of clang and riscv-unknown-elf-gcc
F22044156: image.png <https://reviews.llvm.org/F22044156>
F22044167: image.png <https://reviews.llvm.org/F22044167>
We need to update the CFA in the function Epilogue, otherwise our debug_frame cannot print the address of the caller function correctly


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D119315/new/

https://reviews.llvm.org/D119315



More information about the llvm-commits mailing list