r340712 - [Xray] Darwin - Enable in the driver side

David Carlier via cfe-commits cfe-commits at lists.llvm.org
Sun Aug 26 22:16:09 PDT 2018


Author: devnexen
Date: Sun Aug 26 22:16:09 2018
New Revision: 340712

URL: http://llvm.org/viewvc/llvm-project?rev=340712&view=rev
Log:
[Xray] Darwin - Enable in the driver side

Reviewers: dberris

Reviered By: dberris

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

Modified:
    cfe/trunk/lib/Driver/ToolChains/Darwin.cpp
    cfe/trunk/lib/Driver/ToolChains/Darwin.h
    cfe/trunk/lib/Driver/XRayArgs.cpp
    cfe/trunk/test/Driver/XRay/lit.local.cfg
    cfe/trunk/test/Driver/XRay/xray-instrument-os.c

Modified: cfe/trunk/lib/Driver/ToolChains/Darwin.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/ToolChains/Darwin.cpp?rev=340712&r1=340711&r2=340712&view=diff
==============================================================================
--- cfe/trunk/lib/Driver/ToolChains/Darwin.cpp (original)
+++ cfe/trunk/lib/Driver/ToolChains/Darwin.cpp Sun Aug 26 22:16:09 2018
@@ -1105,6 +1105,13 @@ void DarwinClang::AddLinkRuntimeLibArgs(
   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");

Modified: cfe/trunk/lib/Driver/ToolChains/Darwin.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/ToolChains/Darwin.h?rev=340712&r1=340711&r2=340712&view=diff
==============================================================================
--- cfe/trunk/lib/Driver/ToolChains/Darwin.h (original)
+++ cfe/trunk/lib/Driver/ToolChains/Darwin.h Sun Aug 26 22:16:09 2018
@@ -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"
 

Modified: cfe/trunk/lib/Driver/XRayArgs.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/XRayArgs.cpp?rev=340712&r1=340711&r2=340712&view=diff
==============================================================================
--- cfe/trunk/lib/Driver/XRayArgs.cpp (original)
+++ cfe/trunk/lib/Driver/XRayArgs.cpp Sun Aug 26 22:16:09 2018
@@ -52,7 +52,8 @@ XRayArgs::XRayArgs(const ToolChain &TC,
       }
     } 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());

Modified: cfe/trunk/test/Driver/XRay/lit.local.cfg
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/XRay/lit.local.cfg?rev=340712&r1=340711&r2=340712&view=diff
==============================================================================
--- cfe/trunk/test/Driver/XRay/lit.local.cfg (original)
+++ cfe/trunk/test/Driver/XRay/lit.local.cfg Sun Aug 26 22:16:09 2018
@@ -10,7 +10,7 @@ supported_targets = [
 
 # Only on platforms we support.
 supported_oses = [
-    'Linux', 'FreeBSD'
+    'Linux', 'FreeBSD', 'Darwin'
 ]
 
 triple_set = set(target_triple_components)

Modified: cfe/trunk/test/Driver/XRay/xray-instrument-os.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/XRay/xray-instrument-os.c?rev=340712&r1=340711&r2=340712&view=diff
==============================================================================
--- cfe/trunk/test/Driver/XRay/xray-instrument-os.c (original)
+++ cfe/trunk/test/Driver/XRay/xray-instrument-os.c Sun Aug 26 22:16:09 2018
@@ -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;




More information about the cfe-commits mailing list