[compiler-rt] [libunwind] [llvm] Fix compiling/using libunwind for wasm targets (PR #185770)
via cfe-commits
cfe-commits at lists.llvm.org
Tue Mar 10 16:01:35 PDT 2026
github-actions[bot] wrote:
<!--LLVM CODE FORMAT COMMENT: {clang-format}-->
:warning: C/C++ code formatter, clang-format found issues in your code. :warning:
<details>
<summary>
You can test this locally with the following command:
</summary>
``````````bash
git-clang-format --diff origin/main HEAD --extensions h,c -- libunwind/src/Unwind-wasm.c libunwind/src/assembly.h --diff_from_common_commit
``````````
:warning:
The reproduction instructions above might return results for more than one PR
in a stack if you are using a stacked PR workflow. You can limit the results by
changing `origin/main` to the base branch/commit you want to compare against.
:warning:
</details>
<details>
<summary>
View the diff from clang-format here.
</summary>
``````````diff
diff --git a/libunwind/src/Unwind-wasm.c b/libunwind/src/Unwind-wasm.c
index 44d284ba8..c0ca9b775 100644
--- a/libunwind/src/Unwind-wasm.c
+++ b/libunwind/src/Unwind-wasm.c
@@ -74,17 +74,15 @@ _Unwind_RaiseException(_Unwind_Exception *exception_object) {
// definition for this API and it's required for users to ensure that there's
// only one copy of `libunwind` within a wasm module to ensure this is only
// defined once and exactly once.
-__asm__(
-".globl __cpp_exception\n"
+__asm__(".globl __cpp_exception\n"
#if defined(__wasm32__)
-".tagtype __cpp_exception i32\n"
+ ".tagtype __cpp_exception i32\n"
#elif defined(__wasm64__)
-".tagtype __cpp_exception i64\n"
+ ".tagtype __cpp_exception i64\n"
#else
-# error "Unsupported Wasm architecture"
+#error "Unsupported Wasm architecture"
#endif
-"__cpp_exception:\n"
-);
+ "__cpp_exception:\n");
/// Called by __cxa_end_catch.
_LIBUNWIND_EXPORT void
``````````
</details>
https://github.com/llvm/llvm-project/pull/185770
More information about the cfe-commits
mailing list