[llvm] 46416f0 - [CodeGen] [WinException] Remove a redundant explicit section switch for aarch64

Martin Storsjö via llvm-commits llvm-commits at lists.llvm.org
Fri Sep 11 00:34:29 PDT 2020


Author: Martin Storsjö
Date: 2020-09-11T10:31:04+03:00
New Revision: 46416f08031f6fcaccd9f51430f7a71c5f510495

URL: https://github.com/llvm/llvm-project/commit/46416f08031f6fcaccd9f51430f7a71c5f510495
DIFF: https://github.com/llvm/llvm-project/commit/46416f08031f6fcaccd9f51430f7a71c5f510495.diff

LOG: [CodeGen] [WinException] Remove a redundant explicit section switch for aarch64

The following EmitWinEHHandlerData() implicitly switches to .xdata, just
like on x86_64.

This became orphaned from the original code requiring it in
0b61d220c9b1f0 / https://reviews.llvm.org/D61095.

Differential Revision: https://reviews.llvm.org/D87447

Added: 
    

Modified: 
    llvm/lib/CodeGen/AsmPrinter/WinException.cpp
    llvm/test/CodeGen/AArch64/win64-jumptable.ll
    llvm/test/CodeGen/AArch64/wineh-mingw.ll
    llvm/test/CodeGen/AArch64/wineh1.mir

Removed: 
    


################################################################################
diff  --git a/llvm/lib/CodeGen/AsmPrinter/WinException.cpp b/llvm/lib/CodeGen/AsmPrinter/WinException.cpp
index cd8077e7d548..c47ac7e17b6a 100644
--- a/llvm/lib/CodeGen/AsmPrinter/WinException.cpp
+++ b/llvm/lib/CodeGen/AsmPrinter/WinException.cpp
@@ -258,15 +258,6 @@ void WinException::endFuncletImpl() {
     if (F.hasPersonalityFn())
       Per = classifyEHPersonality(F.getPersonalityFn()->stripPointerCasts());
 
-    // On funclet exit, we emit a fake "function" end marker, so that the call
-    // to EmitWinEHHandlerData below can calculate the size of the funclet or
-    // function.
-    if (isAArch64) {
-      MCSection *XData = Asm->OutStreamer->getAssociatedXDataSection(
-          Asm->OutStreamer->getCurrentSectionOnly());
-      Asm->OutStreamer->SwitchSection(XData);
-    }
-
     // Emit an UNWIND_INFO struct describing the prologue.
     Asm->OutStreamer->EmitWinEHHandlerData();
 

diff  --git a/llvm/test/CodeGen/AArch64/win64-jumptable.ll b/llvm/test/CodeGen/AArch64/win64-jumptable.ll
index 0c61bcd52366..1983b2568cde 100644
--- a/llvm/test/CodeGen/AArch64/win64-jumptable.ll
+++ b/llvm/test/CodeGen/AArch64/win64-jumptable.ll
@@ -44,7 +44,6 @@ declare void @g(i32, i32)
 ; CHECK:    .word .LBB0_3-.LJTI0_0
 ; CHECK:    .word .LBB0_4-.LJTI0_0
 ; CHECK:    .word .LBB0_5-.LJTI0_0
-; CHECK:    .section  .xdata,"dr"
 ; CHECK:    .seh_handlerdata
 ; CHECK:    .text
 ; CHECK:    .seh_endproc

diff  --git a/llvm/test/CodeGen/AArch64/wineh-mingw.ll b/llvm/test/CodeGen/AArch64/wineh-mingw.ll
index ff1a55711b9e..d22c61fca757 100644
--- a/llvm/test/CodeGen/AArch64/wineh-mingw.ll
+++ b/llvm/test/CodeGen/AArch64/wineh-mingw.ll
@@ -36,8 +36,7 @@ endtryfinally:
 ; WINEH: .seh_proc foo4
 ; WINEH: .seh_handler _d_eh_personality, @unwind, @except
 ; WINEH: ret
-; WINEH: .section .xdata,"dr"
-; WINEH-NEXT: .seh_handlerdata
+; WINEH:      .seh_handlerdata
 ; WINEH-NEXT: .text
 ; WINEH-NEXT: .seh_endproc
 ; WINEH: .section .xdata,"dr"

diff  --git a/llvm/test/CodeGen/AArch64/wineh1.mir b/llvm/test/CodeGen/AArch64/wineh1.mir
index aed1550c54f7..2f73a5291ddd 100644
--- a/llvm/test/CodeGen/AArch64/wineh1.mir
+++ b/llvm/test/CodeGen/AArch64/wineh1.mir
@@ -73,7 +73,6 @@
 # ASM: .seh_endepilogue
 
 # ASM: .seh_endfunclet
-# ASM: .section .xdata,"dr"
 # ASM: .seh_handlerdata
 # ASM: .text
 # ASM: .seh_endproc


        


More information about the llvm-commits mailing list