[PATCH] D145849: [Driver][xray] Allow XRay on Apple Silicon

Fangrui Song via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Jun 20 20:47:39 PDT 2023


This revision was automatically updated to reflect the committed changes.
Closed by commit rGd5bebb3fb402: [Driver] Allow XRay on Apple Silicon (authored by ilammy, committed by MaskRay).

Changed prior to commit:
  https://reviews.llvm.org/D145849?vs=530285&id=533116#toc

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D145849/new/

https://reviews.llvm.org/D145849

Files:
  clang/lib/Driver/XRayArgs.cpp
  clang/test/Driver/XRay/xray-instrument.c


Index: clang/test/Driver/XRay/xray-instrument.c
===================================================================
--- clang/test/Driver/XRay/xray-instrument.c
+++ clang/test/Driver/XRay/xray-instrument.c
@@ -1,4 +1,5 @@
 // RUN: %clang -### --target=aarch64-pc-freebsd -fxray-instrument -c %s -o /dev/null 2>&1 | FileCheck %s
+// RUN: %clang -### --target=arm64-apple-macos -fxray-instrument -c %s -o /dev/null 2>&1 | FileCheck %s
 // RUN: %clang -### --target=x86_64-apple-darwin -fxray-instrument -c %s -o /dev/null 2>&1 | FileCheck %s
 // RUN: %clang -### --target=x86_64-pc-windows -fxray-instrument -c %s -o /dev/null 2>&1 | FileCheck %s --check-prefix=ERR
 
Index: clang/lib/Driver/XRayArgs.cpp
===================================================================
--- clang/lib/Driver/XRayArgs.cpp
+++ clang/lib/Driver/XRayArgs.cpp
@@ -32,9 +32,14 @@
     return;
   XRayInstrument = Args.getLastArg(options::OPT_fxray_instrument);
   if (Triple.isMacOSX()) {
-    if (Triple.getArch() != llvm::Triple::x86_64) {
+    switch (Triple.getArch()) {
+    case llvm::Triple::aarch64:
+    case llvm::Triple::x86_64:
+      break;
+    default:
       D.Diag(diag::err_drv_unsupported_opt_for_target)
           << XRayInstrument->getSpelling() << Triple.str();
+      break;
     }
   } else if (Triple.isOSBinFormatELF()) {
     switch (Triple.getArch()) {


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D145849.533116.patch
Type: text/x-patch
Size: 1360 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20230621/3561a4c3/attachment-0001.bin>


More information about the cfe-commits mailing list