Path: blob/main/system/lib/llvm-libc/src/setjmp/longjmp.h
6172 views
//===-- Implementation header for longjmp -----------------------*- C++ -*-===//1//2// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.3// See https://llvm.org/LICENSE.txt for license information.4// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception5//6//===----------------------------------------------------------------------===//78#ifndef LLVM_LIBC_SRC_SETJMP_LONGJMP_H9#define LLVM_LIBC_SRC_SETJMP_LONGJMP_H1011#include "hdr/types/jmp_buf.h"12#include "src/__support/macros/config.h"13#include "src/__support/macros/properties/compiler.h"1415namespace LIBC_NAMESPACE_DECL {1617// TODO(https://github.com/llvm/llvm-project/issues/112427)18// Some of the architecture-specific definitions are marked `naked`, which in19// GCC implies `nothrow`.20//21// Right now, our aliases aren't marked `nothrow`, so we wind up in a situation22// where clang will emit -Wmissing-exception-spec if we add `nothrow` here, but23// GCC will emit -Wmissing-attributes here without `nothrow`. We need to update24// LLVM_LIBC_FUNCTION to denote when a function throws or not.2526#ifdef LIBC_COMPILER_IS_GCC27[[gnu::nothrow]]28#endif29void longjmp(jmp_buf buf, int val);3031} // namespace LIBC_NAMESPACE_DECL3233#endif // LLVM_LIBC_SRC_SETJMP_LONGJMP_H343536