Back to home page

EIC code displayed by LXR

 
 

    


Warning, /include/clang/Basic/TargetOSMacros.def is written in an unsupported language. File is not indexed.

0001 //===--- TargetOSMacros.def - Target OS macros ------------------*- C++ -*-===//
0002 //
0003 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
0004 // See https://llvm.org/LICENSE.txt for license information.
0005 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
0006 //
0007 //===----------------------------------------------------------------------===//
0008 //
0009 // This file specifies the predefined TARGET_OS_* conditional macros.
0010 // A target macro `Name` should be defined if `Predicate` evaluates to true.
0011 // The macro expects `const llvm::Triple &Triple` and the class `llvm::Triple`
0012 // to be available for the predicate.
0013 //
0014 //===----------------------------------------------------------------------===//
0015 
0016 #ifndef TARGET_OS
0017 #define TARGET_OS(Name, Predicate)
0018 #endif
0019 
0020 // Windows targets.
0021 TARGET_OS(TARGET_OS_WIN32, Triple.isOSWindows())
0022 TARGET_OS(TARGET_OS_WINDOWS, Triple.isOSWindows())
0023 
0024 // Linux target.
0025 TARGET_OS(TARGET_OS_LINUX, Triple.isOSLinux())
0026 
0027 // Unix target.
0028 TARGET_OS(TARGET_OS_UNIX, Triple.isOSNetBSD() ||
0029                           Triple.isOSFreeBSD() ||
0030                           Triple.isOSOpenBSD() ||
0031                           Triple.isOSSolaris())
0032 
0033 // Apple (Mac) targets.
0034 TARGET_OS(TARGET_OS_MAC, Triple.isOSDarwin())
0035 TARGET_OS(TARGET_OS_OSX, Triple.isMacOSX())
0036 TARGET_OS(TARGET_OS_IPHONE, Triple.isiOS() || Triple.isTvOS() ||
0037                             Triple.isWatchOS() || Triple.isXROS())
0038 // Triple::isiOS() also includes tvOS
0039 TARGET_OS(TARGET_OS_IOS, Triple.getOS() == llvm::Triple::IOS)
0040 TARGET_OS(TARGET_OS_TV, Triple.isTvOS())
0041 TARGET_OS(TARGET_OS_WATCH, Triple.isWatchOS())
0042 TARGET_OS(TARGET_OS_VISION, Triple.isXROS())
0043 TARGET_OS(TARGET_OS_DRIVERKIT, Triple.isDriverKit())
0044 TARGET_OS(TARGET_OS_MACCATALYST, Triple.isMacCatalystEnvironment())
0045 TARGET_OS(TARGET_OS_SIMULATOR, Triple.isSimulatorEnvironment())
0046 
0047 // Deprecated Apple target conditionals.
0048 TARGET_OS(TARGET_OS_EMBEDDED, (Triple.isiOS() || Triple.isTvOS() \
0049                                || Triple.isWatchOS() || Triple.isXROS()) \
0050                                && !Triple.isMacCatalystEnvironment() \
0051                                && !Triple.isSimulatorEnvironment())
0052 TARGET_OS(TARGET_OS_NANO, Triple.isWatchOS())
0053 TARGET_OS(TARGET_IPHONE_SIMULATOR, Triple.isSimulatorEnvironment())
0054 TARGET_OS(TARGET_OS_UIKITFORMAC, Triple.isMacCatalystEnvironment())
0055 
0056 #undef TARGET_OS