From c7e8be1cc247f64f34fbb0dac6af5a7a9c29c17b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alexander=20K=C3=B6plinger?= Date: Sun, 17 Dec 2023 05:15:47 +0100 Subject: [PATCH] Rename IsMacOS to IsApplePlatform in the JIT (#96090) * Rename IsMacOS to IsAppleOS in the JIT Now that we use it on iOS/tvOS as well, rename the variables to match. Fixes https://github.com/dotnet/runtime/issues/87610 * PR feedback, use IsApplePlatform instead. --- src/coreclr/gcinfo/gcinfoencoder.cpp | 2 +- src/coreclr/inc/corinfo.h | 2 +- src/coreclr/inc/targetosarch.h | 10 +++++----- src/coreclr/jit/codegenarmarch.cpp | 4 ++-- src/coreclr/jit/codegencommon.cpp | 4 ++-- src/coreclr/jit/compiler.cpp | 8 ++++---- src/coreclr/jit/compiler.h | 2 +- src/coreclr/jit/ee_il_dll.cpp | 10 +++++----- src/coreclr/jit/gentree.cpp | 4 ++-- src/coreclr/jit/gentree.h | 2 +- src/coreclr/jit/helperexpansion.cpp | 8 ++++---- src/coreclr/jit/lclvars.cpp | 14 +++++++------- src/coreclr/jit/lower.cpp | 2 +- src/coreclr/jit/lsraarmarch.cpp | 2 +- src/coreclr/jit/morph.cpp | 2 +- src/coreclr/jit/target.h | 4 ++-- .../Internal/Runtime/EETypeBuilderHelpers.cs | 2 +- .../tools/Common/JitInterface/CorInfoImpl.cs | 2 +- .../tools/Common/JitInterface/CorInfoTypes.cs | 2 +- .../Common/TypeSystem/Common/TargetDetails.cs | 4 ++-- .../Common/TypeSystem/Interop/IL/MarshalHelpers.cs | 4 ++-- .../Compiler/DependencyAnalysis/ObjectWriter.cs | 8 ++++---- .../Target_X64/X64ReadyToRunHelperNode.cs | 2 +- .../Compiler/ExportsFileWriter.cs | 2 +- .../aot/ILCompiler/ConfigurablePInvokePolicy.cs | 2 +- .../superpmi/superpmi-shared/methodcontext.cpp | 2 +- .../superpmi-shim-collector.cpp | 2 +- src/coreclr/vm/codeman.cpp | 2 +- src/coreclr/vm/jitinterface.cpp | 2 +- 29 files changed, 58 insertions(+), 58 deletions(-) diff --git a/src/coreclr/gcinfo/gcinfoencoder.cpp b/src/coreclr/gcinfo/gcinfoencoder.cpp index 73d0e29ca5f40..115f7cdcf253f 100644 --- a/src/coreclr/gcinfo/gcinfoencoder.cpp +++ b/src/coreclr/gcinfo/gcinfoencoder.cpp @@ -570,7 +570,7 @@ GcSlotId GcInfoEncoder::GetStackSlotId( INT32 spOffset, GcSlotFlags flags, GcSta _ASSERTE( (flags & (GC_SLOT_IS_REGISTER | GC_SLOT_IS_DELETED)) == 0 ); - if (!(TargetOS::IsMacOS && TargetArchitecture::IsArm64)) + if (!(TargetOS::IsApplePlatform && TargetArchitecture::IsArm64)) { // the spOffset for the stack slot is required to be pointer size aligned _ASSERTE((spOffset % TARGET_POINTER_SIZE) == 0); diff --git a/src/coreclr/inc/corinfo.h b/src/coreclr/inc/corinfo.h index 4941bf56f7d68..6e253a09e80ae 100644 --- a/src/coreclr/inc/corinfo.h +++ b/src/coreclr/inc/corinfo.h @@ -1759,7 +1759,7 @@ enum CORINFO_OS { CORINFO_WINNT, CORINFO_UNIX, - CORINFO_MACOS, + CORINFO_APPLE, }; enum CORINFO_RUNTIME_ABI diff --git a/src/coreclr/inc/targetosarch.h b/src/coreclr/inc/targetosarch.h index 16e95a2cb4373..06f22d8ee487b 100644 --- a/src/coreclr/inc/targetosarch.h +++ b/src/coreclr/inc/targetosarch.h @@ -11,7 +11,7 @@ class TargetOS #define TARGET_WINDOWS_POSSIBLY_SUPPORTED static const bool IsWindows = true; static const bool IsUnix = false; - static const bool IsMacOS = false; + static const bool IsApplePlatform = false; #elif defined(TARGET_UNIX) #define TARGET_UNIX_POSSIBLY_SUPPORTED static const bool IsWindows = false; @@ -20,12 +20,12 @@ class TargetOS #define TARGET_OS_RUNTIMEDETERMINED #define TARGET_UNIX_OS_RUNTIMEDETERMINED static bool OSSettingConfigured; - static bool IsMacOS; + static bool IsApplePlatform; #else #if defined(TARGET_OSX) - static const bool IsMacOS = true; + static const bool IsApplePlatform = true; #else - static const bool IsMacOS = false; + static const bool IsApplePlatform = false; #endif #endif #else @@ -35,7 +35,7 @@ class TargetOS static bool OSSettingConfigured; static bool IsWindows; static bool IsUnix; - static bool IsMacOS; + static bool IsApplePlatform; #endif }; diff --git a/src/coreclr/jit/codegenarmarch.cpp b/src/coreclr/jit/codegenarmarch.cpp index 9371aa9867514..d19f7ca5657d5 100644 --- a/src/coreclr/jit/codegenarmarch.cpp +++ b/src/coreclr/jit/codegenarmarch.cpp @@ -805,7 +805,7 @@ void CodeGen::genPutArgStk(GenTreePutArgStk* treeNode) regNumber srcReg = genConsumeReg(source); assert((srcReg != REG_NA) && (genIsValidFloatReg(srcReg))); - assert(compMacOsArm64Abi() || treeNode->GetStackByteSize() % TARGET_POINTER_SIZE == 0); + assert(compAppleArm64Abi() || treeNode->GetStackByteSize() % TARGET_POINTER_SIZE == 0); #ifdef TARGET_ARM64 if (treeNode->GetStackByteSize() == 12) @@ -825,7 +825,7 @@ void CodeGen::genPutArgStk(GenTreePutArgStk* treeNode) } var_types slotType = genActualType(source); - if (compMacOsArm64Abi()) + if (compAppleArm64Abi()) { // Small typed args do not get their own full stack slots, so make // sure we do not overwrite adjacent arguments. diff --git a/src/coreclr/jit/codegencommon.cpp b/src/coreclr/jit/codegencommon.cpp index 9e7cfa83696c8..9e6107cb2e1b4 100644 --- a/src/coreclr/jit/codegencommon.cpp +++ b/src/coreclr/jit/codegencommon.cpp @@ -1786,9 +1786,9 @@ void CodeGen::genGenerateMachineCode() { printf(" - Windows"); } - else if (TargetOS::IsMacOS) + else if (TargetOS::IsApplePlatform) { - printf(" - MacOS"); + printf(" - Apple"); } else if (TargetOS::IsUnix) { diff --git a/src/coreclr/jit/compiler.cpp b/src/coreclr/jit/compiler.cpp index 0ae7197967e36..192d182a68f75 100644 --- a/src/coreclr/jit/compiler.cpp +++ b/src/coreclr/jit/compiler.cpp @@ -6063,17 +6063,17 @@ int Compiler::compCompile(CORINFO_MODULE_HANDLE classPtr, noway_assert(TargetOS::OSSettingConfigured); #endif - if (TargetOS::IsMacOS) + if (TargetOS::IsApplePlatform) { - info.compMatchedVM = info.compMatchedVM && (eeInfo->osType == CORINFO_MACOS); + info.compMatchedVM = info.compMatchedVM && (eeInfo->osType == CORINFO_APPLE); } else if (TargetOS::IsUnix) { if (TargetArchitecture::IsX64) { - // MacOS x64 uses the Unix jit variant in crossgen2, not a special jit + // Apple x64 uses the Unix jit variant in crossgen2, not a special jit info.compMatchedVM = - info.compMatchedVM && ((eeInfo->osType == CORINFO_UNIX) || (eeInfo->osType == CORINFO_MACOS)); + info.compMatchedVM && ((eeInfo->osType == CORINFO_UNIX) || (eeInfo->osType == CORINFO_APPLE)); } else { diff --git a/src/coreclr/jit/compiler.h b/src/coreclr/jit/compiler.h index 3da61256acebb..82a714b303da9 100644 --- a/src/coreclr/jit/compiler.h +++ b/src/coreclr/jit/compiler.h @@ -4149,7 +4149,7 @@ class Compiler assert(varDsc->lvType == TYP_SIMD12); #if defined(TARGET_64BIT) - assert(compMacOsArm64Abi() || varDsc->lvSize() == 16); + assert(compAppleArm64Abi() || varDsc->lvSize() == 16); #endif // defined(TARGET_64BIT) // We make local variable SIMD12 types 16 bytes instead of just 12. diff --git a/src/coreclr/jit/ee_il_dll.cpp b/src/coreclr/jit/ee_il_dll.cpp index 36470dbea8e4b..35983dcab7aae 100644 --- a/src/coreclr/jit/ee_il_dll.cpp +++ b/src/coreclr/jit/ee_il_dll.cpp @@ -320,7 +320,7 @@ bool TargetOS::OSSettingConfigured = false; bool TargetOS::IsWindows = false; bool TargetOS::IsUnix = false; #endif -bool TargetOS::IsMacOS = false; +bool TargetOS::IsApplePlatform = false; #endif /***************************************************************************** @@ -330,10 +330,10 @@ bool TargetOS::IsMacOS = false; void CILJit::setTargetOS(CORINFO_OS os) { #ifdef TARGET_OS_RUNTIMEDETERMINED - TargetOS::IsMacOS = os == CORINFO_MACOS; + TargetOS::IsApplePlatform = os == CORINFO_APPLE; #ifndef TARGET_UNIX_OS_RUNTIMEDETERMINED // This define is only set if ONLY the different unix variants are // runtimedetermined - TargetOS::IsUnix = (os == CORINFO_UNIX) || (os == CORINFO_MACOS); + TargetOS::IsUnix = (os == CORINFO_UNIX) || (os == CORINFO_APPLE); TargetOS::IsWindows = os == CORINFO_WINNT; #endif TargetOS::OSSettingConfigured = true; @@ -468,7 +468,7 @@ unsigned Compiler::eeGetArgSize(CORINFO_ARG_LIST_HANDLE list, CORINFO_SIG_INFO* // // Notes: // Usually values passed on the stack are aligned to stack slot (i.e. pointer size), except for -// on macOS ARM ABI that allows packing multiple args into a single stack slot. +// on Apple ARM ABI that allows packing multiple args into a single stack slot. // // The arg size alignment can be different from the normal alignment. One // example is on arm32 where a struct containing a double and float can @@ -479,7 +479,7 @@ unsigned Compiler::eeGetArgSize(CORINFO_ARG_LIST_HANDLE list, CORINFO_SIG_INFO* // static unsigned Compiler::eeGetArgSizeAlignment(var_types type, bool isFloatHfa) { - if (compMacOsArm64Abi()) + if (compAppleArm64Abi()) { if (isFloatHfa) { diff --git a/src/coreclr/jit/gentree.cpp b/src/coreclr/jit/gentree.cpp index 974be388ebfe1..907ec00e5c202 100644 --- a/src/coreclr/jit/gentree.cpp +++ b/src/coreclr/jit/gentree.cpp @@ -1275,14 +1275,14 @@ void CallArgABIInformation::SetHfaType(var_types type, unsigned hfaSlots) // // Remarks: // This function will determine how the argument size needs to be rounded. On -// most ABIs all arguments are rounded to stack pointer size, but macOS arm64 +// most ABIs all arguments are rounded to stack pointer size, but Apple arm64 // ABI is an exception as it allows packing some small arguments into the // same stack slot. // void CallArgABIInformation::SetByteSize(unsigned byteSize, unsigned byteAlignment, bool isStruct, bool isFloatHfa) { unsigned roundedByteSize; - if (compMacOsArm64Abi()) + if (compAppleArm64Abi()) { // Only struct types need extension or rounding to pointer size, but HFA does not. if (isStruct && !isFloatHfa) diff --git a/src/coreclr/jit/gentree.h b/src/coreclr/jit/gentree.h index 9f1afb21f4c18..178a6a4d45cf3 100644 --- a/src/coreclr/jit/gentree.h +++ b/src/coreclr/jit/gentree.h @@ -4551,7 +4551,7 @@ struct CallArgABIInformation void SetMultiRegNums(); // Return number of stack slots that this argument is taking. - // This value is not meaningful on macOS arm64 where multiple arguments can + // This value is not meaningful on Apple arm64 where multiple arguments can // be passed in the same stack slot. unsigned GetStackSlotsNumber() const { diff --git a/src/coreclr/jit/helperexpansion.cpp b/src/coreclr/jit/helperexpansion.cpp index d5ca9f2fbb032..7b4c4fe4610d9 100644 --- a/src/coreclr/jit/helperexpansion.cpp +++ b/src/coreclr/jit/helperexpansion.cpp @@ -599,19 +599,19 @@ bool Compiler::fgExpandThreadLocalAccessForCall(BasicBlock** pBlock, Statement* // Base of coreclr's thread local storage tlsValue = gtNewIndir(TYP_I_IMPL, tlsValue, GTF_IND_NONFAULTING | GTF_IND_INVARIANT); } - else if (TargetOS::IsMacOS) + else if (TargetOS::IsApplePlatform) { - // For OSX x64/arm64, we need to get the address of relevant __thread_vars section of + // For Apple x64/arm64, we need to get the address of relevant __thread_vars section of // the thread local variable `t_ThreadStatics`. Address of `tlv_get_address` is stored // in this entry, which we dereference and invoke it, passing the __thread_vars address // present in `threadVarsSection`. // - // Code sequence to access thread local variable on osx/x64: + // Code sequence to access thread local variable on Apple/x64: // // mov rdi, threadVarsSection // call [rdi] // - // Code sequence to access thread local variable on osx/arm64: + // Code sequence to access thread local variable on Apple/arm64: // // mov x0, threadVarsSection // mov x1, [x0] diff --git a/src/coreclr/jit/lclvars.cpp b/src/coreclr/jit/lclvars.cpp index 65a68f4c4efa5..0eaf5f3313c6f 100644 --- a/src/coreclr/jit/lclvars.cpp +++ b/src/coreclr/jit/lclvars.cpp @@ -1230,10 +1230,10 @@ void Compiler::lvaInitUserArgs(InitVarDscInfo* varDscInfo, unsigned skipArgs, un #else unsigned argAlignment = eeGetArgSizeAlignment(origArgType, (hfaType == TYP_FLOAT)); // We expect the following rounding operation to be a noop on all - // ABIs except ARM (where we have 8-byte aligned args) and macOS + // ABIs except ARM (where we have 8-byte aligned args) and Apple // ARM64 (that allows to pack multiple smaller parameters in a // single stack slot). - assert(compMacOsArm64Abi() || ((varDscInfo->stackArgSize % argAlignment) == 0)); + assert(compAppleArm64Abi() || ((varDscInfo->stackArgSize % argAlignment) == 0)); #endif varDscInfo->stackArgSize = roundUp(varDscInfo->stackArgSize, argAlignment); @@ -3909,14 +3909,14 @@ var_types LclVarDsc::GetRegisterType() const // when moving locals between register and stack. Because of this the // returned type is usually at least one 4-byte stack slot. However, there // are certain exceptions for promoted fields in OSR methods (that may refer -// back to the original frame) and due to macOS arm64 where subsequent small +// back to the original frame) and due to Apple arm64 where subsequent small // parameters can be packed into the same stack slot. // var_types LclVarDsc::GetStackSlotHomeType() const { if (varTypeIsSmall(TypeGet())) { - if (compMacOsArm64Abi() && lvIsParam && !lvIsRegArg) + if (compAppleArm64Abi() && lvIsParam && !lvIsRegArg) { // Allocated by caller and potentially only takes up a small slot return GetRegisterType(); @@ -5443,7 +5443,7 @@ void Compiler::lvaAssignVirtualFrameOffsetsToArgs() /* Update the argOffs to reflect arguments that are passed in registers */ noway_assert(codeGen->intRegState.rsCalleeRegArgCount <= MAX_REG_ARG); - noway_assert(compMacOsArm64Abi() || compArgSize >= codeGen->intRegState.rsCalleeRegArgCount * REGSIZE_BYTES); + noway_assert(compAppleArm64Abi() || compArgSize >= codeGen->intRegState.rsCalleeRegArgCount * REGSIZE_BYTES); if (info.compArgOrder == Target::ARG_ORDER_L2R) { @@ -5597,7 +5597,7 @@ void Compiler::lvaAssignVirtualFrameOffsetsToArgs() { unsigned argumentSize = eeGetArgSize(argLst, &info.compMethodInfo->args); - assert(compMacOsArm64Abi() || argumentSize % TARGET_POINTER_SIZE == 0); + assert(compAppleArm64Abi() || argumentSize % TARGET_POINTER_SIZE == 0); argOffs = lvaAssignVirtualFrameOffsetToArg(lclNum++, argumentSize, argOffs UNIX_AMD64_ABI_ONLY_ARG(&callerArgOffset)); @@ -5986,7 +5986,7 @@ int Compiler::lvaAssignVirtualFrameOffsetToArg(unsigned lclNum, #endif // TARGET_ARM const bool isFloatHfa = (varDsc->lvIsHfa() && (varDsc->GetHfaType() == TYP_FLOAT)); const unsigned argAlignment = eeGetArgSizeAlignment(varDsc->lvType, isFloatHfa); - if (compMacOsArm64Abi()) + if (compAppleArm64Abi()) { argOffs = roundUp(argOffs, argAlignment); } diff --git a/src/coreclr/jit/lower.cpp b/src/coreclr/jit/lower.cpp index fa98f068dc53e..adee5fd745625 100644 --- a/src/coreclr/jit/lower.cpp +++ b/src/coreclr/jit/lower.cpp @@ -1518,7 +1518,7 @@ GenTree* Lowering::NewPutArg(GenTreeCall* call, GenTree* arg, CallArg* callArg, #if !defined(TARGET_64BIT) assert(callArg->AbiInfo.ByteSize == 12); #else // TARGET_64BIT - if (compMacOsArm64Abi()) + if (compAppleArm64Abi()) { assert(callArg->AbiInfo.ByteSize == 12); } diff --git a/src/coreclr/jit/lsraarmarch.cpp b/src/coreclr/jit/lsraarmarch.cpp index a7e6fe5345450..cbdeebb7814a5 100644 --- a/src/coreclr/jit/lsraarmarch.cpp +++ b/src/coreclr/jit/lsraarmarch.cpp @@ -455,7 +455,7 @@ int LinearScan::BuildPutArgStk(GenTreePutArgStk* argNode) assert(!src->isContained()); srcCount = BuildOperandUses(src); #if defined(FEATURE_SIMD) - if (compMacOsArm64Abi() && argNode->GetStackByteSize() == 12) + if (compAppleArm64Abi() && argNode->GetStackByteSize() == 12) { // Vector3 is read/written as two reads/writes: 8 byte and 4 byte. // To assemble the vector properly we would need an additional int register. diff --git a/src/coreclr/jit/morph.cpp b/src/coreclr/jit/morph.cpp index c8d1698db7a7f..c560b584b23b7 100644 --- a/src/coreclr/jit/morph.cpp +++ b/src/coreclr/jit/morph.cpp @@ -2510,7 +2510,7 @@ void CallArgs::AddFinalArgsAndDetermineABIInfo(Compiler* comp, GenTreeCall* call assert(size != 0); assert(byteSize != 0); - if (compMacOsArm64Abi()) + if (compAppleArm64Abi()) { // Arm64 Apple has a special ABI for passing small size arguments on stack, // bytes are aligned to 1-byte, shorts to 2-byte, int/float to 4-byte, etc. diff --git a/src/coreclr/jit/target.h b/src/coreclr/jit/target.h index 638e55d56c743..1e32a1d88946c 100644 --- a/src/coreclr/jit/target.h +++ b/src/coreclr/jit/target.h @@ -32,9 +32,9 @@ inline bool compFeatureVarArg() { return TargetOS::IsWindows && !TargetArchitecture::IsArm32; } -inline bool compMacOsArm64Abi() +inline bool compAppleArm64Abi() { - return TargetArchitecture::IsArm64 && TargetOS::IsMacOS; + return TargetArchitecture::IsArm64 && TargetOS::IsApplePlatform; } inline bool compFeatureArgSplit() { diff --git a/src/coreclr/tools/Common/Internal/Runtime/EETypeBuilderHelpers.cs b/src/coreclr/tools/Common/Internal/Runtime/EETypeBuilderHelpers.cs index d61d2d41d427e..35d3c877e0506 100644 --- a/src/coreclr/tools/Common/Internal/Runtime/EETypeBuilderHelpers.cs +++ b/src/coreclr/tools/Common/Internal/Runtime/EETypeBuilderHelpers.cs @@ -118,7 +118,7 @@ mdType.Name is "WeakReference" or "WeakReference`1" && flagsEx |= (ushort)EETypeFlagsEx.HasCriticalFinalizerFlag; } - if (type.Context.Target.IsOSXLike && IsTrackedReferenceWithFinalizer(type)) + if (type.Context.Target.IsApplePlatform && IsTrackedReferenceWithFinalizer(type)) { flagsEx |= (ushort)EETypeFlagsEx.IsTrackedReferenceWithFinalizerFlag; } diff --git a/src/coreclr/tools/Common/JitInterface/CorInfoImpl.cs b/src/coreclr/tools/Common/JitInterface/CorInfoImpl.cs index 01d2d15fc2997..9e5120609ebff 100644 --- a/src/coreclr/tools/Common/JitInterface/CorInfoImpl.cs +++ b/src/coreclr/tools/Common/JitInterface/CorInfoImpl.cs @@ -3233,7 +3233,7 @@ private bool runWithSPMIErrorTrap(void* function, void* parameter) public static CORINFO_OS TargetToOs(TargetDetails target) { return target.IsWindows ? CORINFO_OS.CORINFO_WINNT : - target.IsOSXLike ? CORINFO_OS.CORINFO_MACOS : CORINFO_OS.CORINFO_UNIX; + target.IsApplePlatform ? CORINFO_OS.CORINFO_APPLE : CORINFO_OS.CORINFO_UNIX; } private void getEEInfo(ref CORINFO_EE_INFO pEEInfoOut) diff --git a/src/coreclr/tools/Common/JitInterface/CorInfoTypes.cs b/src/coreclr/tools/Common/JitInterface/CorInfoTypes.cs index 47e7e6bb7dd71..e21a5474860cd 100644 --- a/src/coreclr/tools/Common/JitInterface/CorInfoTypes.cs +++ b/src/coreclr/tools/Common/JitInterface/CorInfoTypes.cs @@ -812,7 +812,7 @@ public enum CORINFO_OS { CORINFO_WINNT, CORINFO_UNIX, - CORINFO_MACOS, + CORINFO_APPLE, } public enum CORINFO_RUNTIME_ABI diff --git a/src/coreclr/tools/Common/TypeSystem/Common/TargetDetails.cs b/src/coreclr/tools/Common/TypeSystem/Common/TargetDetails.cs index 38eb48be32215..2a4df49f1c2bd 100644 --- a/src/coreclr/tools/Common/TypeSystem/Common/TargetDetails.cs +++ b/src/coreclr/tools/Common/TypeSystem/Common/TargetDetails.cs @@ -308,10 +308,10 @@ public bool IsWindows } /// - /// Returns True if compiling for OSX family of operating systems. + /// Returns True if compiling for Apple family of operating systems. /// Currently including OSX, MacCatalyst, iOS, iOSSimulator, tvOS and tvOSSimulator /// - public bool IsOSXLike + public bool IsApplePlatform { get { diff --git a/src/coreclr/tools/Common/TypeSystem/Interop/IL/MarshalHelpers.cs b/src/coreclr/tools/Common/TypeSystem/Interop/IL/MarshalHelpers.cs index a1034f502fde2..7b0cf61350ab7 100644 --- a/src/coreclr/tools/Common/TypeSystem/Interop/IL/MarshalHelpers.cs +++ b/src/coreclr/tools/Common/TypeSystem/Interop/IL/MarshalHelpers.cs @@ -934,7 +934,7 @@ internal static MarshallerKind GetDisabledMarshallerKind( internal static bool ShouldCheckForPendingException(TargetDetails target, PInvokeMetadata metadata) { - if (!target.IsOSXLike) + if (!target.IsApplePlatform) return false; const string ObjectiveCMsgSend = "objc_msgSend"; @@ -951,7 +951,7 @@ internal static bool ShouldCheckForPendingException(TargetDetails target, PInvok internal static int? GetObjectiveCMessageSendFunction(TargetDetails target, string pinvokeModule, string pinvokeFunction) { - if (!target.IsOSXLike || pinvokeModule != ObjectiveCLibrary) + if (!target.IsApplePlatform || pinvokeModule != ObjectiveCLibrary) return null; #pragma warning disable CA1416 diff --git a/src/coreclr/tools/aot/ILCompiler.Compiler/Compiler/DependencyAnalysis/ObjectWriter.cs b/src/coreclr/tools/aot/ILCompiler.Compiler/Compiler/DependencyAnalysis/ObjectWriter.cs index 9892724b0ca7a..2a7fbfda34405 100644 --- a/src/coreclr/tools/aot/ILCompiler.Compiler/Compiler/DependencyAnalysis/ObjectWriter.cs +++ b/src/coreclr/tools/aot/ILCompiler.Compiler/Compiler/DependencyAnalysis/ObjectWriter.cs @@ -665,7 +665,7 @@ public void BuildCFIMap(NodeFactory factory, ObjectNode node) byte[] blobSymbolName = _sb.ToUtf8String().UnderlyingArray; EmitSymbolDef(blobSymbolName); - if (_targetPlatform.IsOSXLike && + if (_targetPlatform.IsApplePlatform && TryGetCompactUnwindEncoding(blob, out uint compactEncoding)) { _offsetToCfiCompactEncoding[start] = compactEncoding; @@ -771,7 +771,7 @@ public void EmitCFICodes(int offset) Debug.Assert(false); } - if (_targetPlatform.IsOSXLike) + if (_targetPlatform.IsApplePlatform) { // Emit a symbol for beginning of the frame. This is workaround for ld64 // linker bug which would produce DWARF with incorrect pcStart offsets for @@ -850,7 +850,7 @@ public void BuildSymbolDefinitionMap(ObjectNode node, ISymbolDefinitionNode[] de private void AppendExternCPrefix(Utf8StringBuilder sb) { - if (_targetPlatform.IsOSXLike) + if (_targetPlatform.IsApplePlatform) { // On OSX-like systems, we need to prefix an extra underscore to account for correct linkage of // extern "C" functions. @@ -966,7 +966,7 @@ private bool ShouldShareSymbol(ObjectNode node) if (_isSingleFileCompilation) return false; - if (_targetPlatform.IsOSXLike) + if (_targetPlatform.IsApplePlatform) return false; if (!(node is ISymbolNode)) diff --git a/src/coreclr/tools/aot/ILCompiler.Compiler/Compiler/DependencyAnalysis/Target_X64/X64ReadyToRunHelperNode.cs b/src/coreclr/tools/aot/ILCompiler.Compiler/Compiler/DependencyAnalysis/Target_X64/X64ReadyToRunHelperNode.cs index 4d6b4b01ba180..95cb2e5ae2efe 100644 --- a/src/coreclr/tools/aot/ILCompiler.Compiler/Compiler/DependencyAnalysis/Target_X64/X64ReadyToRunHelperNode.cs +++ b/src/coreclr/tools/aot/ILCompiler.Compiler/Compiler/DependencyAnalysis/Target_X64/X64ReadyToRunHelperNode.cs @@ -307,7 +307,7 @@ private static void EmitInlineTLSAccess(NodeFactory factory, ref X64Emitter enco encoder.EmitJE(getInlinedThreadStaticBaseSlow); encoder.EmitRET(); } - else if (factory.Target.IsOSXLike) + else if (factory.Target.IsApplePlatform) { // movq _\Var @TLVP(% rip), % rdi // callq * (% rdi) diff --git a/src/coreclr/tools/aot/ILCompiler.Compiler/Compiler/ExportsFileWriter.cs b/src/coreclr/tools/aot/ILCompiler.Compiler/Compiler/ExportsFileWriter.cs index 7f1a4e2b51de4..1eb076c72779a 100644 --- a/src/coreclr/tools/aot/ILCompiler.Compiler/Compiler/ExportsFileWriter.cs +++ b/src/coreclr/tools/aot/ILCompiler.Compiler/Compiler/ExportsFileWriter.cs @@ -41,7 +41,7 @@ public void EmitExportedMethods() foreach (var method in _methods) streamWriter.WriteLine($" {method.GetUnmanagedCallersOnlyExportName()}"); } - else if(_context.Target.IsOSXLike) + else if(_context.Target.IsApplePlatform) { foreach (string symbol in _exportSymbols) streamWriter.WriteLine($"_{symbol}"); diff --git a/src/coreclr/tools/aot/ILCompiler/ConfigurablePInvokePolicy.cs b/src/coreclr/tools/aot/ILCompiler/ConfigurablePInvokePolicy.cs index 78f218a61be47..27d6108eb70e9 100644 --- a/src/coreclr/tools/aot/ILCompiler/ConfigurablePInvokePolicy.cs +++ b/src/coreclr/tools/aot/ILCompiler/ConfigurablePInvokePolicy.cs @@ -91,7 +91,7 @@ private IEnumerable ModuleNameVariations(string name) } else { - string suffix = _target.IsOSXLike ? ".dylib" : ".so"; + string suffix = _target.IsApplePlatform ? ".dylib" : ".so"; if (name.EndsWith(suffix, StringComparison.Ordinal)) yield return name.Substring(0, name.Length - suffix.Length); diff --git a/src/coreclr/tools/superpmi/superpmi-shared/methodcontext.cpp b/src/coreclr/tools/superpmi/superpmi-shared/methodcontext.cpp index a7c6d9b9d3fab..f5bfebab55301 100644 --- a/src/coreclr/tools/superpmi/superpmi-shared/methodcontext.cpp +++ b/src/coreclr/tools/superpmi/superpmi-shared/methodcontext.cpp @@ -4310,7 +4310,7 @@ void MethodContext::repGetEEInfo(CORINFO_EE_INFO* pEEInfoOut) pEEInfoOut->maxUncheckedOffsetForNullObject = (size_t)((32 * 1024) - 1); pEEInfoOut->targetAbi = CORINFO_CORECLR_ABI; #ifdef TARGET_OSX - pEEInfoOut->osType = CORINFO_MACOS; + pEEInfoOut->osType = CORINFO_APPLE; #elif defined(TARGET_UNIX) pEEInfoOut->osType = CORINFO_UNIX; #else diff --git a/src/coreclr/tools/superpmi/superpmi-shim-collector/superpmi-shim-collector.cpp b/src/coreclr/tools/superpmi/superpmi-shim-collector/superpmi-shim-collector.cpp index da4ac0bdee1f9..a8f4046d83d66 100644 --- a/src/coreclr/tools/superpmi/superpmi-shim-collector/superpmi-shim-collector.cpp +++ b/src/coreclr/tools/superpmi/superpmi-shim-collector/superpmi-shim-collector.cpp @@ -216,7 +216,7 @@ extern "C" DLLEXPORT ICorJitCompiler* getJit() #ifdef TARGET_WINDOWS pJitInstance->currentOs = CORINFO_WINNT; #elif defined(TARGET_OSX) - pJitInstance->currentOs = CORINFO_MACOS; + pJitInstance->currentOs = CORINFO_APPLE; #elif defined(TARGET_UNIX) pJitInstance->currentOs = CORINFO_UNIX; #else diff --git a/src/coreclr/vm/codeman.cpp b/src/coreclr/vm/codeman.cpp index 35c1f0cfebc04..6f984b6483396 100644 --- a/src/coreclr/vm/codeman.cpp +++ b/src/coreclr/vm/codeman.cpp @@ -1983,7 +1983,7 @@ BOOL EEJitManager::LoadJIT() // We have some inconsistency all over the place with osx vs macos, let's handle both here if ((_wcsicmp(altJitOsConfig, W("macos")) == 0) || (_wcsicmp(altJitOsConfig, W("osx")) == 0)) { - targetOs = CORINFO_MACOS; + targetOs = CORINFO_APPLE; } else if ((_wcsicmp(altJitOsConfig, W("linux")) == 0) || (_wcsicmp(altJitOsConfig, W("unix")) == 0)) { diff --git a/src/coreclr/vm/jitinterface.cpp b/src/coreclr/vm/jitinterface.cpp index 18bc49fc4ec38..63e9664aa9a4e 100644 --- a/src/coreclr/vm/jitinterface.cpp +++ b/src/coreclr/vm/jitinterface.cpp @@ -9951,7 +9951,7 @@ void InlinedCallFrame::GetEEInfo(CORINFO_EE_INFO::InlinedCallFrameInfo *pInfo) CORINFO_OS getClrVmOs() { #ifdef TARGET_OSX - return CORINFO_MACOS; + return CORINFO_APPLE; #elif defined(TARGET_UNIX) return CORINFO_UNIX; #else