[WinEH] Refer to filter funclets using their symbol-table symbol
authorDavid Majnemer <david.majnemer@gmail.com>
Wed, 7 Oct 2015 21:34:00 +0000 (21:34 +0000)
committerDavid Majnemer <david.majnemer@gmail.com>
Wed, 7 Oct 2015 21:34:00 +0000 (21:34 +0000)
The relocation for the filter funclet will be against a symbol table
entry for a function instead of the section, making it easier to
understand what is going on.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@249621 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/AsmPrinter/WinException.cpp
test/CodeGen/X86/seh-catchpad.ll

index f672f93a3ee4f4f46787855697b5a00d81aa36c7..5661a378c30e344ba9d852f2c58653b4ea3791aa 100644 (file)
@@ -477,7 +477,8 @@ void WinException::emitCSpecificHandlerTable(const MachineFunction *MF) {
             const MCExpr *ExceptOrNull;
             auto *Handler = UME.Handler.get<MachineBasicBlock *>();
             if (UME.IsFinally) {
-              FilterOrFinally = create32bitRef(Handler->getSymbol());
+              FilterOrFinally =
+                  create32bitRef(getMCSymbolForMBBOrGV(Asm, Handler));
               ExceptOrNull = MCConstantExpr::create(0, Ctx);
             } else {
               // For an except, the filter can be 1 (catch-all) or a function
index fc8e721c63dd9946d1d6aa73dabc4400fd52b47e..865596d206faf4b9748db041e203750b76350683 100644 (file)
@@ -140,7 +140,7 @@ ehcleanup.end:                                    ; preds = %ehcleanup
 ; CHECK-NEXT:         .long   .LBB1_[[except2bb]]@IMGREL
 ; CHECK-NEXT:         .long   .Ltmp2@IMGREL
 ; CHECK-NEXT:         .long   .Ltmp3@IMGREL+1
-; CHECK-NEXT:         .long   .LBB1_[[finbb:[0-9]+]]@IMGREL
+; CHECK-NEXT:         .long   "?dtor$[[finbb:[0-9]+]]@?0?main@4HA"@IMGREL
 ; CHECK-NEXT:         .long   0
 ; CHECK-NEXT:         .long   .Ltmp2@IMGREL
 ; CHECK-NEXT:         .long   .Ltmp3@IMGREL+1