[Xray] Darwin - Enable in the driver side

Reviewers: dberris

Reviered By: dberris

Differential Revision: https://reviews.llvm.org/D51269


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@340712 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
David Carlier 2018-08-27 05:16:09 +00:00
parent 8476a32dc7
commit 37975d5918
5 changed files with 12 additions and 3 deletions

View File

@ -1105,6 +1105,13 @@ void DarwinClang::AddLinkRuntimeLibArgs(const ArgList &Args,
if (Sanitize.needsEsanRt())
AddLinkSanitizerLibArgs(Args, CmdArgs, "esan");
const XRayArgs &XRay = getXRayArgs();
if (XRay.needsXRayRt()) {
AddLinkRuntimeLib(Args, CmdArgs, "xray");
AddLinkRuntimeLib(Args, CmdArgs, "xray-basic");
AddLinkRuntimeLib(Args, CmdArgs, "xray-fdr");
}
// Otherwise link libSystem, then the dynamic runtime library, and finally any
// target specific static runtime library.
CmdArgs.push_back("-lSystem");

View File

@ -11,6 +11,7 @@
#define LLVM_CLANG_LIB_DRIVER_TOOLCHAINS_DARWIN_H
#include "Cuda.h"
#include "clang/Driver/XRayArgs.h"
#include "clang/Driver/Tool.h"
#include "clang/Driver/ToolChain.h"

View File

@ -52,7 +52,8 @@ XRayArgs::XRayArgs(const ToolChain &TC, const ArgList &Args) {
}
} else if (Triple.getOS() == llvm::Triple::FreeBSD ||
Triple.getOS() == llvm::Triple::OpenBSD ||
Triple.getOS() == llvm::Triple::NetBSD) {
Triple.getOS() == llvm::Triple::NetBSD ||
Triple.getOS() == llvm::Triple::Darwin) {
if (Triple.getArch() != llvm::Triple::x86_64) {
D.Diag(diag::err_drv_clang_unsupported)
<< (std::string(XRayInstrumentOption) + " on " + Triple.str());

View File

@ -10,7 +10,7 @@ supported_targets = [
# Only on platforms we support.
supported_oses = [
'Linux', 'FreeBSD'
'Linux', 'FreeBSD', 'Darwin'
]
triple_set = set(target_triple_components)

View File

@ -1,4 +1,4 @@
// RUN: not %clang -o /dev/null -v -fxray-instrument -c %s
// XFAIL: -linux-, -freebsd
// XFAIL: -linux-, -freebsd, -darwin
// REQUIRES-ANY: amd64, x86_64, x86_64h, arm, aarch64, arm64
typedef int a;