1//===-- xray_defs.h ---------------------------------------------*- C++ -*-===//
2//
3//                     The LLVM Compiler Infrastructure
4//
5// This file is distributed under the University of Illinois Open Source
6// License. See LICENSE.TXT for details.
7//
8//===----------------------------------------------------------------------===//
9//
10// Common definitions useful for XRay sources.
11//
12//===----------------------------------------------------------------------===//
13#ifndef XRAY_XRAY_DEFS_H
14#define XRAY_XRAY_DEFS_H
15
16#if XRAY_SUPPORTED
17#define XRAY_NEVER_INSTRUMENT __attribute__((xray_never_instrument))
18#else
19#define XRAY_NEVER_INSTRUMENT
20#endif
21
22#if SANITIZER_NETBSD
23// NetBSD: thread_local is not aligned properly, and the code relying
24// on it segfaults
25#define XRAY_TLS_ALIGNAS(x)
26#define XRAY_HAS_TLS_ALIGNAS 0
27#else
28#define XRAY_TLS_ALIGNAS(x) alignas(x)
29#define XRAY_HAS_TLS_ALIGNAS 1
30#endif
31
32#endif  // XRAY_XRAY_DEFS_H
33