[PATCH] Handle nested landing pads in outlined catch handlers for Windows C++ EH

Andy Kaylor andrew.kaylor at intel.com
Tue Mar 24 17:13:18 PDT 2015


Hi rnk, majnemer,

This patch implements the code to fill in nested landing pads that were stubbed out during initial catch handler outlining.

The nested landing pad may introduce new exception variables that need to be recovered in the handler in which the landing pad is nested in order for the value to be passed to eh.actions.  If the variable isn't otherwise referenced in the handler, I think we will want to drop the recovered value during code gen.

A catch handler that is called from the nested landing pad may need to return to an address in the outlined handler.  I've added code to detect this case and remap the return instruction.  This will not work correctly if the cloning code optimizes away the target block or if the target block is shared between multiple catch handlers.  I think both of these are possible, but I don't have test cases to show it yet.

REPOSITORY
  rL LLVM

http://reviews.llvm.org/D8596

Files:
  lib/CodeGen/WinEHPrepare.cpp
  test/CodeGen/WinEH/cppeh-catch-unwind.ll
  test/CodeGen/WinEH/cppeh-nested-1.ll
  test/CodeGen/WinEH/cppeh-nested-3.ll

EMAIL PREFERENCES
  http://reviews.llvm.org/settings/panel/emailpreferences/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D8596.22617.patch
Type: text/x-patch
Size: 31279 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20150325/925a7cb6/attachment.bin>


More information about the llvm-commits mailing list