-
Notifications
You must be signed in to change notification settings - Fork 13.4k
[libc][NFC] add remarks to the setjmp implementation #137066
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This pull request adds clarifying remarks to the x86_64 setjmp implementation, explaining the use of naked functions and linking to a related LLVM issue.
- Added detailed comments explaining the rationale for using naked functions.
- Provided a reference to the LLVM issue for additional context.
@llvm/pr-subscribers-libc Author: Schrodinger ZHU Yifan (SchrodingerZhu) ChangesWe 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 #137055 for related remarks. Full diff: https://github.com/llvm/llvm-project/pull/137066.diff 1 Files Affected:
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"
|
Co-authored-by: Copilot <[email protected]>
✅ With the latest revision this PR passed the C/C++ code formatter. |
Merge directly as the change is trivial |
LGTM. |
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 to extended asm. See llvm#137055 for related remarks. --------- Co-authored-by: Copilot <[email protected]>
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 to extended asm. See llvm#137055 for related remarks. --------- Co-authored-by: Copilot <[email protected]>
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 to extended asm. See llvm#137055 for related remarks. --------- Co-authored-by: Copilot <[email protected]>
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 to extended asm. See llvm#137055 for related remarks. --------- Co-authored-by: Copilot <[email protected]>
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 to extended asm.
See #137055 for related remarks.