Skip to content

Spelling stdlib/public/runtime #42439

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 15 commits into from
Apr 19, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
52 changes: 26 additions & 26 deletions include/swift/ABI/Metadata.h
Original file line number Diff line number Diff line change
Expand Up @@ -3515,7 +3515,7 @@ class TargetTypeContextDescriptor
return getTypeContextDescriptorFlags().hasForeignMetadataInitialization();
}

bool hasCanonicicalMetadataPrespecializations() const {
bool hasCanonicalMetadataPrespecializations() const {
return getTypeContextDescriptorFlags().hasCanonicalMetadataPrespecializations();
}

Expand Down Expand Up @@ -3557,7 +3557,7 @@ class TargetTypeContextDescriptor
}

const llvm::ArrayRef<TargetRelativeDirectPointer<Runtime, TargetMetadata<Runtime>, /*Nullable*/ false>>
getCanonicicalMetadataPrespecializations() const;
getCanonicalMetadataPrespecializations() const;

swift_once_t *getCanonicalMetadataPrespecializationCachingOnceToken() const;

Expand Down Expand Up @@ -3868,25 +3868,25 @@ class TargetClassDescriptor final
}

size_t numTrailingObjects(OverloadToken<MetadataListCount>) const {
return this->hasCanonicicalMetadataPrespecializations() ?
return this->hasCanonicalMetadataPrespecializations() ?
1
: 0;
}

size_t numTrailingObjects(OverloadToken<MetadataListEntry>) const {
return this->hasCanonicicalMetadataPrespecializations() ?
return this->hasCanonicalMetadataPrespecializations() ?
this->template getTrailingObjects<MetadataListCount>()->count
: 0;
}

size_t numTrailingObjects(OverloadToken<MetadataAccessorListEntry>) const {
return this->hasCanonicicalMetadataPrespecializations() ?
return this->hasCanonicalMetadataPrespecializations() ?
this->template getTrailingObjects<MetadataListCount>()->count
: 0;
}

size_t numTrailingObjects(OverloadToken<MetadataCachingOnceToken>) const {
return this->hasCanonicicalMetadataPrespecializations() ? 1 : 0;
return this->hasCanonicalMetadataPrespecializations() ? 1 : 0;
}

public:
Expand Down Expand Up @@ -4034,8 +4034,8 @@ class TargetClassDescriptor final
->Stub.get();
}

