brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.2 KiB · 9b7db29 Raw
35 lines · c
1//===-- Implementation header for longjmp -----------------------*- C++ -*-===//2//3// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.4// See https://llvm.org/LICENSE.txt for license information.5// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception6//7//===----------------------------------------------------------------------===//8 9#ifndef LLVM_LIBC_SRC_SETJMP_LONGJMP_H10#define LLVM_LIBC_SRC_SETJMP_LONGJMP_H11 12#include "hdr/types/jmp_buf.h"13#include "src/__support/macros/config.h"14#include "src/__support/macros/properties/compiler.h"15 16namespace LIBC_NAMESPACE_DECL {17 18// TODO(https://github.com/llvm/llvm-project/issues/112427)19// Some of the architecture-specific definitions are marked `naked`, which in20// GCC implies `nothrow`.21//22// Right now, our aliases aren't marked `nothrow`, so we wind up in a situation23// where clang will emit -Wmissing-exception-spec if we add `nothrow` here, but24// GCC will emit -Wmissing-attributes here without `nothrow`. We need to update25// LLVM_LIBC_FUNCTION to denote when a function throws or not.26 27#ifdef LIBC_COMPILER_IS_GCC28[[gnu::nothrow]]29#endif30void longjmp(jmp_buf buf, int val);31 32} // namespace LIBC_NAMESPACE_DECL33 34#endif // LLVM_LIBC_SRC_SETJMP_LONGJMP_H35