[PATCH] D145164: [clang][RISCV] Enable -fasynchronous-unwind-tables by default on Linux

Kito Cheng via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Mar 2 07:33:36 PST 2023


kito-cheng created this revision.
kito-cheng added reviewers: asb, luismarques, jrtc27, MaskRay, craig.topper, reames.
Herald added subscribers: luke, VincentWu, vkmr, frasercrmck, evandro, apazos, sameer.abuasal, pengfei, s.egerton, Jim, benna, psnobl, jocewei, PkmX, the_o, brucehoult, MartinMosbeck, rogfer01, edward-jones, zzheng, shiva0217, niosHD, sabuasal, simoncook, johnrusso, rbar, kristof.beyls, arichardson.
Herald added a project: All.
kito-cheng requested review of this revision.
Herald added subscribers: cfe-commits, pcwang-thead, eopXD.
Herald added a project: clang.

This could improve user experience for stack unwinding, and also this is
enabled by default by X86 and AArch64 and RISC-V GCC.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D145164

Files:
  clang/lib/Driver/ToolChains/Gnu.cpp
  clang/test/Driver/riscv-features.c


Index: clang/test/Driver/riscv-features.c
===================================================================
--- clang/test/Driver/riscv-features.c
+++ clang/test/Driver/riscv-features.c
@@ -26,7 +26,8 @@
 // RUN: %clang --target=riscv64-linux -### %s -fsyntax-only 2>&1 \
 // RUN:   | FileCheck %s -check-prefix=DEFAULT-LINUX
 
-// DEFAULT-LINUX: "-target-feature" "+m"
+// DEFAULT-LINUX: "-funwind-tables=2"
+// DEFAULT-LINUX-SAME: "-target-feature" "+m"
 // DEFAULT-LINUX-SAME: "-target-feature" "+a"
 // DEFAULT-LINUX-SAME: "-target-feature" "+f"
 // DEFAULT-LINUX-SAME: "-target-feature" "+d"
Index: clang/lib/Driver/ToolChains/Gnu.cpp
===================================================================
--- clang/lib/Driver/ToolChains/Gnu.cpp
+++ clang/lib/Driver/ToolChains/Gnu.cpp
@@ -2900,6 +2900,8 @@
   case llvm::Triple::ppcle:
   case llvm::Triple::ppc64:
   case llvm::Triple::ppc64le:
+  case llvm::Triple::riscv32:
+  case llvm::Triple::riscv64:
   case llvm::Triple::x86:
   case llvm::Triple::x86_64:
     return UnwindTableLevel::Asynchronous;


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D145164.501863.patch
Type: text/x-patch
Size: 1064 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20230302/31df20e1/attachment.bin>


More information about the cfe-commits mailing list