[PATCH] D63416: [RISCV] Use DW_EH_PE_udata4 for call site encoding in .gcc_except_table

Edward Jones via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jun 19 04:28:49 PDT 2019


edward-jones updated this revision to Diff 205548.
edward-jones retitled this revision from "[WIP][RISCV] Use DW_EH_PE_udata4 for call site encoding in .gcc_except_table" to "[RISCV] Use DW_EH_PE_udata4 for call site encoding in .gcc_except_table".
edward-jones added a comment.
Herald added subscribers: Jim, jocewei, PkmX, the_o, brucehoult, MartinMosbeck, zzheng, niosHD, sabuasal, apazos, simoncook, johnrusso, rbar.

Added tests, rebased


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D63416/new/

https://reviews.llvm.org/D63416

Files:
  lib/CodeGen/TargetLoweringObjectFileImpl.cpp
  test/CodeGen/RISCV/exception.ll


Index: test/CodeGen/RISCV/exception.ll
===================================================================
--- test/CodeGen/RISCV/exception.ll
+++ test/CodeGen/RISCV/exception.ll
@@ -86,5 +86,24 @@
 ;                                             DW_EH_PE_sdata4
 ;   # Call site encoding #
 ; CHECK:      .Lttbaseref0:
+; CHECK-NEXT: .byte  3
+;                    ^-- Call site encoding: DW_EH_PE_udata4
+;   # Call sites #
+;   Unlike most other targets these are encoded as DW_EH_PE_udata4 instead
+;   of DW_EH_PE_uleb128, as we can't emit relocation for a difference between
+;   uleb128 encoded values.
+;
+; CHECK:      .Lcst_begin0:
+; CHECK-NEXT: .word  .Lfunc_begin0-.Lfunc_begin0
+; CHECK-NEXT: .word  .Ltmp0-.Lfunc_begin0
+; CHECK-NEXT: .word  0
+; CHECK-NEXT: .byte  0
+; CHECK-NEXT: .word  .Ltmp0-.Lfunc_begin0
+; CHECK-NEXT: .word  .Ltmp1-.Ltmp0
+; CHECK-NEXT: .word  .Ltmp2-.Lfunc_begin0
 ; CHECK-NEXT: .byte  1
-;                    ^-- Call site encoding: DW_EH_PE_uleb128
+; CHECK-NEXT: .word  .Ltmp1-.Lfunc_begin0
+; CHECK-NEXT: .word  .Lfunc_end0-.Ltmp1
+; CHECK-NEXT: .word  0
+; CHECK-NEXT: .byte  0
+; CHECK-NEXT: .Lcst_end0:
Index: lib/CodeGen/TargetLoweringObjectFileImpl.cpp
===================================================================
--- lib/CodeGen/TargetLoweringObjectFileImpl.cpp
+++ lib/CodeGen/TargetLoweringObjectFileImpl.cpp
@@ -225,6 +225,7 @@
       LSDAEncoding = dwarf::DW_EH_PE_absptr;
       TTypeEncoding = dwarf::DW_EH_PE_absptr;
     }
+    CallSiteEncoding = dwarf::DW_EH_PE_udata4;
     break;
   case Triple::sparcel:
   case Triple::sparc:


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D63416.205548.patch
Type: text/x-patch
Size: 1595 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190619/f0fa9aff/attachment.bin>


More information about the llvm-commits mailing list