[PATCH] D78778: [AsmPrinter] Fix emitting CFI for debug when exceptions are not supported

Fangrui Song via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Apr 27 11:45:55 PDT 2021


MaskRay added a comment.

I noticed that D76519 <https://reviews.llvm.org/D76519>



================
Comment at: llvm/include/llvm/CodeGen/AsmPrinter.h:378
 
+  /// Currently emitting CFI unwind information is entangled with supporting
+  /// the exceptions. When ExceptionsType == ExceptionHandling::None, this
----------------
"Currently emitting CFI unwind information is entangled with supporting ..." This is a remark. It has minor state compared with the main comment. It can be added at the end or omitted.


================
Comment at: llvm/include/llvm/CodeGen/AsmPrinter.h:379
+  /// Currently emitting CFI unwind information is entangled with supporting
+  /// the exceptions. When ExceptionsType == ExceptionHandling::None, this
+  /// returns true if DWARF CFI unwind information should be emitted either
----------------
`ExceptionsType` is not mentioned.


================
Comment at: llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp:351
   switch (MAI->getExceptionHandlingType()) {
+  // We may want to emit CFI for debug or when `ForceDwarfFrameSection`.
+  case ExceptionHandling::None:
----------------
This comment is not clear. Does it only apply to `None`?


================
Comment at: llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp:1067
+bool AsmPrinter::usesCFIForDebug() const {
+  return MAI->getExceptionHandlingType() == ExceptionHandling::None &&
+         ((MMI->hasDebugInfo() && ModuleCFISection == CFISection::Debug) ||
----------------
Does AMDGPU use `MAI->getExceptionHandlingType() == ExceptionHandling::None` for .debug_frame?

Why can't it use `DwarfCFI`?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D78778



More information about the llvm-commits mailing list