[PATCH] D139663: Emit unwind information in the .debug_frame section when the .cfi_sections .debug_frame directive is used.

Adrian Prantl via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Apr 10 15:36:14 PDT 2023


aprantl added inline comments.


================
Comment at: llvm/lib/MC/MCDwarf.cpp:1858
   FrameEmitterImpl Emitter(IsEH, Streamer);
   ArrayRef<MCDwarfFrameInfo> FrameArray = Streamer.getDwarfFrameInfos();
   // Emit the compact unwind info if available.
----------------
unrelated formatting change


================
Comment at: llvm/lib/MC/MCDwarf.cpp:1878
 
-  if (!NeedsEHFrameSection) return;
+  if (!NeedsEHFrameSection && IsEH) return;
 
----------------
The old condition made sense on its own, but now it may be useful to comment why we want to continue when IsEH==true?


================
Comment at: llvm/lib/MC/MCDwarf.cpp:1905
     if (CanOmitDwarf && Frame.CompactUnwindEncoding !=
-          MOFI->getCompactUnwindDwarfEHFrameOnly())
+          MOFI->getCompactUnwindDwarfEHFrameOnly() && IsEH)
       // Don't generate an EH frame if we don't need one. I.e., it's taken care
----------------
The old condition was basically: "prefer dwarf over eh_frame". What does the IsEH flag mean and should we add a comment here?


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

https://reviews.llvm.org/D139663



More information about the llvm-commits mailing list