[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)
commit3d0fbf1d74fd1a8f55d1313e9bfc216e7ad9f02b
treec3998aa9dc4e4c81b543fbf5b7e27f2d782b58a6
parent05a896a8d1745c260ac21577c3e12ddee4ea1923
[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

llvm-svn: 251113
llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp
llvm/lib/CodeGen/AsmPrinter/WinException.cpp
llvm/lib/CodeGen/AsmPrinter/WinException.h
llvm/lib/Target/X86/X86FrameLowering.cpp
llvm/lib/Target/X86/X86ISelLowering.cpp
llvm/test/CodeGen/X86/late-address-taken.ll [new file with mode: 0644]
llvm/test/CodeGen/X86/win-catchpad-csrs.ll
llvm/test/CodeGen/X86/win-catchpad-nested.ll
llvm/test/CodeGen/X86/win-catchpad.ll