Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Unit Tests
Event Timeline
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 debug in the case of debugging. We need to update the CFA in the function Epilogue, otherwise we cannot find the calling relationship of the caller function
The following shows the difference between the debug_frame sections of clang and riscv-unknown-elf-gcc
I mean add a testcase like: https://github.com/llvm/llvm-project/blob/main/llvm/test/CodeGen/RISCV/frame-info.ll
This lack of CFI is deliberate. See https://reviews.llvm.org/D69723 and discussions in https://reviews.llvm.org/D111519. The underlying problem has not been fixed, so we cannot do this.
Perhaps something we can do to avoid this in the future is add a comment to emitEpilogue explaining why we deliberately don't emit CFI directives, pointing to these discussions and a bug number (creating one if no such bug exists)?