[libc-commits] [libc] [libc][arm] implement setjmp/longjmp (PR #93220)

via libc-commits libc-commits at lists.llvm.org
Thu May 23 10:40:00 PDT 2024


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 df626dd11c360c58eddae813ce6a0524d0a53696 42078cb53551478adac1b0b0d2ca4dccedd87401 -- libc/src/setjmp/arm/longjmp.cpp libc/src/setjmp/arm/setjmp.cpp libc/include/llvm-libc-types/jmp_buf.h
``````````

</details>

<details>
<summary>
View the diff from clang-format here.
</summary>

``````````diff
diff --git a/libc/include/llvm-libc-types/jmp_buf.h b/libc/include/llvm-libc-types/jmp_buf.h
index a537933686..8949be9fa0 100644
--- a/libc/include/llvm-libc-types/jmp_buf.h
+++ b/libc/include/llvm-libc-types/jmp_buf.h
@@ -34,7 +34,7 @@ typedef struct {
 #endif
 #elif defined(__arm__)
   // r4, r5, r6, r7, r8, r9, r10, r11, r12, lr
-  long opaque [10];
+  long opaque[10];
 #else
 #error "__jmp_buf not available for your target architecture."
 #endif
diff --git a/libc/src/setjmp/arm/longjmp.cpp b/libc/src/setjmp/arm/longjmp.cpp
index 752318edfa..edf605c0de 100644
--- a/libc/src/setjmp/arm/longjmp.cpp
+++ b/libc/src/setjmp/arm/longjmp.cpp
@@ -24,8 +24,7 @@ LLVM_LIBC_FUNCTION(void, longjmp, (__jmp_buf * buf, int val)) {
       "movs r0, r1\n\t"
       "it eq\n\t"
       "moveq r0, 1\n\t"
-      "bx lr"
-  );
+      "bx lr");
 }
 
 } // namespace LIBC_NAMESPACE
diff --git a/libc/src/setjmp/arm/setjmp.cpp b/libc/src/setjmp/arm/setjmp.cpp
index 9304ff6b47..40d78f1519 100644
--- a/libc/src/setjmp/arm/setjmp.cpp
+++ b/libc/src/setjmp/arm/setjmp.cpp
@@ -20,8 +20,7 @@ LLVM_LIBC_FUNCTION(int, setjmp, (__jmp_buf * buf)) {
   asm("mov r12, sp\n\t"
       "stm.w r0!, {r4, r5, r6, r7, r8, r9, r10, r11, r12, lr}\n\t"
       "mov.w r0, 0\n\t"
-      "bx lr\n\t"
-  );
+      "bx lr\n\t");
 }
 
 } // namespace LIBC_NAMESPACE

``````````

</details>


https://github.com/llvm/llvm-project/pull/93220


More information about the libc-commits mailing list