summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlex Lorenz <arphaman@gmail.com>2019-08-27 18:26:36 +0000
committerAlex Lorenz <arphaman@gmail.com>2019-08-27 18:26:36 +0000
commit3737c0239a58803c37b234a2ecbfd5e2e7ac65d8 (patch)
tree3207d9b23c02e99f54fb6a72756170bff1d3f9c3
parent3b1b56d3fb9e7141d8d9cc331f2b3bcfa2039b20 (diff)
downloadbcm5719-llvm-3737c0239a58803c37b234a2ecbfd5e2e7ac65d8.tar.gz
bcm5719-llvm-3737c0239a58803c37b234a2ecbfd5e2e7ac65d8.zip
[driver][xray] fix the macOS support checker by supporting -macos
triple in addition to -darwin The previous check incorrectly checked for macOS support by allowing -darwin triples only, and -macos triple was not supported. Differential Revision: https://reviews.llvm.org/D61758 llvm-svn: 370093
-rw-r--r--clang/lib/Driver/XRayArgs.cpp2
-rw-r--r--clang/test/Driver/XRay/xray-instrument-macos.c4
2 files changed, 5 insertions, 1 deletions
diff --git a/clang/lib/Driver/XRayArgs.cpp b/clang/lib/Driver/XRayArgs.cpp
index 45ef96e12b3..16e7c7ecf36 100644
--- a/clang/lib/Driver/XRayArgs.cpp
+++ b/clang/lib/Driver/XRayArgs.cpp
@@ -52,7 +52,7 @@ XRayArgs::XRayArgs(const ToolChain &TC, const ArgList &Args) {
} else if (Triple.isOSFreeBSD() ||
Triple.isOSOpenBSD() ||
Triple.isOSNetBSD() ||
- Triple.getOS() == llvm::Triple::Darwin) {
+ Triple.isMacOSX()) {
if (Triple.getArch() != llvm::Triple::x86_64) {
D.Diag(diag::err_drv_clang_unsupported)
<< (std::string(XRayInstrumentOption) + " on " + Triple.str());
diff --git a/clang/test/Driver/XRay/xray-instrument-macos.c b/clang/test/Driver/XRay/xray-instrument-macos.c
new file mode 100644
index 00000000000..afccc625832
--- /dev/null
+++ b/clang/test/Driver/XRay/xray-instrument-macos.c
@@ -0,0 +1,4 @@
+// RUN: %clang -o /dev/null -v -fxray-instrument -target x86_64-apple-macos10.11 -c %s
+// RUN: %clang -o /dev/null -v -fxray-instrument -target x86_64-apple-darwin15 -c %s
+// REQUIRES-ANY: x86_64, x86_64h
+typedef int a;
OpenPOWER on IntegriCloud