[WinEH] Make sure LSDA tables are 4 byte aligned

Apparently this is important, otherwise _except_handler3 assumes that
the registration node is corrupted and ignores it.

Also fix a bug in WinEHPrepare where we would insert code after a
terminator instruction.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@241877 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Reid Kleckner
2015-07-10 00:08:49 +00:00
parent 89a5e2532d
commit b4eeb6bca5
7 changed files with 12 additions and 2 deletions
@@ -114,6 +114,7 @@ stub: ; preds = %entry
; CHECK: .seh_handlerdata
; CHECK: .long ($cppxdata$main)@IMGREL
; CHECK: .align 4
; CHECK-NEXT: $cppxdata$main:
; CHECK-NEXT: .long 429065506
; CHECK-NEXT: .long 2
@@ -121,6 +121,7 @@ try.cont8: ; preds = %lpad2, %try.cont
; CHECK-NOT: jmpq *
; CHECK: .seh_handlerdata
; CHECK-NEXT: .long ("$cppxdata$?f@@YAXXZ")@IMGREL
; CHECK-NEXT: .align 4
; CHECK-NEXT:"$cppxdata$?f@@YAXXZ":
; CHECK-NEXT: .long 429065506
; CHECK-NEXT: .long 4
@@ -30,6 +30,7 @@ $_TI1H = comdat any
; CHECK-LABEL: "?test1@@YAXXZ":
; CHECK: .seh_handlerdata
; CHECK-NEXT: .long ("$cppxdata$?test1@@YAXXZ")@IMGREL
; CHECK-NEXT: .align 4
; CHECK-NEXT:"$cppxdata$?test1@@YAXXZ":
; CHECK-NEXT: .long 429065506
; CHECK-NEXT: .long 1
@@ -92,6 +93,7 @@ entry:
; CHECK-LABEL: "?test2@@YAX_N@Z":
; CHECK: .seh_handlerdata
; CHECK-NEXT: .long ("$cppxdata$?test2@@YAX_N@Z")@IMGREL
; CHECK-NEXT: .align 4
; CHECK-NEXT:"$cppxdata$?test2@@YAX_N@Z":
; CHECK-NEXT: .long 429065506
; CHECK-NEXT: .long 2
+1
View File
@@ -90,6 +90,7 @@ entry:
; CHECK: .section .xdata,"dr"
; CHECK: Lmain$parent_frame_offset = Lmain$frame_escape_1
; CHECK: .align 4
; CHECK: L__ehtable$main
; CHECK-NEXT: .long -1
; CHECK-NEXT: .long _filt$main
+1
View File
@@ -132,6 +132,7 @@ catchall:
; CHECK: retl
; CHECK: .section .xdata,"dr"
; CHECK: .align 4
; CHECK-LABEL: L__ehtable$use_CxxFrameHandler3:
; CHECK-NEXT: .long 429065506
; CHECK-NEXT: .long 2