Skip to content

Commit

Permalink
[driver][xray] fix the macOS support checker by supporting -macos
Browse files Browse the repository at this point in the history
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
  • Loading branch information
hyp committed Aug 27, 2019
1 parent 3b1b56d commit 3737c02
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion clang/lib/Driver/XRayArgs.cpp
Expand Up @@ -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());
Expand Down
4 changes: 4 additions & 0 deletions 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;

0 comments on commit 3737c02

Please sign in to comment.