[llvm] [RISCV] Guard CFI emission code with MF.needsFrameMoves() (PR #136060)

Sergei Barannikov via llvm-commits llvm-commits at lists.llvm.org
Wed Apr 16 16:55:51 PDT 2025


================
@@ -92,6 +92,11 @@ static const std::pair<MCPhysReg, int8_t> FixedCSRFIQCIInterruptMap[] = {
     /* -21, -22, -23, -24 are reserved */
 };
 
+/// Returns true if DWARF CFI instructions ("frame moves") should be emitted.
+static bool needsDwarfCFI(const MachineFunction &MF) {
+  return MF.needsFrameMoves();
----------------
s-barannikov wrote:

I extracted this into a separate method because the check will need to be amended when/if Windows support arrives,
and/or if RISC-V backend learns to emit asynchronous (instruction precise) unwind info.


https://github.com/llvm/llvm-project/pull/136060


More information about the llvm-commits mailing list