[libc-commits] [libc] [libc] add remarks to the setjmp implementation (PR #137066)
Schrodinger ZHU Yifan via libc-commits
libc-commits at lists.llvm.org
Wed Apr 30 13:28:05 PDT 2025
https://github.com/SchrodingerZhu updated https://github.com/llvm/llvm-project/pull/137066
>From 38e295063fc7ba969b3daedf6e376a0f986123cf Mon Sep 17 00:00:00 2001
From: Schrodinger ZHU Yifan <yifanzhu at rochester.edu>
Date: Wed, 23 Apr 2025 17:42:26 -0400
Subject: [PATCH 1/5] [libc] add remarks to the setjmp implementation
---
libc/src/setjmp/x86_64/setjmp.cpp | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/libc/src/setjmp/x86_64/setjmp.cpp b/libc/src/setjmp/x86_64/setjmp.cpp
index 28e52712c785d..83d0b635ffcbf 100644
--- a/libc/src/setjmp/x86_64/setjmp.cpp
+++ b/libc/src/setjmp/x86_64/setjmp.cpp
@@ -6,6 +6,12 @@
//
//===----------------------------------------------------------------------===//
+// We use naked functions to avoid compiler-generated prologue and epilogue.
+// Despite GCC document list this as an supported case for extended asm, the
+// generated code is not wrong as we only pass in constant operands to
+// extended asm.
+// See https://github.com/llvm/llvm-project/issues/137055 for related remarks.
+
#include "hdr/offsetof_macros.h"
#include "src/__support/common.h"
#include "src/__support/macros/config.h"
>From bdfe9c80e8aafb1e75625ab45f587cb360c7e322 Mon Sep 17 00:00:00 2001
From: Schrodinger ZHU Yifan <yifanzhu at rochester.edu>
Date: Wed, 23 Apr 2025 17:43:56 -0400
Subject: [PATCH 2/5] Update libc/src/setjmp/x86_64/setjmp.cpp
Co-authored-by: Copilot <175728472+Copilot at users.noreply.github.com>
---
libc/src/setjmp/x86_64/setjmp.cpp | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/libc/src/setjmp/x86_64/setjmp.cpp b/libc/src/setjmp/x86_64/setjmp.cpp
index 83d0b635ffcbf..b3f0207c2cfdd 100644
--- a/libc/src/setjmp/x86_64/setjmp.cpp
+++ b/libc/src/setjmp/x86_64/setjmp.cpp
@@ -7,7 +7,7 @@
//===----------------------------------------------------------------------===//
// We use naked functions to avoid compiler-generated prologue and epilogue.
-// Despite GCC document list this as an supported case for extended asm, the
+// Despite GCC documentation listing this as a supported case for extended asm, the
// generated code is not wrong as we only pass in constant operands to
// extended asm.
// See https://github.com/llvm/llvm-project/issues/137055 for related remarks.
>From 9dd987bca7baed28aabfa3662bfb76275ad781a1 Mon Sep 17 00:00:00 2001
From: Schrodinger ZHU Yifan <yifanzhu at rochester.edu>
Date: Wed, 23 Apr 2025 17:44:49 -0400
Subject: [PATCH 3/5] Update setjmp.cpp
---
libc/src/setjmp/x86_64/setjmp.cpp | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/libc/src/setjmp/x86_64/setjmp.cpp b/libc/src/setjmp/x86_64/setjmp.cpp
index b3f0207c2cfdd..7a052076092fb 100644
--- a/libc/src/setjmp/x86_64/setjmp.cpp
+++ b/libc/src/setjmp/x86_64/setjmp.cpp
@@ -7,9 +7,9 @@
//===----------------------------------------------------------------------===//
// We use naked functions to avoid compiler-generated prologue and epilogue.
-// Despite GCC documentation listing this as a supported case for extended asm, the
-// generated code is not wrong as we only pass in constant operands to
-// extended asm.
+// Despite GCC documentation listing this as a unsupported case for extended
+// asm, the generated code is not wrong as we only pass in constant operands
+// to extended asm.
// See https://github.com/llvm/llvm-project/issues/137055 for related remarks.
#include "hdr/offsetof_macros.h"
>From 15f97679f1dfc487bfbbcafeb2fe7eb8b883a913 Mon Sep 17 00:00:00 2001
From: Schrodinger ZHU Yifan <yifanzhu at rochester.edu>
Date: Wed, 23 Apr 2025 17:45:20 -0400
Subject: [PATCH 4/5] Update setjmp.cpp
---
libc/src/setjmp/x86_64/setjmp.cpp | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/libc/src/setjmp/x86_64/setjmp.cpp b/libc/src/setjmp/x86_64/setjmp.cpp
index 7a052076092fb..d24fbc5632ea7 100644
--- a/libc/src/setjmp/x86_64/setjmp.cpp
+++ b/libc/src/setjmp/x86_64/setjmp.cpp
@@ -7,7 +7,7 @@
//===----------------------------------------------------------------------===//
// We use naked functions to avoid compiler-generated prologue and epilogue.
-// Despite GCC documentation listing this as a unsupported case for extended
+// Despite GCC documentation listing this as an unsupported case for extended
// asm, the generated code is not wrong as we only pass in constant operands
// to extended asm.
// See https://github.com/llvm/llvm-project/issues/137055 for related remarks.
>From b2a03218a95cf000fc9719af4215a743bdc0faf1 Mon Sep 17 00:00:00 2001
From: Schrodinger ZHU Yifan <yifanzhu at rochester.edu>
Date: Wed, 30 Apr 2025 16:27:54 -0400
Subject: [PATCH 5/5] Update setjmp.cpp
---
libc/src/setjmp/x86_64/setjmp.cpp | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/libc/src/setjmp/x86_64/setjmp.cpp b/libc/src/setjmp/x86_64/setjmp.cpp
index d24fbc5632ea7..66d13166d4d46 100644
--- a/libc/src/setjmp/x86_64/setjmp.cpp
+++ b/libc/src/setjmp/x86_64/setjmp.cpp
@@ -7,8 +7,8 @@
//===----------------------------------------------------------------------===//
// We use naked functions to avoid compiler-generated prologue and epilogue.
-// Despite GCC documentation listing this as an unsupported case for extended
-// asm, the generated code is not wrong as we only pass in constant operands
+// Despite GCC documentation listing this as an unsupported case for extended
+// asm, the generated code is not wrong as we only pass in constant operands
// to extended asm.
// See https://github.com/llvm/llvm-project/issues/137055 for related remarks.
More information about the libc-commits
mailing list