llvm::ArrayRef<Metadata> getCanonicicalMetadataPrespecializations() const {
if (!this->hasCanonicicalMetadataPrespecializations()) {
llvm::ArrayRef<Metadata> getCanonicalMetadataPrespecializations() const {
if (!this->hasCanonicalMetadataPrespecializations()) {
return {};
}

Expand All @@ -4048,7 +4048,7 @@ class TargetClassDescriptor final
}

llvm::ArrayRef<MetadataAccessor> getCanonicalMetadataPrespecializationAccessors() const {
if (!this->hasCanonicicalMetadataPrespecializations()) {
if (!this->hasCanonicalMetadataPrespecializations()) {
return {};
}

Expand All @@ -4061,7 +4061,7 @@ class TargetClassDescriptor final
}

swift_once_t *getCanonicalMetadataPrespecializationCachingOnceToken() const {
if (!this->hasCanonicicalMetadataPrespecializations()) {
if (!this->hasCanonicalMetadataPrespecializations()) {
return nullptr;
}
auto box = this->template getTrailingObjects<MetadataCachingOnceToken>();
Expand Down Expand Up @@ -4138,19 +4138,19 @@ class TargetStructDescriptor final
}

size_t numTrailingObjects(OverloadToken<MetadataListCount>) const {
return this->hasCanonicicalMetadataPrespecializations() ?
return this->hasCanonicalMetadataPrespecializations() ?
1
: 0;
}

size_t numTrailingObjects(OverloadToken<MetadataListEntry>) const {
return this->hasCanonicicalMetadataPrespecializations() ?
return this->hasCanonicalMetadataPrespecializations() ?
this->template getTrailingObjects<MetadataListCount>()->count
: 0;
}

size_t numTrailingObjects(OverloadToken<MetadataCachingOnceToken>) const {
return this->hasCanonicicalMetadataPrespecializations() ? 1 : 0;
return this->hasCanonicalMetadataPrespecializations() ? 1 : 0;
}

public:
Expand Down Expand Up @@ -4185,8 +4185,8 @@ class TargetStructDescriptor final
return TargetStructMetadata<Runtime>::getGenericArgumentOffset();
}

llvm::ArrayRef<Metadata> getCanonicicalMetadataPrespecializations() const {
if (!this->hasCanonicicalMetadataPrespecializations()) {
llvm::ArrayRef<Metadata> getCanonicalMetadataPrespecializations() const {
if (!this->hasCanonicalMetadataPrespecializations()) {
return {};
}

Expand All @@ -4199,7 +4199,7 @@ class TargetStructDescriptor final
}

swift_once_t *getCanonicalMetadataPrespecializationCachingOnceToken() const {
if (!this->hasCanonicicalMetadataPrespecializations()) {
if (!this->hasCanonicalMetadataPrespecializations()) {
return nullptr;
}
auto box = this->template getTrailingObjects<MetadataCachingOnceToken>();
Expand Down Expand Up @@ -4265,19 +4265,19 @@ class TargetEnumDescriptor final
}

size_t numTrailingObjects(OverloadToken<MetadataListCount>) const {
return this->hasCanonicicalMetadataPrespecializations() ?
return this->hasCanonicalMetadataPrespecializations() ?
1
: 0;
}

size_t numTrailingObjects(OverloadToken<MetadataListEntry>) const {
return this->hasCanonicicalMetadataPrespecializations() ?
return this->hasCanonicalMetadataPrespecializations() ?
this->template getTrailingObjects<MetadataListCount>()->count
: 0;
}

size_t numTrailingObjects(OverloadToken<MetadataCachingOnceToken>) const {
return this->hasCanonicicalMetadataPrespecializations() ? 1 : 0;
return this->hasCanonicalMetadataPrespecializations() ? 1 : 0;
}

public:
Expand Down Expand Up @@ -4326,8 +4326,8 @@ class TargetEnumDescriptor final
return *this->template getTrailingObjects<SingletonMetadataInitialization>();
}

llvm::ArrayRef<Metadata> getCanonicicalMetadataPrespecializations() const {
if (!this->hasCanonicicalMetadataPrespecializations()) {
llvm::ArrayRef<Metadata> getCanonicalMetadataPrespecializations() const {
if (!this->hasCanonicalMetadataPrespecializations()) {
return {};
}

Expand All @@ -4340,7 +4340,7 @@ class TargetEnumDescriptor final
}

swift_once_t *getCanonicalMetadataPrespecializationCachingOnceToken() const {
if (!this->hasCanonicicalMetadataPrespecializations()) {
if (!this->hasCanonicalMetadataPrespecializations()) {
return nullptr;
}
auto box = this->template getTrailingObjects<MetadataCachingOnceToken>();
Expand Down Expand Up @@ -4483,17 +4483,17 @@ TargetTypeContextDescriptor<Runtime>::getSingletonMetadataInitialization() const

template<typename Runtime>
inline const llvm::ArrayRef<TargetRelativeDirectPointer<Runtime, TargetMetadata<Runtime>, /*Nullable*/ false>>
TargetTypeContextDescriptor<Runtime>::getCanonicicalMetadataPrespecializations() const {
TargetTypeContextDescriptor<Runtime>::getCanonicalMetadataPrespecializations() const {
switch (this->getKind()) {
case ContextDescriptorKind::Enum:
return llvm::cast<TargetEnumDescriptor<Runtime>>(this)
->getCanonicicalMetadataPrespecializations();
->getCanonicalMetadataPrespecializations();
case ContextDescriptorKind::Struct:
return llvm::cast<TargetStructDescriptor<Runtime>>(this)
->getCanonicicalMetadataPrespecializations();
->getCanonicalMetadataPrespecializations();
case ContextDescriptorKind::Class:
return llvm::cast<TargetClassDescriptor<Runtime>>(this)
->getCanonicicalMetadataPrespecializations();
->getCanonicalMetadataPrespecializations();
default:
swift_unreachable("Not a type context descriptor.");
}
Expand Down
2 changes: 1 addition & 1 deletion stdlib/public/runtime/AutoDiffSupport.h
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion stdlib/public/runtime/Casting.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 =
Expand Down
2 changes: 1 addition & 1 deletion stdlib/public/runtime/ConcurrencyExclusivity.inc
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions stdlib/public/runtime/DynamicCast.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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) {
Expand Down
2 changes: 1 addition & 1 deletion stdlib/public/runtime/Float16Support.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down
2 changes: 1 addition & 1 deletion stdlib/public/runtime/ImageInspectionCommon.h
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
2 changes: 1 addition & 1 deletion stdlib/public/runtime/Metadata.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
28 changes: 14 additions & 14 deletions stdlib/public/runtime/ReflectionMirror.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -607,20 +607,20 @@ struct ClassImpl : ReflectionMirrorImpl {
}

bool hasSuperclassMirror() {
auto *Clas = static_cast<const ClassMetadata*>(type);
auto description = Clas->getDescription();
auto *Clazz = static_cast<const ClassMetadata*>(type);
auto description = Clazz->getDescription();

return ((description->SuperclassType)
&& (Clas->Superclass)
&& (Clas->Superclass->isTypeMetadata()));
&& (Clazz->Superclass)
&& (Clazz->Superclass->isTypeMetadata()));
}

ClassImpl superclassMirror() {
auto *Clas = static_cast<const ClassMetadata*>(type);
auto description = Clas->getDescription();
auto *Clazz = static_cast<const ClassMetadata*>(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;
Expand All @@ -634,8 +634,8 @@ struct ClassImpl : ReflectionMirrorImpl {
if (!isReflectable())
return 0;

auto *Clas = static_cast<const ClassMetadata*>(type);
auto description = Clas->getDescription();
auto *Clazz = static_cast<const ClassMetadata*>(type);
auto description = Clazz->getDescription();
auto count = description->NumFields;

return count;
Expand All @@ -650,8 +650,8 @@ struct ClassImpl : ReflectionMirrorImpl {
}

intptr_t childOffset(intptr_t i) override {
auto *Clas = static_cast<const ClassMetadata*>(type);
auto description = Clas->getDescription();
auto *Clazz = static_cast<const ClassMetadata*>(type);
auto description = Clazz->getDescription();

if (i < 0 || (size_t)i > description->NumFields)
swift::crash("Swift mirror subscript bounds check failure");
Expand All @@ -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<Class>(const_cast<ClassMetadata *>(Clas)), nullptr);
reinterpret_cast<Class>(const_cast<ClassMetadata *>(Clazz)), nullptr);
fieldOffset = ivar_getOffset(ivars[i]);
free(ivars);
#else
Expand Down
2 changes: 1 addition & 1 deletion stdlib/public/runtime/RuntimeInvocationsTracking.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand Down
6 changes: 3 additions & 3 deletions stdlib/public/runtime/SwiftDtoa.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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
// ```
Expand Down Expand Up @@ -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
// ```
Expand Down
10 changes: 5 additions & 5 deletions stdlib/public/runtime/SwiftObject.mm
Original file line number Diff line number Diff line change
Expand Up @@ -850,7 +850,7 @@ static bool isObjCForUnownedReference(void *value) {
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)) {
Expand Down Expand Up @@ -1446,16 +1446,16 @@ static bool isUniquelyReferenced(id 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 "
Expand Down