[libc-commits] [libc] 8023375 - [libc][NFC] add remarks to the setjmp implementation (#137066)
via libc-commits
libc-commits at lists.llvm.org
Thu May 1 07:41:40 PDT 2025
Author: Schrodinger ZHU Yifan
Date: 2025-05-01T10:41:33-04:00
New Revision: 80233751f9f3c9c8c5b1d66cd93399615f4d3ba2
URL: https://github.com/llvm/llvm-project/commit/80233751f9f3c9c8c5b1d66cd93399615f4d3ba2
DIFF: https://github.com/llvm/llvm-project/commit/80233751f9f3c9c8c5b1d66cd93399615f4d3ba2.diff
LOG: [libc][NFC] add remarks to the setjmp implementation (#137066)
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 https://github.com/llvm/llvm-project/issues/137055 for related
remarks.
---------
Co-authored-by: Copilot <175728472+Copilot at users.noreply.github.com>
Added:
Modified:
libc/src/setjmp/x86_64/setjmp.cpp
Removed:
################################################################################
diff --git a/libc/src/setjmp/x86_64/setjmp.cpp b/libc/src/setjmp/x86_64/setjmp.cpp
index 28e52712c785d..66d13166d4d46 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 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.
+
#include "hdr/offsetof_macros.h"
#include "src/__support/common.h"
#include "src/__support/macros/config.h"
More information about the libc-commits
mailing list