[llvm] 28edf33 - Emit unwind information in the .debug_frame section when the .cfi_sections .debug_frame directive is used.
Shubham Sandeep Rastogi via llvm-commits
llvm-commits at lists.llvm.org
Wed Dec 14 16:36:10 PST 2022
Author: Shubham Sandeep Rastogi
Date: 2022-12-14T16:36:02-08:00
New Revision: 28edf3349bd1d595270c17ec73e49999175f1212
URL: https://github.com/llvm/llvm-project/commit/28edf3349bd1d595270c17ec73e49999175f1212
DIFF: https://github.com/llvm/llvm-project/commit/28edf3349bd1d595270c17ec73e49999175f1212.diff
LOG: Emit unwind information in the .debug_frame section when the .cfi_sections .debug_frame directive is used.
Differential Revision: https://reviews.llvm.org/D139663
Added:
llvm/test/DebugInfo/debugframeinfo.s
Modified:
llvm/lib/MC/MCDwarf.cpp
Removed:
################################################################################
diff --git a/llvm/lib/MC/MCDwarf.cpp b/llvm/lib/MC/MCDwarf.cpp
index a3ecebbfa0385..7d7e790a254cf 100644
--- a/llvm/lib/MC/MCDwarf.cpp
+++ b/llvm/lib/MC/MCDwarf.cpp
@@ -1860,7 +1860,7 @@ void MCDwarfFrameEmitter::Emit(MCObjectStreamer &Streamer, MCAsmBackend *MAB,
// Emit the compact unwind info if available.
bool NeedsEHFrameSection = !MOFI->getSupportsCompactUnwindWithoutEHFrame();
- if (IsEH && MOFI->getCompactUnwindSection()) {
+ if (MOFI->getCompactUnwindSection()) {
Streamer.generateCompactUnwindEncodings(MAB);
bool SectionEmitted = false;
for (const MCDwarfFrameInfo &Frame : FrameArray) {
diff --git a/llvm/test/DebugInfo/debugframeinfo.s b/llvm/test/DebugInfo/debugframeinfo.s
new file mode 100644
index 0000000000000..9c39a30c7733b
--- /dev/null
+++ b/llvm/test/DebugInfo/debugframeinfo.s
@@ -0,0 +1,14 @@
+# RUN: llvm-mc -filetype=obj -triple=arm64-apple-darwin22.1.0 %s -o %t.o
+# RUN: llvm-dwarfdump -debug-frame %t.o | FileCheck %s
+
+# CHECK: .debug_frame contents:
+# CHECK-EMPTY:
+# CHECK-NEXT: 00000000 00000014 ffffffff CIE
+# CHECK: .eh_frame contents:
+# CHECK-EMPTY:
+
+ .cfi_startproc
+ .cfi_signal_frame
+ .cfi_def_cfa x28, 0x340
+ .cfi_endproc
+ .cfi_sections .debug_frame
More information about the llvm-commits
mailing list