diff --git a/stdlib/public/runtime/Casting.cpp b/stdlib/public/runtime/Casting.cpp index be543d58a68..37df0dd8444 100644 --- a/stdlib/public/runtime/Casting.cpp +++ b/stdlib/public/runtime/Casting.cpp @@ -2963,7 +2963,7 @@ findBridgeWitness(const Metadata *T) { } auto w = swift_conformsToObjectiveCBridgeable(T); - if (LLVM_LIKELY(w)) + if (SWIFT_LIKELY(w)) return reinterpret_cast(w); // Class and ObjC existential metatypes can be bridged, but metatypes can't // directly conform to protocols yet. Use a stand-in conformance for a type diff --git a/stdlib/public/runtime/Metadata.cpp b/stdlib/public/runtime/Metadata.cpp index c7fb86417a5..bc96e46b7c3 100644 --- a/stdlib/public/runtime/Metadata.cpp +++ b/stdlib/public/runtime/Metadata.cpp @@ -4682,8 +4682,9 @@ swift_getAssociatedTypeWitnessSlowImpl( #endif // If the low bit of the witness is clear, it's already a metadata pointer. - if (LLVM_LIKELY((uintptr_t(witness) & - ProtocolRequirementFlags::AssociatedTypeMangledNameBit) == 0)) { + if (SWIFT_LIKELY((reinterpret_cast(witness) & + ProtocolRequirementFlags::AssociatedTypeMangledNameBit) == + 0)) { // Cached metadata pointers are always complete. return MetadataResponse{(const Metadata *)witness, MetadataState::Complete}; } @@ -4803,8 +4804,9 @@ swift::swift_getAssociatedTypeWitness(MetadataRequest request, extraDiscriminator)); #endif - if (LLVM_LIKELY((uintptr_t(witness) & - ProtocolRequirementFlags::AssociatedTypeMangledNameBit) == 0)) { + if (SWIFT_LIKELY((reinterpret_cast(witness) & + ProtocolRequirementFlags::AssociatedTypeMangledNameBit) == + 0)) { // Cached metadata pointers are always complete. return MetadataResponse{(const Metadata *)witness, MetadataState::Complete}; } @@ -4855,8 +4857,9 @@ static const WitnessTable *swift_getAssociatedConformanceWitnessSlowImpl( #endif // Fast path: we've already resolved this to a witness table, so return it. - if (LLVM_LIKELY((uintptr_t(witness) & - ProtocolRequirementFlags::AssociatedTypeMangledNameBit) == 0)) { + if (SWIFT_LIKELY((reinterpret_cast(witness) & + ProtocolRequirementFlags::AssociatedTypeMangledNameBit) == + 0)) { return static_cast(witness); } @@ -4931,8 +4934,9 @@ const WitnessTable *swift::swift_getAssociatedConformanceWitness( #endif // Fast path: we've already resolved this to a witness table, so return it. - if (LLVM_LIKELY((uintptr_t(witness) & - ProtocolRequirementFlags::AssociatedTypeMangledNameBit) == 0)) { + if (SWIFT_LIKELY((reinterpret_cast(witness) & + ProtocolRequirementFlags::AssociatedTypeMangledNameBit) == + 0)) { return static_cast(witness); }