[CodeGen] Mark setjmp/catchret MBBs address-taken
authorJoseph Tremoulet <jotrem@microsoft.com>
Fri, 23 Oct 2015 15:06:05 +0000 (15:06 +0000)
committerJoseph Tremoulet <jotrem@microsoft.com>
Fri, 23 Oct 2015 15:06:05 +0000 (15:06 +0000)
commit53fbda20e98149dc991df87dbcea7dea8ece392f
treee0434671186f7b6e54e69c734233020b65faaa19
parent9d4c13124adfe9a9c6cdc22a220eff1eeff63b77
[CodeGen] Mark setjmp/catchret MBBs address-taken

Summary:
This ensures that BranchFolding (and similar) won't remove these blocks.

Also allow AsmPrinter::EmitBasicBlockStart to process MBBs which are
address-taken but do not have BBs that are address-taken, since otherwise
its call to getAddrLabelSymbolTableToEmit would fail an assertion on such
blocks.  I audited the other callers of getAddrLabelSymbolTableToEmit
(and getAddrLabelSymbol); they all have BBs known to be address-taken
except for the call through getAddrLabelSymbol from
WinException::create32bitRef; that call is actually now unreachable, so
I've removed it and updated the signature of create32bitRef.

This fixes PR25168.

Reviewers: majnemer, andrew.w.kaylor, rnk

Subscribers: pgavlin, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@251113 91177308-0d34-0410-b5e6-96231b3b80d8
lib/CodeGen/AsmPrinter/AsmPrinter.cpp
lib/CodeGen/AsmPrinter/WinException.cpp
lib/CodeGen/AsmPrinter/WinException.h
lib/Target/X86/X86FrameLowering.cpp
lib/Target/X86/X86ISelLowering.cpp
test/CodeGen/X86/late-address-taken.ll [new file with mode: 0644]
test/CodeGen/X86/win-catchpad-csrs.ll
test/CodeGen/X86/win-catchpad-nested.ll
test/CodeGen/X86/win-catchpad.ll