[PATCH] D17721: [WinEH] Make setjmp work correctly with EH

David Majnemer via llvm-commits llvm-commits at lists.llvm.org
Mon Feb 29 08:21:02 PST 2016


majnemer created this revision.
majnemer added reviewers: rnk, andrew.w.kaylor, JosephTremoulet.
majnemer added a subscriber: llvm-commits.

32-bit X86 EH on Windows utilizes a stack of registration nodes
allocated and deallocated on entry/exit.  A registration node contains a
bunch of EH personality specific information like which try-state we are
currently in.

Because a setjmp target allows control flow from arbitrary program
points, there is no way to ensure that the try-state we are in is
correctly updated once we transfer control.

MSVC compatible compilers, like MSVC and ICC, utilize runtime helpers to
reinitialize the try-state when a longjmp occurs.  This is implemented
by adding additional arguments to _setjmp3: the desired try-state and
a helper routine to update the try-state.

http://reviews.llvm.org/D17721

Files:
  lib/Target/X86/X86WinEHState.cpp
  test/CodeGen/WinEH/wineh-setjmp.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D17721.49381.patch
Type: text/x-patch
Size: 13695 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160229/c6996de1/attachment.bin>


More information about the llvm-commits mailing list