1 //===-- gwp_asan_definitions.h ----------------------------------*- 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 
9 #ifndef GWP_ASAN_DEFINITIONS_H_
10 #define GWP_ASAN_DEFINITIONS_H_
11 
12 #define TLS_INITIAL_EXEC __thread __attribute__((tls_model("initial-exec")))
13 
14 #ifdef LIKELY
15 # undef LIKELY
16 #endif // defined(LIKELY)
17 #define LIKELY(X) __builtin_expect(!!(X), 1)
18 
19 #ifdef UNLIKELY
20 # undef UNLIKELY
21 #endif // defined(UNLIKELY)
22 #define UNLIKELY(X) __builtin_expect(!!(X), 0)
23 
24 #ifdef ALWAYS_INLINE
25 # undef ALWAYS_INLINE
26 #endif // defined(ALWAYS_INLINE)
27 #define ALWAYS_INLINE inline __attribute__((always_inline))
28 
29 #endif // GWP_ASAN_DEFINITIONS_H_
30