Skip to content

Commit 8c40c65

Browse files
[gardening] Fix typos.
1 parent 764ce41 commit 8c40c65

File tree

11 files changed

+21
-22
lines changed

11 files changed

+21
-22
lines changed

benchmark/single-source/SortLargeExistentials.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ protocol LetterKind {
1919
func lessthan(_ rhs: LetterKind) -> Bool
2020
}
2121

22-
// A struct which exeeds the size of the existential inline buffer.
22+
// A struct which exceeds the size of the existential inline buffer.
2323
struct Letter : LetterKind {
2424
let value: String
2525

include/swift/SIL/SILModule.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,7 @@ class SILModule {
191191
/// The callback used by the SILLoader.
192192
std::unique_ptr<SerializationCallback> Callback;
193193

194-
// Callbacks registered by the SIL optimizer to run on each deserializaed
194+
// Callbacks registered by the SIL optimizer to run on each deserialized
195195
// function body. This is intentionally a stateless type because the
196196
// ModuleDecl and SILFunction should be sufficient context.
197197
typedef void (*SILFunctionBodyCallback)(ModuleDecl *, SILFunction *F);

lib/AST/ProtocolConformance.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -495,7 +495,7 @@ NormalProtocolConformance::getTypeWitnessAndDecl(AssociatedTypeDecl *assocType,
495495
return { witnessType, nullptr };
496496
}
497497

498-
// Otherwise, we fail; this is the only case in which we can retturn a
498+
// Otherwise, we fail; this is the only case in which we can return a
499499
// null type.
500500
return { Type(), nullptr };
501501
}

lib/IRGen/LoadableByAddress.cpp

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
//===--- LoadableByAddress.cpp - Lower SIL address-only types.
2-
//--------------===//
1+
//===--- LoadableByAddress.cpp - Lower SIL address-only types. ------------===//
32
//
43
// This source file is part of the Swift.org open source project
54
//
@@ -211,7 +210,7 @@ static SILType getNewSILFunctionType(GenericEnvironment *GenericEnv,
211210
return newSILType;
212211
}
213212

214-
// Get the funciton type or the optional function type
213+
// Get the function type or the optional function type
215214
static SILFunctionType *getInnerFunctionType(SILType storageType) {
216215
CanType currCanType = storageType.getSwiftRValueType();
217216
if (SILFunctionType *currSILFunctionType =
@@ -982,19 +981,19 @@ void LoadableStorageAllocation::replaceLoadWithCopyAddrForModifiable(
982981

983982
void LoadableStorageAllocation::allocateLoadableStorage() {
984983
if (modifiableFunction(pass.F->getLoweredFunctionType())) {
985-
// Turn by-vlaue function args to by-address ones
984+
// Turn by-value function args to by-address ones
986985
convertIndirectFunctionArgs();
987986
} else {
988987
convertIndirectFunctionPointerArgsForUnmodifiable();
989988
}
990989

991-
// Turn by-vlaue BB args to by-address ones
990+
// Turn by-value BB args to by-address ones
992991
convertIndirectBasicBlockArgs();
993992

994993
// Populate the pass' data structs
995994
LargeValueVisitor(pass).mapValueStorage();
996995

997-
// Create an AllocStack for every used large loadble type in the function.
996+
// Create an AllocStack for every used large loadable type in the function.
998997
for (auto &argToAlloc : pass.argsToLoadedValueMap) {
999998
assert(argToAlloc.first == argToAlloc.second);
1000999
allocateForArg(argToAlloc.first);
@@ -1234,7 +1233,7 @@ static void allocateAndSetForArgumentOperand(StructLoweringState &pass,
12341233
SILInstruction *applyInst) {
12351234
assert(value->getType().isObject());
12361235
auto *arg = dyn_cast<SILArgument>(value);
1237-
assert(arg && "non-instr operand must be an argmuent");
1236+
assert(arg && "non-instr operand must be an argument");
12381237

12391238
SILBuilder allocBuilder(pass.F->begin()->begin());
12401239
AllocStackInst *allocInstr =
@@ -1318,7 +1317,7 @@ static void castTupleInstr(SILInstruction *instr, IRGenModule &Mod) {
13181317
SILType currSILType = instr->getType().getObjectType();
13191318
CanType currCanType = currSILType.getSwiftRValueType();
13201319
SILFunctionType *funcType = dyn_cast<SILFunctionType>(currCanType);
1321-
assert(funcType && "Expcted SILFunctionType as tuple's return");
1320+
assert(funcType && "Expected SILFunctionType as tuple's return");
13221321
CanSILFunctionType canFuncType = CanSILFunctionType(funcType);
13231322
GenericEnvironment *genEnv = instr->getFunction()->getGenericEnvironment();
13241323
if (!genEnv && canFuncType->isPolymorphic()) {
@@ -1975,7 +1974,7 @@ void LoadableByAddress::recreateConvInstrs() {
19751974
break;
19761975
}
19771976
default:
1978-
llvm_unreachable("Unexected conversion instruction");
1977+
llvm_unreachable("Unexpected conversion instruction");
19791978
}
19801979
convInstr->replaceAllUsesWith(newInstr);
19811980
convInstr->getParent()->erase(convInstr);
@@ -2012,7 +2011,7 @@ void LoadableByAddress::run() {
20122011
return;
20132012
}
20142013

2015-
// Scan the module for all refrences of the modified functions:
2014+
// Scan the module for all references of the modified functions:
20162015
llvm::SetVector<FunctionRefInst *> funcRefs;
20172016
for (SILFunction &CurrF : *getModule()) {
20182017
for (SILBasicBlock &BB : CurrF) {
@@ -2090,7 +2089,7 @@ void LoadableByAddress::run() {
20902089
updateLoweredTypes(F);
20912090
}
20922091

2093-
// Update all refrences:
2092+
// Update all references:
20942093
// Note: We don't need to update the witness tables and vtables
20952094
// They just contain a pointer to the function
20962095
// The pointer does not change

lib/Migrator/APIDiffMigratorPass.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -413,7 +413,7 @@ struct APIDiffMigratorPass : public ASTMigratorPass, public SourceEntityWalker {
413413
auto ArgLoc = PD->getArgumentNameLoc();
414414

415415
// If the argument name is not specified, add the argument name before
416-
// the paramter name.
416+
// the parameter name.
417417
if (ArgLoc.isInvalid())
418418
Editor.insertBefore(PD->getNameLoc(),
419419
(llvm::Twine(NewArg) + " ").str());

lib/SIL/SILVerifier.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -833,7 +833,7 @@ class SILVerifier : public SILVerifierBase<SILVerifier> {
833833
if (!A)
834834
return;
835835
require(isArchetypeValidInFunction(A, &F),
836-
"Replacment type of a substitution contains an ArchetypeType "
836+
"Replacement type of a substitution contains an ArchetypeType "
837837
"that does not exist in the Caller's generic param list.");
838838
});
839839
}

lib/SILOptimizer/Transforms/AllocBoxToStack.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -435,7 +435,7 @@ static void replaceProjectBoxUsers(SILValue HeapBox, SILValue StackBox) {
435435
while (!Worklist.empty()) {
436436
auto *Op = Worklist.pop_back_val();
437437
if (auto *PBI = dyn_cast<ProjectBoxInst>(Op->getUser())) {
438-
// This may result in an alloc_stack being used by begin_access [dymaic].
438+
// This may result in an alloc_stack being used by begin_access [dynamic].
439439
PBI->replaceAllUsesWith(StackBox);
440440
continue;
441441
}

lib/Sema/TypeCheckSwitchStmt.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -559,7 +559,7 @@ namespace {
559559
return *this;
560560
}
561561

562-
// If one constructor parameter doens't cover the other then we've
562+
// If one constructor parameter doesn't cover the other then we've
563563
// got to report the uncovered cases in a user-friendly way.
564564
if (!s1.isSubspace(s2, TC)) {
565565
foundBad = true;

lib/Serialization/SerializeSIL.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1888,7 +1888,7 @@ void SILSerializer::writeSILInstruction(const SILInstruction &SI) {
18881888
ListOfValues.push_back(
18891889
addSILFunctionRef(component.getComputedPropertyGetter()));
18901890
assert(component.getComputedPropertyIndices().empty()
1891-
&& "indices not implemnted");
1891+
&& "indices not implemented");
18921892
break;
18931893
case KeyPathPatternComponent::Kind::SettableProperty:
18941894
handleComponentCommon(KeyPathComponentKindEncoding::SettableProperty);
@@ -1898,7 +1898,7 @@ void SILSerializer::writeSILInstruction(const SILInstruction &SI) {
18981898
ListOfValues.push_back(
18991899
addSILFunctionRef(component.getComputedPropertySetter()));
19001900
assert(component.getComputedPropertyIndices().empty()
1901-
&& "indices not implemnted");
1901+
&& "indices not implemented");
19021902
break;
19031903
}
19041904
}

stdlib/public/core/UIntBuffer.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
//===--- UIntBuffer.swift - Bounded Collection of Unisigned Integer -------===//
1+
//===--- UIntBuffer.swift - Bounded Collection of Unsigned Integer --------===//
22
//
33
// This source file is part of the Swift.org open source project
44
//

test/Interpreter/enforce_exclusive_access.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ func readAndPerform<T>(_ _: UnsafePointer<T>, closure: () ->()) {
2121
closure()
2222
}
2323

24-
/// Begin a modify access to the first paraemter and call the closure inside it.
24+
/// Begin a modify access to the first parameter and call the closure inside it.
2525
func modifyAndPerform<T>(_ _: UnsafeMutablePointer<T>, closure: () ->()) {
2626
closure()
2727
}

0 commit comments

Comments
 (0)