Lines Matching defs:Darwin
1 //===--- Darwin.cpp - Darwin Tool and ToolChain Implementations -*- C++ -*-===//
9 #include "Darwin.h"
44 // archs which Darwin doesn't use.
52 // This code must be kept in sync with Clang's Darwin specific argument
976 /// Darwin - Darwin tool chain for i386 and x86_64.
977 Darwin::Darwin(const Driver &D, const llvm::Triple &Triple, const ArgList &Args)
983 // Darwin always preprocesses assembly files (unless -x is used explicitly).
992 ToolChain::CXXStdlibType Darwin::GetDefaultCXXStdlibType() const {
997 /// Darwin provides an ARC runtime starting in MacOS X 10.7 and iOS 5.0.
998 ObjCRuntime Darwin::getDefaultObjCRuntime(bool isNonFragile) const {
1015 /// Darwin provides a blocks runtime starting in MacOS X 10.6 and iOS 3.2.
1016 bool Darwin::hasBlocksRuntime() const {
1131 Darwin::~Darwin() {}
1137 std::string Darwin::ComputeEffectiveClangTriple(const ArgList &Args,
1141 // If the target isn't initialized (e.g., an unknown Darwin platform, return
1196 : Darwin(D, Triple, Args) {}
1375 std::string Darwin::getCompilerRT(const ArgList &, StringRef Component,
1381 // On Darwin, the builtins component is not in the library name
1394 StringRef Darwin::getPlatformFamily() const {
1414 StringRef Darwin::getSDKName(StringRef isysroot) {
1426 StringRef Darwin::getOSLibraryNameSuffix(bool IgnoreSim) const {
1472 /// expected page size for Darwin.
1484 void Darwin::addProfileRTLibs(const ArgList &Args,
1549 // Darwin doesn't support real static executables, don't link any runtime
1684 /// The Darwin OS that was selected or inferred from arguments / environment.
1701 using DarwinPlatformKind = Darwin::DarwinPlatformKind;
1702 using DarwinEnvironmentKind = Darwin::DarwinEnvironmentKind;
1787 llvm_unreachable("Unsupported Darwin Source Kind");
1901 case llvm::Triple::Darwin:
1915 llvm_unreachable("Unable to infer Darwin variant");
1952 return DarwinPlatform::createOSVersionArg(Darwin::MacOS, macOSVersion,
1961 Darwin::IPhoneOS, iOSVersion,
1971 Darwin::TvOS, TvOSVersion,
1976 Darwin::WatchOS, WatchOSVersion,
1987 std::string Targets[Darwin::LastDarwinPlatform + 1];
1996 static_assert(std::size(EnvVars) == Darwin::LastDarwinPlatform + 1,
2005 if (!Targets[Darwin::MacOS].empty() &&
2006 (!Targets[Darwin::IPhoneOS].empty() ||
2007 !Targets[Darwin::WatchOS].empty() || !Targets[Darwin::TvOS].empty() ||
2008 !Targets[Darwin::XROS].empty())) {
2012 Targets[Darwin::MacOS] = "";
2014 Targets[Darwin::IPhoneOS] = Targets[Darwin::WatchOS] =
2015 Targets[Darwin::TvOS] = Targets[Darwin::XROS] = "";
2033 (Darwin::DarwinPlatformKind)Target.index(), EnvVars[Target.index()],
2058 StringRef SDK = Darwin::getSDKName(isysroot);
2081 Darwin::IPhoneOS, Version,
2084 return DarwinPlatform::createFromSDK(Darwin::MacOS,
2088 Darwin::WatchOS, Version,
2093 Darwin::TvOS, Version,
2097 Darwin::XROS, Version,
2100 return DarwinPlatform::createFromSDK(Darwin::DriverKit, Version);
2114 case llvm::Triple::Darwin:
2159 inferDeploymentTargetFromArch(DerivedArgList &Args, const Darwin &Toolchain,
2187 if (Triple.getOS() == llvm::Triple::Darwin ||
2270 void Darwin::AddDeploymentTarget(DerivedArgList &Args) const {
2383 assert(OSTarget && "Unable to infer Darwin variant");
2458 llvm_unreachable("unknown kind of Darwin platform");
2610 // On Darwin, libc++ can be installed in one of the following places:
2714 // it was previously found in the gcc lib dir. However, for all the Darwin
2750 // For Darwin platforms, use the compiler-rt-based support library
2966 bool Darwin::isAlignedAllocationUnavailable() const {
2994 const Darwin::DarwinPlatformKind &TargetPlatform,
2995 const Darwin::DarwinEnvironmentKind &TargetEnvironment,
2997 if (TargetEnvironment == Darwin::NativeEnvironment ||
2998 TargetEnvironment == Darwin::Simulator ||
2999 TargetEnvironment == Darwin::MacCatalyst) {
3000 // Standard xnu/Mach/Darwin based environments
3020 case Darwin::MacOS:
3022 case Darwin::IPhoneOS:
3024 case Darwin::MacCatalyst:
3032 case Darwin::TvOS:
3034 case Darwin::WatchOS:
3036 case Darwin::XROS:
3050 case llvm::Triple::Darwin:
3063 bool Darwin::isSizedDeallocationUnavailable() const {
3090 void Darwin::addClangTargetOptions(
3121 // all together in the Darwin module. That leads to module cycles with
3124 // darwin headers are in the Darwin module, there's a module cycle Darwin ->
3125 // _Builtin_stdint -> Darwin (i.e. inttypes.h (darwin) -> stdint.h (builtin) ->
3128 // i.e. when the builtin stdint.h is in the Darwin module too, the cycle
3168 void Darwin::addClangCC1ASTargetOptions(
3224 Darwin::TranslateArgs(const DerivedArgList &Args, StringRef BoundArch,
3226 // First get the generic Apple args, before moving onto Darwin-specific ones.
3298 llvm::ExceptionHandling Darwin::GetExceptionModel(const ArgList &Args) const {
3299 // Darwin uses SjLj exceptions on ARM.
3312 bool Darwin::SupportsEmbeddedBitcode() const {
3333 void Darwin::addMinVersionArgs(const ArgList &Args,
3385 static const char *getPlatformName(Darwin::DarwinPlatformKind Platform,
3386 Darwin::DarwinEnvironmentKind Environment) {
3388 case Darwin::MacOS:
3390 case Darwin::IPhoneOS:
3391 if (Environment == Darwin::MacCatalyst)
3394 case Darwin::TvOS:
3396 case Darwin::WatchOS:
3398 case Darwin::XROS:
3400 case Darwin::DriverKit:
3406 void Darwin::addPlatformVersionArgs(const llvm::opt::ArgList &Args,
3409 [&](const VersionTuple &TV, Darwin::DarwinPlatformKind TargetPlatform,
3410 Darwin::DarwinEnvironmentKind TargetEnvironment,
3417 if (TargetEnvironment == Darwin::Simulator)
3421 if ((TargetPlatform == Darwin::IPhoneOS ||
3422 TargetPlatform == Darwin::TvOS) &&
3475 Darwin::DarwinPlatformKind Platform;
3476 Darwin::DarwinEnvironmentKind Environment;
3480 Platform = Darwin::MacOS;
3481 Environment = Darwin::NativeEnvironment;
3487 Platform = Darwin::IPhoneOS;
3488 Environment = Darwin::MacCatalyst;
3495 static void addDynamicLibLinkArgs(const Darwin &D, const ArgList &Args,
3513 static void addBundleLinkArgs(const Darwin &D, const ArgList &Args,
3524 static void addPgProfilingLinkArgs(const Darwin &D, const ArgList &Args,
3548 static void addDefaultCRTLinkArgs(const Darwin &D, const ArgList &Args,
3572 void Darwin::addStartObjectFileArgs(const ArgList &Args,
3595 void Darwin::CheckObjCARC() const {
3602 SanitizerMask Darwin::getSupportedSanitizers() const {