Skip to content

Commit 8af3196

Browse files
Merge pull request #7464 from practicalswift/gardening-20170214b
[gardening] Fix recently introduced typos
2 parents 04af1b3 + 65b0219 commit 8af3196

22 files changed

+41
-42
lines changed

docs/StringManifesto.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -639,7 +639,7 @@ takesAnArrayOfSubstring(arrayOfString.map { $0[] })
639639

640640
As we have seen, all three options above have downsides, but it's possible
641641
these downsides could be eliminated/mitigated by the compiler. We are proposing
642-
one such mitigation--implicit conversion--as part of the the "different type,
642+
one such mitigation--implicit conversion--as part of the "different type,
643643
shared storage" option, to help avoid the cognitive load on developers of
644644
having to deal with a separate `Substring` type.
645645

include/swift/AST/Decl.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -326,7 +326,7 @@ class alignas(1 << DeclAlignInBits) Decl {
326326
/// the enum type.
327327
unsigned Recursiveness : 2;
328328

329-
/// \brief Whther or not this element has an associated value.
329+
/// \brief Whether or not this element has an associated value.
330330
unsigned HasArgumentType : 1;
331331
};
332332
enum { NumEnumElementDeclBits = NumValueDeclBits + 3 };

include/swift/AST/SubstitutionMap.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939
namespace swift {
4040

4141
class GenericSignature;
42-
class CenericEnvironment;
42+
class GenericEnvironment;
4343
class SubstitutableType;
4444

4545
template<class Type> class CanTypeWrapper;

include/swift/AST/Types.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2828,7 +2828,7 @@ class SILParameterInfo {
28282828
/// storage. Therefore they will be passed using an indirect formal
28292829
/// convention, and this method will return an address type. However, in
28302830
/// canonical SIL the opaque arguments might not have an address type.
2831-
SILType getSILStorageType() const; // in SILFunctioConventions.h
2831+
SILType getSILStorageType() const; // in SILFunctionConventions.h
28322832

28332833
/// Return a version of this parameter info with the type replaced.
28342834
SILParameterInfo getWithType(CanType type) const {
@@ -2925,7 +2925,7 @@ class SILResultInfo {
29252925
/// storage. Therefore they will be returned using an indirect formal
29262926
/// convention, and this method will return an address type. However, in
29272927
/// canonical SIL the opaque results might not have an address type.
2928-
SILType getSILStorageType() const; // in SILFunctioConventions.h
2928+
SILType getSILStorageType() const; // in SILFunctionConventions.h
29292929

29302930
/// Return a version of this result info with the type replaced.
29312931
SILResultInfo getWithType(CanType type) const {
@@ -3239,7 +3239,7 @@ class SILFunctionType final : public TypeBase, public llvm::FoldingSetNode,
32393239
// substituted SIL types match, a formal direct argument may not be passed
32403240
// to a formal indirect parameter and vice-versa. Hence, the formally
32413241
// indirect property, not the SIL indirect property, should be consulted to
3242-
// determine whether function reabstraction is necesary.
3242+
// determine whether function reabstraction is necessary.
32433243
unsigned getNumIndirectFormalResults() const {
32443244
return NumIndirectFormalResults;
32453245
}

include/swift/Basic/Demangle.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -232,7 +232,7 @@ class Demangler;
232232
/// It owns the allocated nodes which are created during demangling.
233233
/// It is always preferable to use the demangling via this context class as it
234234
/// ensures efficient memory management. Especially if demangling is done for
235-
/// multiple symbols. Typecial usage:
235+
/// multiple symbols. Typical usage:
236236
/// \code
237237
/// Context Ctx;
238238
/// for (...) {

include/swift/SIL/SILFunctionConventions.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
// The primary purpose of this API is mapping the formal SIL parameter and
2020
// result conventions onto the SIL argument types. The "formal" conventions are
2121
// immutably associated with a SILFunctionType--a SIL function's type
22-
// information never changes. The SIL convenentions determine how those formal
22+
// information never changes. The SIL conventions determine how those formal
2323
// conventions will be represented in the body of SIL functions and at call
2424
// sites.
2525
//

include/swift/SIL/SILInstruction.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3904,7 +3904,7 @@ class OpenExistentialAddrInst
39043904
SILType SelfTy);
39053905
};
39063906

3907-
/// Given an opaque value refering to an existential, "opens" the
3907+
/// Given an opaque value referring to an existential, "opens" the
39083908
/// existential by returning a pointer to a fresh archetype T, which also
39093909
/// captures the (dynamic) conformances.
39103910
class OpenExistentialOpaqueInst

include/swift/SIL/SILModule.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
// See https://swift.org/LICENSE.txt for license information
99
// See https://swift.org/CONTRIBUTORS.txt for the list of Swift project authors
1010
//
11-
//===---------------------------------------------------------------------===//
11+
//===----------------------------------------------------------------------===//
1212
//
1313
// This file defines the SILModule class.
1414
//

lib/AST/Decl.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3018,7 +3018,7 @@ void ProtocolDecl::computeRequirementSignature() {
30183018
genericSig->getRequirements().size() == 1;
30193019
if (!validSig) {
30203020
// This doesn't look like a protocol we can handle, so some other error must
3021-
// have occured (usually a protocol nested within another declaration)
3021+
// have occurred (usually a protocol nested within another declaration)
30223022
return;
30233023
}
30243024

lib/AST/GenericSignatureBuilder.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2225,14 +2225,14 @@ static void sameTypeDFS(PotentialArchetype *pa,
22252225
/// spanning tree among the connected components formed by only the implied
22262226
/// same-type requirements within the equivalence class of \c rep.
22272227
///
2228-
/// The equivalance class of the given representative potential archetype
2228+
/// The equivalence class of the given representative potential archetype
22292229
/// (\c rep) contains all potential archetypes that are made equivalent by
22302230
/// the known set of same-type constraints, which includes both directly-
22312231
/// stated same-type constraints (e.g., \c T.A == T.B) as well as same-type
22322232
/// constraints that are implied either because the names coincide (e.g.,
22332233
/// \c T[.P1].A == T[.P2].A) or due to a requirement in a protocol.
22342234
///
2235-
/// The equivalance class of the given representative potential archetype
2235+
/// The equivalence class of the given representative potential archetype
22362236
/// (\c rep) is formed from a graph whose vertices are the potential archetypes
22372237
/// and whose edges are the same-type constraints. These edges include both
22382238
/// directly-stated same-type constraints (e.g., \c T.A == T.B) as well as
@@ -2318,7 +2318,7 @@ void GenericSignatureBuilder::enumerateRequirements(llvm::function_ref<
23182318
compareDependentTypes);
23192319

23202320
// Track the anchors for each of the implied connected components within the
2321-
// equivalance class of each representative.
2321+
// equivalence class of each representative.
23222322
llvm::DenseMap<PotentialArchetype *, SmallVector<PotentialArchetype *, 2>>
23232323
sameTypeComponentAnchors;
23242324
auto getSameTypeComponentAnchors =
@@ -2346,7 +2346,7 @@ void GenericSignatureBuilder::enumerateRequirements(llvm::function_ref<
23462346
std::function<void()> deferredSameTypeRequirement;
23472347

23482348
if (knownAnchor != componentAnchors.end()) {
2349-
// If this equivalance class is bound to a concrete type, equate the
2349+
// If this equivalence class is bound to a concrete type, equate the
23502350
// anchor with a concrete type.
23512351
if (auto concreteType = rep->getConcreteType()) {
23522352
f(RequirementKind::SameType, archetype, concreteType,

lib/LLVMPasses/LLVMMergeFunctions.cpp

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ class SwiftFunctionComparator : FunctionComparator {
9393

9494
int cmpBasicBlocksIgnoringConsts(const BasicBlock *BBL, const BasicBlock *BBR);
9595

96-
int compareIngoringConsts();
96+
int compareIgnoringConsts();
9797
};
9898

9999
} // end anonymous namespace
@@ -179,7 +179,7 @@ cmpBasicBlocksIgnoringConsts(const BasicBlock *BBL, const BasicBlock *BBR) {
179179
}
180180

181181
// Test whether the two functions have equivalent behavior.
182-
int SwiftFunctionComparator::compareIngoringConsts() {
182+
int SwiftFunctionComparator::compareIgnoringConsts() {
183183
beginCompare();
184184

185185
if (int Res = compareSignature())
@@ -259,7 +259,7 @@ class SwiftMergeFunctions : public ModulePass {
259259
if (LHS.Hash != RHS.Hash)
260260
return LHS.Hash < RHS.Hash;
261261
SwiftFunctionComparator FCmp(LHS.First->F, RHS.First->F, GlobalNumbers);
262-
return FCmp.compareIngoringConsts() == -1;
262+
return FCmp.compareIgnoringConsts() == -1;
263263
}
264264
};
265265
typedef std::set<EquivalenceClass, FunctionNodeCmp> FnTreeType;
@@ -449,9 +449,9 @@ bool SwiftMergeFunctions::doSanityCheck(std::vector<WeakVH> &Worklist) {
449449
Function *F1 = cast<Function>(*I);
450450
Function *F2 = cast<Function>(*J);
451451
int Res1 = SwiftFunctionComparator(F1, F2, &GlobalNumbers).
452-
compareIngoringConsts();
452+
compareIgnoringConsts();
453453
int Res2 = SwiftFunctionComparator(F2, F1, &GlobalNumbers).
454-
compareIngoringConsts();
454+
compareIgnoringConsts();
455455

456456
// If F1 <= F2, then F2 >= F1, otherwise report failure.
457457
if (Res1 != -Res2) {
@@ -473,9 +473,9 @@ bool SwiftMergeFunctions::doSanityCheck(std::vector<WeakVH> &Worklist) {
473473

474474
Function *F3 = cast<Function>(*K);
475475
int Res3 = SwiftFunctionComparator(F1, F3, &GlobalNumbers).
476-
compareIngoringConsts();
476+
compareIgnoringConsts();
477477
int Res4 = SwiftFunctionComparator(F2, F3, &GlobalNumbers).
478-
compareIngoringConsts();
478+
compareIgnoringConsts();
479479

480480
bool Transitive = true;
481481

lib/SIL/SILOwnershipVerifier.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -811,8 +811,8 @@ OwnershipUseCheckerResult OwnershipCompatibilityUseChecker::visitNonTrivialEnum(
811811
OwnershipUseCheckerResult
812812
OwnershipCompatibilityUseChecker::visitApplyArgument(ValueOwnershipKind Kind,
813813
bool ShouldCheck) {
814-
// Check if we have an enum. If not, then we just check against the passed inc
815-
// onvention.
814+
// Check if we have an enum. If not, then we just check against the passed in
815+
// convention.
816816
EnumDecl *E = getType().getEnumOrBoundGenericEnum();
817817
if (!E) {
818818
return {compatibleWithOwnership(Kind), ShouldCheck};

lib/SIL/TransitivelyUnreachableBlocks.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
//===--- TransitivelyUnreachableBlocksInfo.h
2-
//----------------------------------===//
1+
//===--- TransitivelyUnreachableBlocks.h ------------------------*- C++ -*-===//
32
//
43
// This source file is part of the Swift.org open source project
54
//

lib/SILOptimizer/Mandatory/AddressLowering.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
//
33
// This source file is part of the Swift.org open source project
44
//
5-
// Copyright (c) 2014 - 2016 Apple Inc. and the Swift project authors
5+
// Copyright (c) 2014 - 2017 Apple Inc. and the Swift project authors
66
// Licensed under Apache License v2.0 with Runtime Library Exception
77
//
88
// See https://swift.org/LICENSE.txt for license information
@@ -487,7 +487,7 @@ void OpaqueStorageAllocation::allocateForResults(SILInstruction *origInst) {
487487
args[firstResultIdx] = addr;
488488
}
489489
// Allocate storage for any unused or concrete results. One for each missing
490-
// entry in the the SIL arguments list.
490+
// entry in the SIL arguments list.
491491
unsigned argIdx = firstResultIdx;
492492
for (SILType resultTy : loweredFnConv.getIndirectSILResultTypes()) {
493493
if (!args[argIdx]) {
@@ -529,7 +529,7 @@ void OpaqueStorageAllocation::allocateForResults(SILInstruction *origInst) {
529529
}
530530
origInst->replaceAllUsesWith(callInst);
531531
pass.instsToDelete.insert(origInst);
532-
// Load an concrete args, and mark the extract for deletion.
532+
// Load a concrete args, and mark the extract for deletion.
533533
for (TupleExtractInst *extract : concreteResults) {
534534
unsigned argIdx = firstResultIdx + extract->getFieldNo();
535535
SILValue arg = args[argIdx];

lib/SILOptimizer/Utils/Devirtualize.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -618,7 +618,7 @@ DevirtualizationResult swift::devirtualizeClassMethod(FullApplySite AI,
618618
}
619619

620620
auto ParamArgIter = AI.getArgumentsWithoutIndirectResults().begin();
621-
// Skip the last paramater, which is `self`. Add it below.
621+
// Skip the last parameter, which is `self`. Add it below.
622622
for (auto param : substConv.getParameters().drop_back()) {
623623
auto paramType = substConv.getSILType(param);
624624
NewArgs.push_back(

lib/SILOptimizer/Utils/Generics.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,7 @@ void ReabstractionInfo::createSubstitutedAndSpecializedTypes() {
200200

201201
// Produce a specialized type, which is the substituted type with
202202
// the parameters/results passing conventions adjusted according
203-
// to the converions selected above.
203+
// to the conversions selected above.
204204
SpecializedType = createSpecializedType(SubstitutedType, M);
205205
}
206206

@@ -748,7 +748,7 @@ SILArgument *ReabstractionThunkGenerator::convertReabstractionThunkArguments(
748748

749749
assert(specConv.useLoweredAddresses());
750750

751-
// ReInfo.NumIndirectResults correponds to SubstTy's formal indirect
751+
// ReInfo.NumIndirectResults corresponds to SubstTy's formal indirect
752752
// results. SpecTy may have fewer formal indirect results.
753753
assert(SubstType->getNumIndirectFormalResults()
754754
>= SpecType->getNumIndirectFormalResults());
@@ -763,7 +763,7 @@ SILArgument *ReabstractionThunkGenerator::convertReabstractionThunkArguments(
763763
EntryBB->createFunctionArgument(SpecArg->getType(), SpecArg->getDecl());
764764
Arguments.push_back(NewArg);
765765
};
766-
// ReInfo.NumIndirectResults correponds to SubstTy's formal indirect
766+
// ReInfo.NumIndirectResults corresponds to SubstTy's formal indirect
767767
// results. SpecTy may have fewer formal indirect results.
768768
assert(SubstType->getNumIndirectFormalResults()
769769
>= SpecType->getNumIndirectFormalResults());

stdlib/public/SDK/os/os_log.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@
7171

7272
typedef struct {
7373
os_log_fmt_cmd_flags_t cmd_flags : 4;
74-
os_log_fmt_cmd_type_t cmd_type : 4;
74+
os_log_fmt_cmd_type_t cmd_type : 4;
7575
uint8_t cmd_size;
7676
uint8_t cmd_data[];
7777
} os_log_fmt_cmd_s, *os_log_fmt_cmd_t;

stdlib/public/core/Builtin.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -677,7 +677,7 @@ func _trueAfterDiagnostics() -> Builtin.Int1 {
677677
/// // Smile! 😀
678678
///
679679
/// In this example, accessing the `text` property of the `smileyType` metatype
680-
/// retrieves the overriden value from the `EmojiSmiley` subclass, instead of
680+
/// retrieves the overridden value from the `EmojiSmiley` subclass, instead of
681681
/// the `Smiley` class's original definition.
682682
///
683683
/// Normally, you don't need to be aware of the difference between concrete and

stdlib/public/core/Collection.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -489,7 +489,7 @@ public struct IndexingIterator<
489489
/// You can access a slice of a collection through its ranged subscript or by
490490
/// calling methods like `prefix(_:)` or `suffix(from:)`. A slice of a
491491
/// collection can contain zero or more of the original collection's elements
492-
/// and shares the the original collection's semantics.
492+
/// and shares the original collection's semantics.
493493
///
494494
/// The following example, creates a `firstWord` constant by using the
495495
/// `prefix(_:)` method to get a slice of the `text` string's `characters`

stdlib/public/runtime/ImageInspectionELF.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -88,13 +88,13 @@ static int iteratePHDRCallback(struct dl_phdr_info *info,
8888
// While dl_iterate_phdr() is in progress it holds a lock to prevent other
8989
// images being loaded. The initialize flag is set here inside the callback so
9090
// that addNewDSOImage() sees a consistent state. If it was set outside the
91-
// dl_interate_phdr() call then it could result in images being missed or
91+
// dl_iterate_phdr() call then it could result in images being missed or
9292
// added twice.
9393
inspectArgs->didInitializeLookup = true;
9494

9595
if (fname == nullptr || fname[0] == '\0') {
9696
// The filename may be null for both the dynamic loader and main executable.
97-
// So ignore null image name here and explictly add the main executable
97+
// So ignore null image name here and explicitly add the main executable
9898
// in initialize*Lookup() to avoid adding the data twice.
9999
return 0;
100100
}
@@ -142,7 +142,7 @@ void swift::initializeTypeMetadataRecordLookup() {
142142

143143
// As ELF images are loaded, ImageInspectionInit:sectionDataInit() will call
144144
// addNewDSOImage() with an address in the image that can later be used via
145-
// dladdr() to dlopen() the image after the appropiate initialize*Lookup()
145+
// dladdr() to dlopen() the image after the appropriate initialize*Lookup()
146146
// function has been called.
147147
SWIFT_RUNTIME_EXPORT
148148
void swift_addNewDSOImage(const void *addr) {

test/IRGen/boxed_existential.sil

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,8 +61,8 @@ entry(%b : $Error):
6161

6262
struct Str : Error { }
6363

64-
// CHECK-LABEL: define{{( protected)?}} void @alloc_deallc_box_with_concrete_type
65-
sil @alloc_deallc_box_with_concrete_type : $@convention(thin) () -> () {
64+
// CHECK-LABEL: define{{( protected)?}} void @alloc_dealloc_box_with_concrete_type
65+
sil @alloc_dealloc_box_with_concrete_type : $@convention(thin) () -> () {
6666
bb0:
6767
// CHECK: call {{.*}} @swift_allocError
6868
%b = alloc_existential_box $Error, $Str

test/SILGen/materializeForSet.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -385,7 +385,7 @@ func inoutAccessOfStaticProperty<T : Beverage>(_ t: T.Type) {
385385
increment(&t.abv)
386386
}
387387

388-
// Test for materializeForSet vs overriden computed property of classes.
388+
// Test for materializeForSet vs overridden computed property of classes.
389389
class BaseForOverride {
390390
var valueStored: Int
391391
var valueComputed: Int { get { } set { } }

0 commit comments

Comments
 (0)