[PATCH] D55748: [AArch64] [MinGW] Allow enabling SEH exceptions
Martin Storsjö via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue Dec 18 00:36:05 PST 2018
This revision was automatically updated to reflect the committed changes.
Closed by commit rL349451: [AArch64] [MinGW] Allow enabling SEH exceptions (authored by mstorsjo, committed by ).
Changed prior to commit:
https://reviews.llvm.org/D55748?vs=178408&id=178609#toc
Repository:
rL LLVM
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D55748/new/
https://reviews.llvm.org/D55748
Files:
llvm/trunk/lib/MC/MCObjectFileInfo.cpp
llvm/trunk/lib/Target/AArch64/MCTargetDesc/AArch64MCAsmInfo.cpp
llvm/trunk/test/CodeGen/AArch64/wineh-mingw.ll
Index: llvm/trunk/test/CodeGen/AArch64/wineh-mingw.ll
===================================================================
--- llvm/trunk/test/CodeGen/AArch64/wineh-mingw.ll
+++ llvm/trunk/test/CodeGen/AArch64/wineh-mingw.ll
@@ -0,0 +1,48 @@
+; RUN: llc < %s -exception-model=wineh -mtriple=aarch64-pc-mingw32 | FileCheck %s -check-prefix=WINEH
+; RUN: llc < %s -exception-model=wineh -mtriple=aarch64-pc-mingw32 -filetype=obj | llvm-readobj -s | FileCheck %s -check-prefix=WINEH-SECTIONS
+
+; Check emission of eh handler and handler data
+declare i32 @_d_eh_personality(i32, i32, i64, i8*, i8*)
+declare void @_d_eh_resume_unwind(i8*)
+
+declare i32 @bar()
+
+define i32 @foo4() #0 personality i32 (i32, i32, i64, i8*, i8*)* @_d_eh_personality {
+entry:
+ %step = alloca i32, align 4
+ store i32 0, i32* %step
+ %tmp = load i32, i32* %step
+
+ %tmp1 = invoke i32 @bar()
+ to label %finally unwind label %landingpad
+
+finally:
+ store i32 1, i32* %step
+ br label %endtryfinally
+
+landingpad:
+ %landing_pad = landingpad { i8*, i32 }
+ cleanup
+ %tmp3 = extractvalue { i8*, i32 } %landing_pad, 0
+ store i32 2, i32* %step
+ call void @_d_eh_resume_unwind(i8* %tmp3)
+ unreachable
+
+endtryfinally:
+ %tmp10 = load i32, i32* %step
+ ret i32 %tmp10
+}
+; WINEH-LABEL: foo4:
+; WINEH: .seh_proc foo4
+; WINEH: .seh_handler _d_eh_personality, @unwind, @except
+; WINEH: ret
+; WINEH: .section .xdata,"dr"
+; WINEH-NEXT: .seh_handlerdata
+; WINEH-NEXT: .text
+; WINEH-NEXT: .seh_endproc
+; WINEH: .section .xdata,"dr"
+; WINEH-NEXT: .p2align 2
+; WINEH-NEXT: GCC_except_table0:
+
+; WINEH-SECTIONS: Name: .xdata
+; WINEH-SECTIONS-NOT: Name: .gcc_except_table
Index: llvm/trunk/lib/MC/MCObjectFileInfo.cpp
===================================================================
--- llvm/trunk/lib/MC/MCObjectFileInfo.cpp
+++ llvm/trunk/lib/MC/MCObjectFileInfo.cpp
@@ -510,7 +510,7 @@
".rdata", COFF::IMAGE_SCN_CNT_INITIALIZED_DATA | COFF::IMAGE_SCN_MEM_READ,
SectionKind::getReadOnly());
- if (T.getArch() == Triple::x86_64) {
+ if (T.getArch() == Triple::x86_64 || T.getArch() == Triple::aarch64) {
// On Windows 64 with SEH, the LSDA is emitted into the .xdata section
LSDASection = nullptr;
} else {
Index: llvm/trunk/lib/Target/AArch64/MCTargetDesc/AArch64MCAsmInfo.cpp
===================================================================
--- llvm/trunk/lib/Target/AArch64/MCTargetDesc/AArch64MCAsmInfo.cpp
+++ llvm/trunk/lib/Target/AArch64/MCTargetDesc/AArch64MCAsmInfo.cpp
@@ -132,4 +132,7 @@
CommentString = "//";
ExceptionsType = ExceptionHandling::DwarfCFI;
+ // The default is dwarf, but WinEH can be enabled optionally, which requires
+ // WinEHEncodingType to be set.
+ WinEHEncodingType = WinEH::EncodingType::Itanium;
}
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D55748.178609.patch
Type: text/x-patch
Size: 2799 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20181218/599d6b9b/attachment.bin>
More information about the llvm-commits
mailing list