Run DCE after a LoopFlatten test to reduce spurious output [nfc]
[llvm-project.git] / libc / include / __llvm-libc-common.h
blob6b883ee21a8c49ac8c83de46e6e974513fb9a41c
1 //===-- Common definitions for LLVM-libc public header files --------------===//
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-exception
6 //
7 //===----------------------------------------------------------------------===//
9 #ifndef LLVM_LIBC___COMMON_H
10 #define LLVM_LIBC___COMMON_H
12 #ifdef __cplusplus
14 #undef __BEGIN_C_DECLS
15 #define __BEGIN_C_DECLS extern "C" {
17 #undef __END_C_DECLS
18 #define __END_C_DECLS }
20 #undef _Noreturn
21 #define _Noreturn [[noreturn]]
23 #undef _Alignas
24 #define _Alignas alignas
26 #undef _Static_assert
27 #define _Static_assert static_assert
29 #undef _Alignof
30 #define _Alignof alignof
32 #undef _Thread_local
33 #define _Thread_local thread_local
35 #undef __NOEXCEPT
36 #define __NOEXCEPT noexcept
38 #else // not __cplusplus
40 #undef __BEGIN_C_DECLS
41 #define __BEGIN_C_DECLS
43 #undef __END_C_DECLS
44 #define __END_C_DECLS
46 #undef __restrict
47 #define __restrict restrict // C99 and above support the restrict keyword.
49 #undef __NOEXCEPT
50 #define __NOEXCEPT
52 #endif // __cplusplus
54 #endif // LLVM_LIBC___COMMON_H