[clang] [clang] Extend define-target-os-macros to support XROS. (PR #82833)

2024-02-27 Thread via cfe-commits

github-actions[bot] wrote:



@rohit-rao Congratulations on having your first Pull Request (PR) merged into 
the LLVM Project!

Your changes will be combined with recent changes from other authors, then 
tested
by our [build bots](https://lab.llvm.org/buildbot/). If there is a problem with 
a build, you may recieve a report in an email or a comment on this PR.

Please check whether problems have been caused by your change specifically, as
the builds can include changes from many authors. It is not uncommon for your
change to be included in a build that fails due to someone else's changes, or
infrastructure issues.

How to do this, and the rest of the post-merge process, is covered in detail 
[here](https://llvm.org/docs/MyFirstTypoFix.html#myfirsttypofix-issues-after-landing-your-pr).

If your change does cause a problem, it may be reverted, or you can revert it 
yourself.
This is a normal part of [LLVM 
development](https://llvm.org/docs/DeveloperPolicy.html#patch-reversion-policy).
 You can fix your changes and open a new PR to merge them again.

If you don't get any reports, no action is required from you. Your changes are 
working as expected, well done!


https://github.com/llvm/llvm-project/pull/82833
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] [clang] Extend define-target-os-macros to support XROS. (PR #82833)

2024-02-27 Thread Leonard Grey via cfe-commits

https://github.com/speednoisemovement closed 
https://github.com/llvm/llvm-project/pull/82833
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] [clang] Extend define-target-os-macros to support XROS. (PR #82833)

2024-02-27 Thread Zixu Wang via cfe-commits

https://github.com/zixu-w approved this pull request.

LGTM. Thanks for making the change!

https://github.com/llvm/llvm-project/pull/82833
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] [clang] Extend define-target-os-macros to support XROS. (PR #82833)

2024-02-23 Thread via cfe-commits

rohit-rao wrote:

@zixu-w please take a look if you have a minute, thanks!

https://github.com/llvm/llvm-project/pull/82833
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] [clang] Extend define-target-os-macros to support XROS. (PR #82833)

2024-02-23 Thread via cfe-commits

llvmbot wrote:




@llvm/pr-subscribers-clang-driver

Author: None (rohit-rao)


Changes

Updates the extension feature `define-target-os-macros` to support the 
recently-added XROS target (TARGET_OS_VISION).

---
Full diff: https://github.com/llvm/llvm-project/pull/82833.diff


2 Files Affected:

- (modified) clang/include/clang/Basic/TargetOSMacros.def (+3-2) 
- (modified) clang/test/Driver/fdefine-target-os-macros.c (+46) 


``diff
diff --git a/clang/include/clang/Basic/TargetOSMacros.def 
b/clang/include/clang/Basic/TargetOSMacros.def
index dfc2e033f6fd0d..58dce330f9c8fd 100644
--- a/clang/include/clang/Basic/TargetOSMacros.def
+++ b/clang/include/clang/Basic/TargetOSMacros.def
@@ -34,18 +34,19 @@ TARGET_OS(TARGET_OS_UNIX, Triple.isOSNetBSD() ||
 TARGET_OS(TARGET_OS_MAC, Triple.isOSDarwin())
 TARGET_OS(TARGET_OS_OSX, Triple.isMacOSX())
 TARGET_OS(TARGET_OS_IPHONE, Triple.isiOS() || Triple.isTvOS() ||
-Triple.isWatchOS())
+Triple.isWatchOS() || Triple.isXROS())
 // Triple::isiOS() also includes tvOS
 TARGET_OS(TARGET_OS_IOS, Triple.getOS() == llvm::Triple::IOS)
 TARGET_OS(TARGET_OS_TV, Triple.isTvOS())
 TARGET_OS(TARGET_OS_WATCH, Triple.isWatchOS())
+TARGET_OS(TARGET_OS_VISION, Triple.isXROS())
 TARGET_OS(TARGET_OS_DRIVERKIT, Triple.isDriverKit())
 TARGET_OS(TARGET_OS_MACCATALYST, Triple.isMacCatalystEnvironment())
 TARGET_OS(TARGET_OS_SIMULATOR, Triple.isSimulatorEnvironment())
 
 // Deprecated Apple target conditionals.
 TARGET_OS(TARGET_OS_EMBEDDED, (Triple.isiOS() || Triple.isTvOS() \
-   || Triple.isWatchOS()) \
+   || Triple.isWatchOS() || Triple.isXROS()) \
&& !Triple.isMacCatalystEnvironment() \
&& !Triple.isSimulatorEnvironment())
 TARGET_OS(TARGET_OS_NANO, Triple.isWatchOS())
diff --git a/clang/test/Driver/fdefine-target-os-macros.c 
b/clang/test/Driver/fdefine-target-os-macros.c
index d7379dd3d5396b..a4de51e8e7244b 100644
--- a/clang/test/Driver/fdefine-target-os-macros.c
+++ b/clang/test/Driver/fdefine-target-os-macros.c
@@ -12,6 +12,7 @@
 // RUN:-DIOS=0 \
 // RUN:-DTV=0  \
 // RUN:-DWATCH=0   \
+// RUN:-DVISION=0  \
 // RUN:-DDRIVERKIT=0   \
 // RUN:-DMACCATALYST=0 \
 // RUN:-DEMBEDDED=0\
@@ -27,6 +28,7 @@
 // RUN:-DIOS=1 \
 // RUN:-DTV=0  \
 // RUN:-DWATCH=0   \
+// RUN:-DVISION=0  \
 // RUN:-DDRIVERKIT=0   \
 // RUN:-DMACCATALYST=0 \
 // RUN:-DEMBEDDED=1\
@@ -42,6 +44,7 @@
 // RUN:-DIOS=1 \
 // RUN:-DTV=0  \
 // RUN:-DWATCH=0   \
+// RUN:-DVISION=0  \
 // RUN:-DDRIVERKIT=0   \
 // RUN:-DMACCATALYST=1 \
 // RUN:-DEMBEDDED=0\
@@ -57,6 +60,7 @@
 // RUN:-DIOS=1 \
 // RUN:-DTV=0  \
 // RUN:-DWATCH=0   \
+// RUN:-DVISION=0  \
 // RUN:-DDRIVERKIT=0   \
 // RUN:-DMACCATALYST=0 \
 // RUN:-DEMBEDDED=0\
@@ -72,6 +76,7 @@
 // RUN:-DIOS=0 \
 // RUN:-DTV=1  \
 // RUN:-DWATCH=0   \
+// RUN:-DVISION=0  \
 // RUN:-DDRIVERKIT=0   \
 // RUN:-DMACCATALYST=0 \
 // RUN:-DEMBEDDED=1\
@@ -87,6 +92,7 @@
 // RUN:-DIOS=0 \
 // RUN:-DTV=1  \
 // RUN:-DWATCH=0   \
+// RUN:-DVISION=0  \
 // RUN:-DDRIVERKIT=0   \
 // RUN:-DMACCATALYST=0 \
 // RUN:-DEMBEDDED=0\
@@ -102,6 +108,7 @@
 // RUN:-DIOS=0 \
 // RUN:-DTV=0  \
 // RUN:-DWATCH=1   \
+// RUN:-DVISION=0  \
 // RUN:-DDRIVERKIT=0   \
 // RUN:-DMACCATALYST=0 \
 // RUN:-DEMBEDDED=1\
@@ -117,6 +124,39 @@
 // RUN:-DIOS=0 \
 // RUN:-DTV=0  \
 // RUN:-DWATCH=1   \
+// RUN:-DVISION=0  \
+// RUN:-DDRIVERKIT=0   \
+// RUN:-DMACCATALYST=0 \
+// RUN:-DEMBEDDED=0\
+// RUN:-DSIMULATOR=1   \
+// RUN:-DWINDOWS=0 \
+// RUN:-DLINUX=0   \
+// RUN:-DUNIX=0
+
+// RUN: %clang -dM -E --target=arm64-apple-xros %s 2>&1 \
+// RUN: | FileCheck %s -DMAC=1 \
+// RUN:-DOSX=0 \
+// RUN:-DIPHONE=1 

[clang] [clang] Extend define-target-os-macros to support XROS. (PR #82833)

2024-02-23 Thread via cfe-commits

github-actions[bot] wrote:



Thank you for submitting a Pull Request (PR) to the LLVM Project!

This PR will be automatically labeled and the relevant teams will be
notified.

If you wish to, you can add reviewers by using the "Reviewers" section on this 
page.

If this is not working for you, it is probably because you do not have write
permissions for the repository. In which case you can instead tag reviewers by
name in a comment by using `@` followed by their GitHub username.

If you have received no comments on your PR for a week, you can request a review
by "ping"ing the PR by adding a comment “Ping”. The common courtesy "ping" rate
is once a week. Please remember that you are asking for valuable time from 
other developers.

If you have further questions, they may be answered by the [LLVM GitHub User 
Guide](https://llvm.org/docs/GitHub.html).

You can also ask questions in a comment on this PR, on the [LLVM 
Discord](https://discord.com/invite/xS7Z362) or on the 
[forums](https://discourse.llvm.org/).

https://github.com/llvm/llvm-project/pull/82833
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] [clang] Extend define-target-os-macros to support XROS. (PR #82833)

2024-02-23 Thread via cfe-commits

https://github.com/rohit-rao created 
https://github.com/llvm/llvm-project/pull/82833

Updates the extension feature `define-target-os-macros` to support the 
recently-added XROS target (TARGET_OS_VISION).

>From 48ab8968ea279aab03f64c657656254ededb374e Mon Sep 17 00:00:00 2001
From: Rohit Rao 
Date: Fri, 23 Feb 2024 16:17:54 -0500
Subject: [PATCH] [clang] Extend define-target-os-macros to support XROS.

Updates the extension feature `define-target-os-macros` to support the
recently-added XROS target (TARGET_OS_VISION).
---
 clang/include/clang/Basic/TargetOSMacros.def |  5 ++-
 clang/test/Driver/fdefine-target-os-macros.c | 46 
 2 files changed, 49 insertions(+), 2 deletions(-)

diff --git a/clang/include/clang/Basic/TargetOSMacros.def 
b/clang/include/clang/Basic/TargetOSMacros.def
index dfc2e033f6fd0d..58dce330f9c8fd 100644
--- a/clang/include/clang/Basic/TargetOSMacros.def
+++ b/clang/include/clang/Basic/TargetOSMacros.def
@@ -34,18 +34,19 @@ TARGET_OS(TARGET_OS_UNIX, Triple.isOSNetBSD() ||
 TARGET_OS(TARGET_OS_MAC, Triple.isOSDarwin())
 TARGET_OS(TARGET_OS_OSX, Triple.isMacOSX())
 TARGET_OS(TARGET_OS_IPHONE, Triple.isiOS() || Triple.isTvOS() ||
-Triple.isWatchOS())
+Triple.isWatchOS() || Triple.isXROS())
 // Triple::isiOS() also includes tvOS
 TARGET_OS(TARGET_OS_IOS, Triple.getOS() == llvm::Triple::IOS)
 TARGET_OS(TARGET_OS_TV, Triple.isTvOS())
 TARGET_OS(TARGET_OS_WATCH, Triple.isWatchOS())
+TARGET_OS(TARGET_OS_VISION, Triple.isXROS())
 TARGET_OS(TARGET_OS_DRIVERKIT, Triple.isDriverKit())
 TARGET_OS(TARGET_OS_MACCATALYST, Triple.isMacCatalystEnvironment())
 TARGET_OS(TARGET_OS_SIMULATOR, Triple.isSimulatorEnvironment())
 
 // Deprecated Apple target conditionals.
 TARGET_OS(TARGET_OS_EMBEDDED, (Triple.isiOS() || Triple.isTvOS() \
-   || Triple.isWatchOS()) \
+   || Triple.isWatchOS() || Triple.isXROS()) \
&& !Triple.isMacCatalystEnvironment() \
&& !Triple.isSimulatorEnvironment())
 TARGET_OS(TARGET_OS_NANO, Triple.isWatchOS())
diff --git a/clang/test/Driver/fdefine-target-os-macros.c 
b/clang/test/Driver/fdefine-target-os-macros.c
index d7379dd3d5396b..a4de51e8e7244b 100644
--- a/clang/test/Driver/fdefine-target-os-macros.c
+++ b/clang/test/Driver/fdefine-target-os-macros.c
@@ -12,6 +12,7 @@
 // RUN:-DIOS=0 \
 // RUN:-DTV=0  \
 // RUN:-DWATCH=0   \
+// RUN:-DVISION=0  \
 // RUN:-DDRIVERKIT=0   \
 // RUN:-DMACCATALYST=0 \
 // RUN:-DEMBEDDED=0\
@@ -27,6 +28,7 @@
 // RUN:-DIOS=1 \
 // RUN:-DTV=0  \
 // RUN:-DWATCH=0   \
+// RUN:-DVISION=0  \
 // RUN:-DDRIVERKIT=0   \
 // RUN:-DMACCATALYST=0 \
 // RUN:-DEMBEDDED=1\
@@ -42,6 +44,7 @@
 // RUN:-DIOS=1 \
 // RUN:-DTV=0  \
 // RUN:-DWATCH=0   \
+// RUN:-DVISION=0  \
 // RUN:-DDRIVERKIT=0   \
 // RUN:-DMACCATALYST=1 \
 // RUN:-DEMBEDDED=0\
@@ -57,6 +60,7 @@
 // RUN:-DIOS=1 \
 // RUN:-DTV=0  \
 // RUN:-DWATCH=0   \
+// RUN:-DVISION=0  \
 // RUN:-DDRIVERKIT=0   \
 // RUN:-DMACCATALYST=0 \
 // RUN:-DEMBEDDED=0\
@@ -72,6 +76,7 @@
 // RUN:-DIOS=0 \
 // RUN:-DTV=1  \
 // RUN:-DWATCH=0   \
+// RUN:-DVISION=0  \
 // RUN:-DDRIVERKIT=0   \
 // RUN:-DMACCATALYST=0 \
 // RUN:-DEMBEDDED=1\
@@ -87,6 +92,7 @@
 // RUN:-DIOS=0 \
 // RUN:-DTV=1  \
 // RUN:-DWATCH=0   \
+// RUN:-DVISION=0  \
 // RUN:-DDRIVERKIT=0   \
 // RUN:-DMACCATALYST=0 \
 // RUN:-DEMBEDDED=0\
@@ -102,6 +108,7 @@
 // RUN:-DIOS=0 \
 // RUN:-DTV=0  \
 // RUN:-DWATCH=1   \
+// RUN:-DVISION=0  \
 // RUN:-DDRIVERKIT=0   \
 // RUN:-DMACCATALYST=0 \
 // RUN:-DEMBEDDED=1\
@@ -117,6 +124,39 @@
 // RUN:-DIOS=0 \
 // RUN:-DTV=0  \
 // RUN:-DWATCH=1   \
+// RUN:-DVISION=0  \
+// RUN:-DDRIVERKIT=0   \
+// RUN:-DMACCATALYST=0 \
+// RUN:-DEMBEDDED=0\
+// RUN:-DSIMULATOR=1   \
+// RUN:-DWINDOWS=0