Skip to content

Commit 9fa14ca

Browse files
authored
Spelling irgen (#42470)
* spelling: abstractable Signed-off-by: Josh Soref <[email protected]> * spelling: across Signed-off-by: Josh Soref <[email protected]> * spelling: clazz Signed-off-by: Josh Soref <[email protected]> * spelling: command Signed-off-by: Josh Soref <[email protected]> * spelling: components Signed-off-by: Josh Soref <[email protected]> * spelling: current Signed-off-by: Josh Soref <[email protected]> * spelling: declared Signed-off-by: Josh Soref <[email protected]> * spelling: discrimination Signed-off-by: Josh Soref <[email protected]> * spelling: entities Signed-off-by: Josh Soref <[email protected]> * spelling: except Signed-off-by: Josh Soref <[email protected]> * spelling: existential Signed-off-by: Josh Soref <[email protected]> * spelling: generic Signed-off-by: Josh Soref <[email protected]> * spelling: initialization Signed-off-by: Josh Soref <[email protected]> * spelling: initialize Signed-off-by: Josh Soref <[email protected]> * spelling: inserted Signed-off-by: Josh Soref <[email protected]> * spelling: instantiate Signed-off-by: Josh Soref <[email protected]> * spelling: instantiation Signed-off-by: Josh Soref <[email protected]> * spelling: interfere Signed-off-by: Josh Soref <[email protected]> * spelling: interferes Signed-off-by: Josh Soref <[email protected]> * spelling: intrinsic Signed-off-by: Josh Soref <[email protected]> * spelling: metadata Signed-off-by: Josh Soref <[email protected]> * spelling: might Signed-off-by: Josh Soref <[email protected]> * spelling: multiple Signed-off-by: Josh Soref <[email protected]> * spelling: necessary Signed-off-by: Josh Soref <[email protected]> * spelling: objective Signed-off-by: Josh Soref <[email protected]> * spelling: occurrences Signed-off-by: Josh Soref <[email protected]> * spelling: outlined Signed-off-by: Josh Soref <[email protected]> * spelling: parameters Signed-off-by: Josh Soref <[email protected]> * spelling: payload Signed-off-by: Josh Soref <[email protected]> * spelling: rearchitecting Signed-off-by: Josh Soref <[email protected]> * spelling: replaceable Signed-off-by: Josh Soref <[email protected]> * spelling: reverse Signed-off-by: Josh Soref <[email protected]> * spelling: rewritable Signed-off-by: Josh Soref <[email protected]> * spelling: shareably Signed-off-by: Josh Soref <[email protected]> * spelling: specializations Signed-off-by: Josh Soref <[email protected]> * spelling: speedup Signed-off-by: Josh Soref <[email protected]> * spelling: template Signed-off-by: Josh Soref <[email protected]> * spelling: that Signed-off-by: Josh Soref <[email protected]> * spelling: the Signed-off-by: Josh Soref <[email protected]> * spelling: transferred Signed-off-by: Josh Soref <[email protected]> * spelling: uninitialized Signed-off-by: Josh Soref <[email protected]> * spelling: witness Signed-off-by: Josh Soref <[email protected]> Co-authored-by: Josh Soref <[email protected]>
1 parent 2afb9b7 commit 9fa14ca

28 files changed

+77
-77
lines changed

lib/IRGen/ClassLayout.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ Size ClassLayout::getInstanceStart() const {
5555
return element.getByteOffset();
5656
} else {
5757
// We used to crash for classes that have an empty and a resilient field
58-
// during intialization.
58+
// during initialization.
5959
// class CrashInInit {
6060
// var empty = EmptyStruct()
6161
// var resilient = ResilientThing()

lib/IRGen/ClassMetadataVisitor.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ template <class Impl> class ClassMetadataVisitor
120120
// Swift class metadata.
121121

122122
// Super class metadata is resilient if
123-
// the superclass is resilient when viewed from the currrent module.
123+
// the superclass is resilient when viewed from the current module.
124124
// But not if the current class is defined in an external module and
125125
// not publically accessible (e.g private or internal). This would
126126
// normally not happen except if we compile theClass's module with

lib/IRGen/GenBuiltin.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1336,7 +1336,7 @@ if (Builtin.ID == BuiltinValueKind::id) { \
13361336
return;
13371337
}
13381338
if (Builtin.ID == BuiltinValueKind::AssumeAlignment) {
1339-
// A no-op pointer cast that passes on its first value. Common occurences of
1339+
// A no-op pointer cast that passes on its first value. Common occurrences of
13401340
// this builtin should already be removed with the alignment guarantee moved
13411341
// to the subsequent load or store.
13421342
//

lib/IRGen/GenCall.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -413,10 +413,10 @@ namespace {
413413
// function type (the function to be called on returning).
414414
void expandAsyncReturnType();
415415

416-
// Expand the componends for the async suspend call of the function type.
416+
// Expand the components for the async suspend call of the function type.
417417
void expandAsyncAwaitType();
418418

419-
// Expand the componends for the primary entrypoint of the async function
419+
// Expand the components for the primary entrypoint of the async function
420420
// type.
421421
void expandAsyncEntryType();
422422

@@ -2544,7 +2544,7 @@ class AsyncCallEmission final : public CallEmission {
25442544

25452545
auto layout = getAsyncContextLayout();
25462546

2547-
// Innitialize the async context for returning if we're not using
2547+
// Initialize the async context for returning if we're not using
25482548
// the special convention which suppresses that.
25492549
if (!getCallee().shouldPassContinuationDirectly()) {
25502550
// Set the caller context to the current context.

lib/IRGen/GenCast.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1072,7 +1072,7 @@ llvm::Value *irgen::emitFastClassCastIfPossible(IRGenFunction &IGF,
10721072

10731073
// TODO: we could use the ClassHierarchyAnalysis do also handle "effectively"
10741074
// final classes, e.g. not-subclassed internal classes in WMO.
1075-
// This would need some re-architecting of ClassHierarchyAnalysis to make it
1075+
// This would need some rearchitecting of ClassHierarchyAnalysis to make it
10761076
// available in IRGen.
10771077
ClassDecl *toClass = classTy->getDecl();
10781078
if (!toClass->isFinal())
@@ -1093,7 +1093,7 @@ llvm::Value *irgen::emitFastClassCastIfPossible(IRGenFunction &IGF,
10931093
IGF.IGM.getAddrOfTypeMetadataAccessFunction(targetFormalType,
10941094
NotForDefinition);
10951095
auto request = DynamicMetadataRequest(MetadataState::Complete);
1096-
// We know that we are not in a gneric class context, so we can safely
1096+
// We know that we are not in a generic class context, so we can safely
10971097
// determine that the call here does not need to take that into account.
10981098
auto response =
10991099
IGF.emitGenericTypeMetadataAccessFunctionCall(accessor, {}, request);
@@ -1106,7 +1106,7 @@ llvm::Value *irgen::emitFastClassCastIfPossible(IRGenFunction &IGF,
11061106
targetFormalType, GenericSignature(), /*suppress cast*/ true);
11071107
llvm::Value *rhs = IGF.Builder.CreateBitCast(objMetadata, IGF.IGM.Int8PtrTy);
11081108

1109-
// return isa_ptr == metadat_ptr ? instance : nullptr
1109+
// return isa_ptr == metadata_ptr ? instance : nullptr
11101110
llvm::Value *isEqual = IGF.Builder.CreateCmp(llvm::CmpInst::Predicate::ICMP_EQ,
11111111
lhs, rhs);
11121112
auto *instanceTy = cast<llvm::PointerType>(instance->getType());

lib/IRGen/GenClangDecl.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ clang::Decl *getDeclWithExecutableCode(clang::Decl *decl) {
9191
return const_cast<clang::FunctionDecl *>(definition);
9292
}
9393

94-
// If this is a potentially not-yet-instanciated template, we might
94+
// If this is a potentially not-yet-instantiated template, we might
9595
// still have a body.
9696
if (fd->getTemplateInstantiationPattern())
9797
return fd;

lib/IRGen/GenClass.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -452,7 +452,7 @@ ClassTypeInfo::createLayoutWithTailElems(IRGenModule &IGM,
452452
os.str());
453453
builder.setAsBodyOfStruct(ResultTy);
454454

455-
// Create the StructLayout, which is transfered to the caller (the caller is
455+
// Create the StructLayout, which is transferred to the caller (the caller is
456456
// responsible for deleting it).
457457
return new StructLayout(builder, classType.getClassOrBoundGenericClass(),
458458
ResultTy, builder.getElements());
@@ -2570,7 +2570,7 @@ ClassDecl *irgen::getRootClassForMetaclass(IRGenModule &IGM, ClassDecl *C) {
25702570
if (C->hasClangNode()) return C;
25712571

25722572
// FIXME: If the root class specifies its own runtime ObjC base class,
2573-
// assume that that base class ultimately inherits NSObject.
2573+
// assume that base class ultimately inherits NSObject.
25742574
if (C->getAttrs().hasAttribute<SwiftNativeObjCRuntimeBaseAttr>())
25752575
return IGM.getObjCRuntimeBaseClass(
25762576
IGM.Context.getSwiftId(KnownFoundationEntity::NSObject),

lib/IRGen/GenDecl.cpp

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -841,8 +841,8 @@ IRGenModule::getAddrOfContextDescriptorForParent(DeclContext *parent,
841841
auto nominal = ext->getExtendedNominal();
842842
// If the extended type is an ObjC class, it won't have a nominal type
843843
// descriptor, so we'll just emit an extension context.
844-
auto clas = dyn_cast<ClassDecl>(nominal);
845-
if (!clas || clas->isForeign() || hasKnownSwiftMetadata(*this, clas)) {
844+
auto clazz = dyn_cast<ClassDecl>(nominal);
845+
if (!clazz || clazz->isForeign() || hasKnownSwiftMetadata(*this, clazz)) {
846846
IRGen.noteUseOfTypeContextDescriptor(nominal, DontRequireMetadata);
847847
return getAddrOfLLVMVariableOrGOTEquivalent(
848848
LinkEntity::forNominalTypeDescriptor(nominal));
@@ -2195,7 +2195,7 @@ LinkInfo LinkInfo::get(const UniversalLinkageInfo &linkInfo,
21952195
if (const auto *MD = DC->getParentModule())
21962196
isKnownLocal = MD == swiftModule || MD->isStaticLibrary();
21972197
} else if (entity.hasSILFunction()) {
2198-
// SIL serialized entitites (functions, witness tables, vtables) do not have
2198+
// SIL serialized entities (functions, witness tables, vtables) do not have
21992199
// an associated DeclContext and are serialized into the current module. As
22002200
// a result, we explicitly handle SIL Functions here. We do not expect other
22012201
// types to be referenced directly.
@@ -3295,7 +3295,7 @@ static llvm::GlobalVariable *createGOTEquivalent(IRGenModule &IGM,
32953295
// rdar://problem/53836960: i386 ld64 also mis-links relative references
32963296
// to GOT entries.
32973297
// rdar://problem/59782487: issue with on-device JITd expressions.
3298-
// The JIT gets confused by private vars accessed accross object files.
3298+
// The JIT gets confused by private vars accessed across object files.
32993299
if (!IGM.getOptions().UseJIT &&
33003300
(!IGM.Triple.isOSDarwin() || IGM.Triple.getArch() != llvm::Triple::x86)) {
33013301
gotEquivalent->setUnnamedAddr(llvm::GlobalValue::UnnamedAddr::Global);
@@ -3707,29 +3707,29 @@ IRGenModule::getTypeEntityReference(GenericTypeDecl *decl) {
37073707
}
37083708

37093709
if (auto nominal = dyn_cast<NominalTypeDecl>(decl)) {
3710-
auto clas = dyn_cast<ClassDecl>(decl);
3711-
if (!clas || clas->isForeignReferenceType()) {
3710+
auto clazz = dyn_cast<ClassDecl>(decl);
3711+
if (!clazz || clazz->isForeignReferenceType()) {
37123712
return getTypeContextDescriptorEntityReference(*this, nominal);
37133713
}
37143714

3715-
switch (clas->getForeignClassKind()) {
3715+
switch (clazz->getForeignClassKind()) {
37163716
case ClassDecl::ForeignKind::RuntimeOnly:
3717-
return getObjCClassByNameReference(*this, clas);
3717+
return getObjCClassByNameReference(*this, clazz);
37183718

37193719
case ClassDecl::ForeignKind::CFType:
3720-
return getTypeContextDescriptorEntityReference(*this, clas);
3720+
return getTypeContextDescriptorEntityReference(*this, clazz);
37213721

37223722
case ClassDecl::ForeignKind::Normal:
3723-
if (hasKnownSwiftMetadata(*this, clas)) {
3724-
return getTypeContextDescriptorEntityReference(*this, clas);
3723+
if (hasKnownSwiftMetadata(*this, clazz)) {
3724+
return getTypeContextDescriptorEntityReference(*this, clazz);
37253725
}
37263726

37273727
// Note: we would like to use an Objective-C class reference, but the
37283728
// Darwin linker currently has a bug where it will coalesce these symbols
37293729
// *after* computing a relative offset, causing incorrect relative
37303730
// offsets in the metadata. Therefore, reference Objective-C classes by
37313731
// their runtime names.
3732-
return getObjCClassByNameReference(*this, clas);
3732+
return getObjCClassByNameReference(*this, clazz);
37333733
}
37343734
}
37353735
llvm_unreachable("bad foreign type kind");

lib/IRGen/GenDistributed.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -624,7 +624,7 @@ void DistributedAccessor::emit() {
624624
// Metadata that represents passed in the invocation decoder.
625625
auto *decoderType = params.claimNext();
626626

627-
// If the distributed thunk is declarated in a protocol that conforms
627+
// If the distributed thunk is declared in a protocol that conforms
628628
// to `DistributedActor` protocol, there is an extract parameter that
629629
// represents a type of protocol witness.
630630
if (isa<ProtocolDecl>(actor))
@@ -815,7 +815,7 @@ ArgumentDecoderInfo DistributedAccessor::findArgumentDecoder(
815815

816816
auto *decodeSIL = IGM.getSILModule().lookUpFunction(SILDeclRef(decodeFn));
817817
auto *fnPtr = IGM.getAddrOfSILFunction(decodeSIL, NotForDefinition,
818-
/*isDynamicallyReplacible=*/false);
818+
/*isDynamicallyReplaceable=*/false);
819819

820820
auto methodPtr = FunctionPointer::forDirect(
821821
classifyFunctionPointerKind(decodeSIL), fnPtr,

lib/IRGen/GenFunc.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -725,9 +725,9 @@ static unsigned findSinglePartiallyAppliedParameterIndexIgnoringEmptyTypes(
725725
IRGenFunction &IGF, CanSILFunctionType substType,
726726
CanSILFunctionType outType) {
727727
auto substParameters = substType->getParameters();
728-
auto outParamters = outType->getParameters();
728+
auto outParameters = outType->getParameters();
729729
unsigned firstNonEmpty = -1U;
730-
for (unsigned paramIdx = outParamters.size() ; paramIdx != substParameters.size(); ++paramIdx) {
730+
for (unsigned paramIdx = outParameters.size() ; paramIdx != substParameters.size(); ++paramIdx) {
731731
bool isEmpty =
732732
isABIIgnoredParameterWithoutStorage(IGF.IGM, IGF, substType, paramIdx);
733733
assert((isEmpty || firstNonEmpty == -1U) && "Expect at most one partially "

0 commit comments

Comments
 (0)