Use FinishThunk to finish musttail thunks
authorReid Kleckner <rnk@google.com>
Thu, 19 Mar 2020 18:52:22 +0000 (11:52 -0700)
committerReid Kleckner <rnk@google.com>
Fri, 20 Mar 2020 16:02:21 +0000 (09:02 -0700)
commitce5173c0e174870934d1b3a026f631d996136191
tree1ea47f225dc733fa0f29cfd1c10e987f77142a68
parentffcc076a2b23363025de2f67243086963f235b20
Use FinishThunk to finish musttail thunks

FinishThunk, and the invariant of setting and then unsetting
CurCodeDecl, was added in 7f416cc42638 (2015). The invariant didn't
exist when I added this musttail codepath in ab2090d10765 (2014).
Recently in 28328c3771, I started using this codepath on non-Windows
platforms, and users reported problems during release testing (PR44987).

The issue was already present for users of EH on i686-windows-msvc, so I
added a test for that case as well.

Reviewed By: hans

Differential Revision: https://reviews.llvm.org/D76444
clang/lib/CodeGen/CGVTables.cpp
clang/test/CodeGenCXX/ms-thunks-ehspec.cpp [new file with mode: 0644]
clang/test/CodeGenCXX/thunks-ehspec.cpp [new file with mode: 0644]