[libc][NFC] Move aligned access implementations to separate header
[llvm-project.git] / libc / src / __support / macros / attributes.h
blob0c8a37b34e66aaa5dff1bc8d16000504cd0157a9
1 //===-- Portable attributes -------------------------------------*- 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-exception
6 //
7 //===----------------------------------------------------------------------===//
8 // This header file defines macros for declaring attributes for functions,
9 // types, and variables.
11 // These macros are used within llvm-libc and allow the compiler to optimize,
12 // where applicable, certain function calls.
14 // Most macros here are exposing GCC or Clang features, and are stubbed out for
15 // other compilers.
17 #ifndef LLVM_LIBC_SUPPORT_MACROS_ATTRIBUTES_H
18 #define LLVM_LIBC_SUPPORT_MACROS_ATTRIBUTES_H
20 #include "properties/architectures.h"
22 #define LIBC_INLINE inline
23 #define LIBC_INLINE_VAR inline
24 #define LIBC_INLINE_ASM __asm__ __volatile__
25 #define LIBC_UNUSED __attribute__((unused))
27 #ifdef LIBC_TARGET_ARCH_IS_GPU
28 #define LIBC_THREAD_LOCAL
29 #else
30 #define LIBC_THREAD_LOCAL thread_local
31 #endif
33 #endif // LLVM_LIBC_SUPPORT_MACROS_ATTRIBUTES_H