r370093 - [driver][xray] fix the macOS support checker by supporting -macos
Alex Lorenz via cfe-commits
cfe-commits at lists.llvm.org
Tue Aug 27 11:26:36 PDT 2019
Author: arphaman
Date: Tue Aug 27 11:26:36 2019
New Revision: 370093
URL: http://llvm.org/viewvc/llvm-project?rev=370093&view=rev
Log:
[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
Added:
cfe/trunk/test/Driver/XRay/xray-instrument-macos.c
Modified:
cfe/trunk/lib/Driver/XRayArgs.cpp
Modified: cfe/trunk/lib/Driver/XRayArgs.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/XRayArgs.cpp?rev=370093&r1=370092&r2=370093&view=diff
==============================================================================
--- cfe/trunk/lib/Driver/XRayArgs.cpp (original)
+++ cfe/trunk/lib/Driver/XRayArgs.cpp Tue Aug 27 11:26:36 2019
@@ -52,7 +52,7 @@ XRayArgs::XRayArgs(const ToolChain &TC,
} 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());
Added: cfe/trunk/test/Driver/XRay/xray-instrument-macos.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/XRay/xray-instrument-macos.c?rev=370093&view=auto
==============================================================================
--- cfe/trunk/test/Driver/XRay/xray-instrument-macos.c (added)
+++ cfe/trunk/test/Driver/XRay/xray-instrument-macos.c Tue Aug 27 11:26:36 2019
@@ -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;
More information about the cfe-commits
mailing list