[PATCH] [SEH] Add new intrinsics for recovering and restoring parent frames

Reid Kleckner rnk at google.com
Tue Jun 30 13:36:43 PDT 2015


Hi majnemer,

The incoming EBP value established by the runtime is actually a pointer
to the end of the EH registration object, and not the true parent
function frame pointer. Clang doesn't need llvm.x86.seh.exceptioninfo
anymore because we know that the exception info pointer is at a fixed
offset from this incoming EBP.

The llvm.x86.seh.recoverfp intrinsic takes an EBP value provided by the
EH runtime and returns a pointer that is usable with llvm.framerecover.

The llvm.x86.seh.restoreframe intrinsic is inserted by the 32-bit
specific preparation pass in blocks targetted by the EH runtime. It
re-establishes any physical registers used by the parent function to
address the stack, such as the frame, base, and stack pointers.

Neither of these intrinsics correctly handle stack realignment prologues
yet, but it's possible to add that later.

http://reviews.llvm.org/D10848

Files:
  include/llvm/IR/IntrinsicsX86.td
  lib/CodeGen/AsmPrinter/WinException.cpp
  lib/CodeGen/AsmPrinter/WinException.h
  lib/Target/X86/X86ISelLowering.cpp
  lib/Target/X86/X86WinEHState.cpp
  test/CodeGen/X86/seh-catch-all-win32.ll
  test/CodeGen/X86/seh-safe-div-win32.ll

EMAIL PREFERENCES
  http://reviews.llvm.org/settings/panel/emailpreferences/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D10848.28810.patch
Type: text/x-patch
Size: 16325 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20150630/18f4edc6/attachment.bin>


More information about the llvm-commits mailing list