OSDN Git Service

[WinEH] Find root frame correctly in CLR funclets
authorJoseph Tremoulet <jotrem@microsoft.com>
Fri, 13 Nov 2015 00:39:23 +0000 (00:39 +0000)
committerJoseph Tremoulet <jotrem@microsoft.com>
Fri, 13 Nov 2015 00:39:23 +0000 (00:39 +0000)
commita736fb54210c4f1f161a27e7149e4909589bd821
tree05db557af62aad00cba81c18a5a7cd66a80b45ad
parentc7f1d5b5dca70722f17f48cd128dfef288760740
[WinEH] Find root frame correctly in CLR funclets

Summary:
The value that the CoreCLR personality passes to a funclet for the
establisher frame may be the root function's frame or may be the parent
funclet's (mostly empty) frame in the case of nested funclets.  Each
funclet stores a pointer to the root frame in its own (mostly empty)
frame, as does the root function itself.  All frames allocate this slot at
the same offset, measured from the post-prolog stack pointer, so that the
same sequence can accept any ancestor as an establisher frame parameter
value, and so that a single offset can be reported to the GC, which also
looks at this slot.

This change allocate the slot when processing function entry, and records
its frame index on the WinEHFuncInfo object, then inserts the code to
set/copy it during prolog emission.

Reviewers: majnemer, AndyAyers, pgavlin, rnk

Subscribers: llvm-commits

Differential Revision: http://reviews.llvm.org/D14614

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@252983 91177308-0d34-0410-b5e6-96231b3b80d8
include/llvm/CodeGen/WinEHFuncInfo.h
lib/Target/X86/X86FrameLowering.cpp
lib/Target/X86/X86FrameLowering.h
lib/Target/X86/X86ISelLowering.cpp
test/CodeGen/WinEH/wineh-coreclr.ll