[PATCH] D51269: [Xray] Enable in the driver side
David CARLIER via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Sun Aug 26 09:35:48 PDT 2018
devnexen created this revision.
devnexen added a reviewer: dberris.
devnexen created this object with visibility "All Users".
Herald added a subscriber: cfe-commits.
Repository:
rC Clang
https://reviews.llvm.org/D51269
Files:
lib/Driver/ToolChains/Darwin.cpp
lib/Driver/ToolChains/Darwin.h
lib/Driver/XRayArgs.cpp
Index: lib/Driver/XRayArgs.cpp
===================================================================
--- lib/Driver/XRayArgs.cpp
+++ lib/Driver/XRayArgs.cpp
@@ -52,7 +52,8 @@
}
} 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());
Index: lib/Driver/ToolChains/Darwin.h
===================================================================
--- lib/Driver/ToolChains/Darwin.h
+++ lib/Driver/ToolChains/Darwin.h
@@ -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"
Index: lib/Driver/ToolChains/Darwin.cpp
===================================================================
--- lib/Driver/ToolChains/Darwin.cpp
+++ lib/Driver/ToolChains/Darwin.cpp
@@ -1105,6 +1105,13 @@
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");
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D51269.162583.patch
Type: text/x-patch
Size: 1709 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20180826/43f7428b/attachment.bin>
More information about the cfe-commits
mailing list