From 3d0fbf1d74fd1a8f55d1313e9bfc216e7ad9f02b Mon Sep 17 00:00:00 2001 From: Joseph Tremoulet Date: Fri, 23 Oct 2015 15:06:05 +0000 Subject: [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/WinException.cpp | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'llvm/lib/CodeGen/AsmPrinter/WinException.cpp') diff --git a/llvm/lib/CodeGen/AsmPrinter/WinException.cpp b/llvm/lib/CodeGen/AsmPrinter/WinException.cpp index 58103836a09..3999268b407 100644 --- a/llvm/lib/CodeGen/AsmPrinter/WinException.cpp +++ b/llvm/lib/CodeGen/AsmPrinter/WinException.cpp @@ -273,12 +273,10 @@ const MCExpr *WinException::create32bitRef(const MCSymbol *Value) { Asm->OutContext); } -const MCExpr *WinException::create32bitRef(const Value *V) { - if (!V) +const MCExpr *WinException::create32bitRef(const GlobalValue *GV) { + if (!GV) return MCConstantExpr::create(0, Asm->OutContext); - if (const auto *GV = dyn_cast(V)) - return create32bitRef(Asm->getSymbol(GV)); - return create32bitRef(MMI->getAddrLabelSymbol(cast(V))); + return create32bitRef(Asm->getSymbol(GV)); } const MCExpr *WinException::getLabelPlusOne(const MCSymbol *Label) { -- cgit v1.2.3