[PATCH] D125645: [ARM SEH 3] [ARM] [MC] Add support for writing ARM WinEH unwind info

Martin Storsjö via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed May 25 12:52:54 PDT 2022


mstorsjo added inline comments.


================
Comment at: llvm/lib/CodeGen/AsmPrinter/WinException.cpp:760
+  if (Asm->MAI->usesWindowsCFI() &&
+      FuncInfo.UnwindHelpFrameIdx != std::numeric_limits<int>::max()) {
     AddComment("UnwindHelp");
----------------
mstorsjo wrote:
> efriedma wrote:
> > I assume this is related somehow, but not sure how, exactly.
> Ah, hmm. I think this might be leftovers from initial attempts at making things work for MSVC mode (for either C++ unwinding or SEH `__try`). I left that out of scope for now (itanium unwinding for mingw mode works fine without it though), so I guess I should leave it out here too.
Ah, no, now I remember. We have an existing testcase, `test/CodeGen/ARM/Windows/wineh-basic.ll`, which tests some C++ exception handling constructs.

Since we enable `WinEHEncodingType = WinEH::EncodingType::Itanium;` in this commit, we end up trying to do more things than we've done before, and that testcase triggers a failed assert, as we try to call `UnwindHelpOffset = getFrameIndexOffset(FuncInfo.UnwindHelpFrameIdx, FuncInfo)` when `FuncInfo.UnwindHelpFrameIdx` is unset (left at its default value of `std::numeric_limits<int>::max()`).

So these changes could be removed later when MSVC C++ exception handling is properly implemented for ARM, but for now, this avoids breaking the existing testcase.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D125645



More information about the llvm-commits mailing list