diff --git a/include/swift/ABI/Metadata.h b/include/swift/ABI/Metadata.h index 50ae7484884..d056c860de7 100644 --- a/include/swift/ABI/Metadata.h +++ b/include/swift/ABI/Metadata.h @@ -3515,7 +3515,7 @@ public: return getTypeContextDescriptorFlags().hasForeignMetadataInitialization(); } - bool hasCanonicicalMetadataPrespecializations() const { + bool hasCanonicalMetadataPrespecializations() const { return getTypeContextDescriptorFlags().hasCanonicalMetadataPrespecializations(); } @@ -3557,7 +3557,7 @@ public: } const llvm::ArrayRef, /*Nullable*/ false>> - getCanonicicalMetadataPrespecializations() const; + getCanonicalMetadataPrespecializations() const; swift_once_t *getCanonicalMetadataPrespecializationCachingOnceToken() const; @@ -3868,25 +3868,25 @@ private: } size_t numTrailingObjects(OverloadToken) const { - return this->hasCanonicicalMetadataPrespecializations() ? + return this->hasCanonicalMetadataPrespecializations() ? 1 : 0; } size_t numTrailingObjects(OverloadToken) const { - return this->hasCanonicicalMetadataPrespecializations() ? + return this->hasCanonicalMetadataPrespecializations() ? this->template getTrailingObjects()->count : 0; } size_t numTrailingObjects(OverloadToken) const { - return this->hasCanonicicalMetadataPrespecializations() ? + return this->hasCanonicalMetadataPrespecializations() ? this->template getTrailingObjects()->count : 0; } size_t numTrailingObjects(OverloadToken) const { - return this->hasCanonicicalMetadataPrespecializations() ? 1 : 0; + return this->hasCanonicalMetadataPrespecializations() ? 1 : 0; } public: @@ -4034,8 +4034,8 @@ public: ->Stub.get(); } - llvm::ArrayRef getCanonicicalMetadataPrespecializations() const { - if (!this->hasCanonicicalMetadataPrespecializations()) { + llvm::ArrayRef getCanonicalMetadataPrespecializations() const { + if (!this->hasCanonicalMetadataPrespecializations()) { return {}; } @@ -4048,7 +4048,7 @@ public: } llvm::ArrayRef getCanonicalMetadataPrespecializationAccessors() const { - if (!this->hasCanonicicalMetadataPrespecializations()) { + if (!this->hasCanonicalMetadataPrespecializations()) { return {}; } @@ -4061,7 +4061,7 @@ public: } swift_once_t *getCanonicalMetadataPrespecializationCachingOnceToken() const { - if (!this->hasCanonicicalMetadataPrespecializations()) { + if (!this->hasCanonicalMetadataPrespecializations()) { return nullptr; } auto box = this->template getTrailingObjects(); @@ -4138,19 +4138,19 @@ private: } size_t numTrailingObjects(OverloadToken) const { - return this->hasCanonicicalMetadataPrespecializations() ? + return this->hasCanonicalMetadataPrespecializations() ? 1 : 0; } size_t numTrailingObjects(OverloadToken) const { - return this->hasCanonicicalMetadataPrespecializations() ? + return this->hasCanonicalMetadataPrespecializations() ? this->template getTrailingObjects()->count : 0; } size_t numTrailingObjects(OverloadToken) const { - return this->hasCanonicicalMetadataPrespecializations() ? 1 : 0; + return this->hasCanonicalMetadataPrespecializations() ? 1 : 0; } public: @@ -4185,8 +4185,8 @@ public: return TargetStructMetadata::getGenericArgumentOffset(); } - llvm::ArrayRef getCanonicicalMetadataPrespecializations() const { - if (!this->hasCanonicicalMetadataPrespecializations()) { + llvm::ArrayRef getCanonicalMetadataPrespecializations() const { + if (!this->hasCanonicalMetadataPrespecializations()) { return {}; } @@ -4199,7 +4199,7 @@ public: } swift_once_t *getCanonicalMetadataPrespecializationCachingOnceToken() const { - if (!this->hasCanonicicalMetadataPrespecializations()) { + if (!this->hasCanonicalMetadataPrespecializations()) { return nullptr; } auto box = this->template getTrailingObjects(); @@ -4265,19 +4265,19 @@ private: } size_t numTrailingObjects(OverloadToken) const { - return this->hasCanonicicalMetadataPrespecializations() ? + return this->hasCanonicalMetadataPrespecializations() ? 1 : 0; } size_t numTrailingObjects(OverloadToken) const { - return this->hasCanonicicalMetadataPrespecializations() ? + return this->hasCanonicalMetadataPrespecializations() ? this->template getTrailingObjects()->count : 0; } size_t numTrailingObjects(OverloadToken) const { - return this->hasCanonicicalMetadataPrespecializations() ? 1 : 0; + return this->hasCanonicalMetadataPrespecializations() ? 1 : 0; } public: @@ -4326,8 +4326,8 @@ public: return *this->template getTrailingObjects(); } - llvm::ArrayRef getCanonicicalMetadataPrespecializations() const { - if (!this->hasCanonicicalMetadataPrespecializations()) { + llvm::ArrayRef getCanonicalMetadataPrespecializations() const { + if (!this->hasCanonicalMetadataPrespecializations()) { return {}; } @@ -4340,7 +4340,7 @@ public: } swift_once_t *getCanonicalMetadataPrespecializationCachingOnceToken() const { - if (!this->hasCanonicicalMetadataPrespecializations()) { + if (!this->hasCanonicalMetadataPrespecializations()) { return nullptr; } auto box = this->template getTrailingObjects(); @@ -4483,17 +4483,17 @@ TargetTypeContextDescriptor::getSingletonMetadataInitialization() const template inline const llvm::ArrayRef, /*Nullable*/ false>> -TargetTypeContextDescriptor::getCanonicicalMetadataPrespecializations() const { +TargetTypeContextDescriptor::getCanonicalMetadataPrespecializations() const { switch (this->getKind()) { case ContextDescriptorKind::Enum: return llvm::cast>(this) - ->getCanonicicalMetadataPrespecializations(); + ->getCanonicalMetadataPrespecializations(); case ContextDescriptorKind::Struct: return llvm::cast>(this) - ->getCanonicicalMetadataPrespecializations(); + ->getCanonicalMetadataPrespecializations(); case ContextDescriptorKind::Class: return llvm::cast>(this) - ->getCanonicicalMetadataPrespecializations(); + ->getCanonicalMetadataPrespecializations(); default: swift_unreachable("Not a type context descriptor."); } diff --git a/stdlib/public/runtime/AutoDiffSupport.h b/stdlib/public/runtime/AutoDiffSupport.h index 960ca8daa3a..4fb63d82e06 100644 --- a/stdlib/public/runtime/AutoDiffSupport.h +++ b/stdlib/public/runtime/AutoDiffSupport.h @@ -20,7 +20,7 @@ namespace swift { /// A data structure responsible for efficiently allocating closure contexts for -/// linear maps such as pullbacks, including rescursive branching trace enum +/// linear maps such as pullbacks, including recursive branching trace enum /// case payloads. class AutoDiffLinearMapContext : public HeapObject { private: diff --git a/stdlib/public/runtime/Casting.cpp b/stdlib/public/runtime/Casting.cpp index 34880edce5f..864f6626550 100644 --- a/stdlib/public/runtime/Casting.cpp +++ b/stdlib/public/runtime/Casting.cpp @@ -1248,7 +1248,7 @@ static id bridgeAnythingNonVerbatimToObjectiveC(OpaqueValue *src, return objc_retain(protocolObj); } } - // Handle bridgable types. + // Handle bridgeable types. } else if (auto srcBridgeWitness = findBridgeWitness(srcType)) { // Bridge the source value to an object. auto srcBridgedObject = diff --git a/stdlib/public/runtime/ConcurrencyExclusivity.inc b/stdlib/public/runtime/ConcurrencyExclusivity.inc index da421f63281..152201d15bb 100644 --- a/stdlib/public/runtime/ConcurrencyExclusivity.inc +++ b/stdlib/public/runtime/ConcurrencyExclusivity.inc @@ -146,7 +146,7 @@ namespace { /// a task access set, those accesses must have completed while the task was /// running since the access set is empty when we pop. /// -/// Case 6: Task has initial accesses, sync does not have initial accesss, and +/// Case 6: Task has initial accesses, sync does not have initial access, and /// Task access set is modified while running (T, F, T) /// /// In this case, TBegin and TEnd are both initially set to non-null diff --git a/stdlib/public/runtime/DynamicCast.cpp b/stdlib/public/runtime/DynamicCast.cpp index 3535f5f0c2a..0d72ad7a9e0 100644 --- a/stdlib/public/runtime/DynamicCast.cpp +++ b/stdlib/public/runtime/DynamicCast.cpp @@ -673,7 +673,7 @@ bool _swift_dictionaryDownCastConditionalIndirect(OpaqueValue *destination, #if SWIFT_OBJC_INTEROP // Helper to memoize bridging conformance data for a particular // Swift struct type. This is used to speed up the most common -// ObjC->Swift bridging conversions by eliminating repeeated +// ObjC->Swift bridging conversions by eliminating repeated // protocol conformance lookups. // Currently used only for String, which may be the only @@ -2079,7 +2079,7 @@ tryCast( || srcKind == MetadataKind::ObjCClassWrapper || srcKind == MetadataKind::ForeignClass) { auto srcObject = getNonNullSrcObject(srcValue, srcType, destType); - // If srcObject is null, we're in compability mode. + // If srcObject is null, we're in compatibility mode. // But we can't lookup dynamic type for a null class reference, so // just skip this in that case. if (srcObject != nullptr) { diff --git a/stdlib/public/runtime/Float16Support.cpp b/stdlib/public/runtime/Float16Support.cpp index 817739d4cdf..5ed58b349ec 100644 --- a/stdlib/public/runtime/Float16Support.cpp +++ b/stdlib/public/runtime/Float16Support.cpp @@ -132,7 +132,7 @@ SWIFT_RUNTIME_EXPORT unsigned short __truncdfhf2(double d) { // to fake it. float f = (float)d; // Double-rounding can only occur if the result of rounding to float is - // an exact-halfway case for the the subsequent rounding to float16. We + // an exact-halfway case for the subsequent rounding to float16. We // can check for that significand bit pattern quickly (though we need // to be careful about values that will result in a subnormal float16, // as those will round in a different position): diff --git a/stdlib/public/runtime/ImageInspectionCommon.h b/stdlib/public/runtime/ImageInspectionCommon.h index 6ff88f12af4..30f47d6ee0e 100644 --- a/stdlib/public/runtime/ImageInspectionCommon.h +++ b/stdlib/public/runtime/ImageInspectionCommon.h @@ -79,7 +79,7 @@ void swift_addNewDSOImage(struct swift::MetadataSections *sections); /// \param context An additional context pointer to pass to \a body. /// /// On Mach-O-based platforms (i.e. Apple platforms), this function is -/// unavailable. On those plaforms, use dyld API to enumerate loaded images and +/// unavailable. On those platforms, use dyld API to enumerate loaded images and /// their corresponding metadata sections. SWIFT_RUNTIME_EXPORT SWIFT_WEAK_IMPORT void swift_enumerateAllMetadataSections( diff --git a/stdlib/public/runtime/Metadata.cpp b/stdlib/public/runtime/Metadata.cpp index bca2539c686..42f5a3f7cf6 100644 --- a/stdlib/public/runtime/Metadata.cpp +++ b/stdlib/public/runtime/Metadata.cpp @@ -771,7 +771,7 @@ _cacheCanonicalSpecializedMetadata(const TypeContextDescriptor *description) { assert(result.second.Value == canonicalMetadata); } } else { - auto canonicalMetadatas = description->getCanonicicalMetadataPrespecializations(); + auto canonicalMetadatas = description->getCanonicalMetadataPrespecializations(); for (auto &canonicalMetadataPtr : canonicalMetadatas) { Metadata *canonicalMetadata = canonicalMetadataPtr.get(); const void *const *arguments = diff --git a/stdlib/public/runtime/ObjCRuntimeGetImageNameFromClass.mm b/stdlib/public/runtime/ObjCRuntimeGetImageNameFromClass.mm index 306be4bf708..4503f918626 100644 --- a/stdlib/public/runtime/ObjCRuntimeGetImageNameFromClass.mm +++ b/stdlib/public/runtime/ObjCRuntimeGetImageNameFromClass.mm @@ -269,7 +269,7 @@ static BOOL callUnpatchedGetImageNameFromClass( /// implementation. /// /// The Swift implementation is always set up to chain to another -/// implementation, so on older OSs we just have to make sure that that chained +/// implementation, so on older OSs we just have to make sure that chained /// implementation is the original system version. See /// callUnpatchedGetImageNameFromClass. static const char *patchedGetImageNameFromClassForOldOSs(Class _Nullable cls) { diff --git a/stdlib/public/runtime/ReflectionMirror.cpp b/stdlib/public/runtime/ReflectionMirror.cpp index c5d5a3f1ff6..c3db12460e4 100644 --- a/stdlib/public/runtime/ReflectionMirror.cpp +++ b/stdlib/public/runtime/ReflectionMirror.cpp @@ -607,20 +607,20 @@ struct ClassImpl : ReflectionMirrorImpl { } bool hasSuperclassMirror() { - auto *Clas = static_cast(type); - auto description = Clas->getDescription(); + auto *Clazz = static_cast(type); + auto description = Clazz->getDescription(); return ((description->SuperclassType) - && (Clas->Superclass) - && (Clas->Superclass->isTypeMetadata())); + && (Clazz->Superclass) + && (Clazz->Superclass->isTypeMetadata())); } ClassImpl superclassMirror() { - auto *Clas = static_cast(type); - auto description = Clas->getDescription(); + auto *Clazz = static_cast(type); + auto description = Clazz->getDescription(); if (description->SuperclassType) { - if (auto theSuperclass = Clas->Superclass) { + if (auto theSuperclass = Clazz->Superclass) { auto impl = ClassImpl(); impl.type = (Metadata *)theSuperclass; impl.value = nullptr; @@ -634,8 +634,8 @@ struct ClassImpl : ReflectionMirrorImpl { if (!isReflectable()) return 0; - auto *Clas = static_cast(type); - auto description = Clas->getDescription(); + auto *Clazz = static_cast(type); + auto description = Clazz->getDescription(); auto count = description->NumFields; return count; @@ -650,8 +650,8 @@ struct ClassImpl : ReflectionMirrorImpl { } intptr_t childOffset(intptr_t i) override { - auto *Clas = static_cast(type); - auto description = Clas->getDescription(); + auto *Clazz = static_cast(type); + auto description = Clazz->getDescription(); if (i < 0 || (size_t)i > description->NumFields) swift::crash("Swift mirror subscript bounds check failure"); @@ -660,12 +660,12 @@ struct ClassImpl : ReflectionMirrorImpl { // metadata, because we don't update the field offsets in the face of // resilient base classes. uintptr_t fieldOffset; - if (usesNativeSwiftReferenceCounting(Clas)) { - fieldOffset = Clas->getFieldOffsets()[i]; + if (usesNativeSwiftReferenceCounting(Clazz)) { + fieldOffset = Clazz->getFieldOffsets()[i]; } else { #if SWIFT_OBJC_INTEROP Ivar *ivars = class_copyIvarList( - reinterpret_cast(const_cast(Clas)), nullptr); + reinterpret_cast(const_cast(Clazz)), nullptr); fieldOffset = ivar_getOffset(ivars[i]); free(ivars); #else diff --git a/stdlib/public/runtime/RuntimeInvocationsTracking.cpp b/stdlib/public/runtime/RuntimeInvocationsTracking.cpp index 959577589c4..8971902e614 100644 --- a/stdlib/public/runtime/RuntimeInvocationsTracking.cpp +++ b/stdlib/public/runtime/RuntimeInvocationsTracking.cpp @@ -232,7 +232,7 @@ _swift_setGlobalRuntimeFunctionCountersUpdateHandler( return oldHandler; } -/// TODO: Provide an API to remove any counters releated to a specific object +/// TODO: Provide an API to remove any counters related to a specific object /// or all objects. /// This is useful if you want to reset the stats for some/all objects. diff --git a/stdlib/public/runtime/SwiftDtoa.cpp b/stdlib/public/runtime/SwiftDtoa.cpp index d1f3c1cb090..f3cd2c4d766 100644 --- a/stdlib/public/runtime/SwiftDtoa.cpp +++ b/stdlib/public/runtime/SwiftDtoa.cpp @@ -967,7 +967,7 @@ size_t swift_dtoa_optimal_binary64_p(const void *d, char *dest, size_t length) // Calculations above used an estimate for the power-of-ten scale. // Here, we compensate for any error in that estimate by testing // whether we have the expected number of digits in the integer - // portion and correcting as necesssary. This also serves to + // portion and correcting as necessary. This also serves to // prune leading zeros from subnormals. // Except for subnormals, this loop should never run more than once. @@ -2622,7 +2622,7 @@ static const uint64_t powersOf10_Binary128[] = { // * 64-bit fractions `lower` and `upper` // * integer `exponent` // -// The returned values satisty the following: +// The returned values satisfy the following: // ``` // lower * 2^exponent <= 10^p <= upper * 2^exponent // ``` @@ -2656,7 +2656,7 @@ static void intervalContainingPowerOf10_Binary32(int p, uint64_t *lower, uint64_ // multiplications to accurately reconstruct the lower and upper // bounds. // -// The returned values satisty the following: +// The returned values satisfy the following: // ``` // lower * 2^exponent <= 10^p <= upper * 2^exponent // ``` diff --git a/stdlib/public/runtime/SwiftObject.mm b/stdlib/public/runtime/SwiftObject.mm index 4590244776a..adef9ba8518 100644 --- a/stdlib/public/runtime/SwiftObject.mm +++ b/stdlib/public/runtime/SwiftObject.mm @@ -850,7 +850,7 @@ UnownedReference *swift::swift_unknownObjectUnownedInit(UnownedReference *dest, void *value) { // Note that LLDB also needs to know about the memory layout of unowned // references. The implementation here needs to be kept in sync with - // lldb_private::SwiftLanguagueRuntime. + // lldb_private::SwiftLanguageRuntime. if (!value) { dest->Value = nullptr; } else if (isObjCForUnownedReference(value)) { @@ -1446,16 +1446,16 @@ bool swift::swift_isEscapingClosureAtFileLocation(const HeapObject *object, const unsigned char *filename, int32_t filenameLength, int32_t line, int32_t column, - unsigned verifcationType) { - assert((verifcationType == 0 || verifcationType == 1) && - "Unknown verifcation type"); + unsigned verificationType) { + assert((verificationType == 0 || verificationType == 1) && + "Unknown verification type"); bool isEscaping = object != nullptr && !object->refCounts.isUniquelyReferenced(); // Print a message if the closure escaped. if (isEscaping) { - auto *message = (verifcationType == 0) + auto *message = (verificationType == 0) ? "closure argument was escaped in " "withoutActuallyEscaping block" : "closure argument passed as @noescape "