diff options
author | Schrodinger ZHU Yifan <yifanzhu@rochester.edu> | 2025-04-29 16:37:25 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-04-29 16:37:25 -0400 |
commit | 9ebaa9d483740b1e9a796e9e3b40a2ab70a4efb5 (patch) | |
tree | 610965e1e1b6546ae88573ca4205b66cea88bb6d /clang/lib/CodeGen/CodeGenModule.cpp | |
parent | 1a6b0413e047a390dc7759b2ea558bad83e7f1cf (diff) | |
download | llvm-9ebaa9d483740b1e9a796e9e3b40a2ab70a4efb5.zip llvm-9ebaa9d483740b1e9a796e9e3b40a2ab70a4efb5.tar.gz llvm-9ebaa9d483740b1e9a796e9e3b40a2ab70a4efb5.tar.bz2 |
[libc] implement aarch64 sigsetjmp (#136706)
- **[libc][aarch64] implement sigsetjmp**
On top of https://github.com/llvm/llvm-project/pull/136072
See also https://github.com/llvm/llvm-project/issues/137055 for remarks
on naked attributes.
```c++
//===-- Implementation of setjmp ------------------------------------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
#include "src/setjmp/sigsetjmp.h"
#include "hdr/offsetof_macros.h"
#include "src/__support/common.h"
#include "src/__support/macros/config.h"
#include "src/setjmp/setjmp_impl.h"
#include "src/setjmp/sigsetjmp_epilogue.h"
namespace LIBC_NAMESPACE_DECL {
[[gnu::naked]]
LLVM_LIBC_FUNCTION(int, sigsetjmp, (sigjmp_buf, int)) {
asm(R"(
cbz w1, %c[setjmp]
str x30, [x0, %c[retaddr]]
str x19, [x0, %c[extra]]
mov x19, x0
bl %c[setjmp]
mov w1, w0
mov x0, x19
ldr x30, [x0, %c[retaddr]]
ldr x19, [x0, %c[extra]]
b %c[epilogue])" ::[retaddr] "i"(offsetof(__jmp_buf, sig_retaddr)),
[extra] "i"(offsetof(__jmp_buf, sig_extra)), [setjmp] "i"(setjmp),
[epilogue] "i"(sigsetjmp_epilogue)
: "x0", "x1", "x19", "x30");
}
} // namespace LIBC_NAMESPACE_DECL
```
Diffstat (limited to 'clang/lib/CodeGen/CodeGenModule.cpp')
0 files changed, 0 insertions, 0 deletions