diff options
author | Dean Michael Berris <dberris@google.com> | 2016-11-16 01:01:13 +0000 |
---|---|---|
committer | Dean Michael Berris <dberris@google.com> | 2016-11-16 01:01:13 +0000 |
commit | a1df33d42314dc8c52e3eb5254f0f216397e60fc (patch) | |
tree | 3170b1ed69ea95bca55af2ddfebef5da3fdf08a2 /lib/xray/xray_defs.h | |
parent | ec301129e76d82fbdf59168f7478b343cff71294 (diff) |
[XRay][compiler-rt] Disable XRay instrumentation of the XRay runtime.
Summary:
Adds a CMake check for whether the compiler used to build the XRay
library supports XRay-instrumentation. If the compiler we're using does
support the `-fxray-instrument` flag (i.e. recently-built Clang), we
define the XRAY_NEVER_INSTRUMENT macro that then makes sure that the
XRay runtime functions never get XRay-instrumented.
This prevents potential weirdness involved with building the XRay
library with a Clang that supports XRay-instrumentation, and is
attempting to XRay-instrument the build of compiler-rt.
Reviewers: majnemer, rSerge, echristo
Subscribers: mehdi_amini, llvm-commits, mgorny
Differential Revision: https://reviews.llvm.org/D26597
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@287068 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/xray/xray_defs.h')
-rw-r--r-- | lib/xray/xray_defs.h | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/lib/xray/xray_defs.h b/lib/xray/xray_defs.h new file mode 100644 index 000000000..e5c37c066 --- /dev/null +++ b/lib/xray/xray_defs.h @@ -0,0 +1,22 @@ +//===-- xray_defs.h ---------------------------------------------*- C++ -*-===// +// +// The LLVM Compiler Infrastructure +// +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// +// +// Common definitions useful for XRay sources. +// +//===----------------------------------------------------------------------===// +#ifndef XRAY_XRAY_DEFS_H +#define XRAY_XRAY_DEFS_H + +#if XRAY_SUPPORTED +#define XRAY_NEVER_INSTRUMENT __attribute__((xray_never_instrument)) +#else +#define XRAY_NEVER_INSTRUMENT +#endif + +#endif // XRAY_XRAY_DEFS_H |