Skip to content

Commit c352f98

Browse files
authored
Merge pull request #9428 from practicalswift/gardening-20170509b
2 parents b8b62a2 + 8c40c65 commit c352f98

File tree

21 files changed

+36
-38
lines changed

21 files changed

+36
-38
lines changed

benchmark/scripts/compare_perf_tests.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -250,7 +250,7 @@ def table(title, results, is_strong=False, is_open=False):
250250
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
251251
<style>
252252
body {{ font-family: -apple-system, sans-serif; font-size: 14px; }}
253-
table {{ border-spacing: 2px; border-color: grey; border-spacing: 0;
253+
table {{ border-spacing: 2px; border-color: gray; border-spacing: 0;
254254
border-collapse: collapse; }}
255255
table tr {{ background-color: #fff; border-top: 1px solid #c6cbd1; }}
256256
table th, table td {{ padding: 6px 13px; border: 1px solid #dfe2e5; }}

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

benchmark/utils/TestsUtils.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ struct MyStruct : SomeProtocol {
6767
public func someProtocolFactory() -> SomeProtocol { return MyStruct() }
6868

6969
// Just consume the argument.
70-
// It's important that this function is in a another module than the tests
70+
// It's important that this function is in another module than the tests
7171
// which are using it.
7272
public func blackHole<T>(_ x: T) {
7373
}

include/swift/AST/Expr.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4858,7 +4858,7 @@ class KeyPathExpr : public Expr {
48584858
}
48594859
};
48604860

4861-
/// Represents the unusual behaviour of a . in a \ keypath expression, such as
4861+
/// Represents the unusual behavior of a . in a \ keypath expression, such as
48624862
/// \.[0] and \Foo.?.
48634863
class KeyPathDotExpr : public Expr {
48644864
SourceLoc DotLoc;

include/swift/AST/SourceEntityWalker.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ class SourceEntityWalker {
126126

127127
/// This method is called for each external argument name in function-like
128128
/// declarations like constructor, function and subscript. The function is
129-
/// called only when a external argument label is specifically specified,
129+
/// called only when an external argument label is specifically specified,
130130
/// like func foo(External Internal: Int) {}.
131131
/// If it returns false, the remaining traversal is terminated and returns
132132
/// failure.

include/swift/Parse/Parser.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1144,7 +1144,7 @@ class Parser {
11441144
bool isExprBasic);
11451145
ParserResult<Expr> parseExprPostfixSuffix(ParserResult<Expr> inner,
11461146
bool isExprBasic,
1147-
bool periodHasKeyPathBehaviour,
1147+
bool periodHasKeyPathBehavior,
11481148
bool &hasBindOptional);
11491149
ParserResult<Expr> parseExprPostfix(Diag<> ID, bool isExprBasic);
11501150
ParserResult<Expr> parseExprUnary(Diag<> ID, bool isExprBasic);

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
@@ -422,7 +422,7 @@ struct APIDiffMigratorPass : public ASTMigratorPass, public SourceEntityWalker {
422422
auto ArgLoc = PD->getArgumentNameLoc();
423423

424424
// If the argument name is not specified, add the argument name before
425-
// the paramter name.
425+
// the parameter name.
426426
if (ArgLoc.isInvalid())
427427
Editor.insertBefore(PD->getNameLoc(),
428428
(llvm::Twine(NewArg) + " ").str());

lib/Parse/ParseExpr.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -552,9 +552,9 @@ ParserResult<Expr> Parser::parseExprKeyPath() {
552552
bool unusedHasBindOptional = false;
553553

554554
// Inside a keypath's path, the period always behaves normally: the key path
555-
// behaviour is only the separation between type and path.
555+
// behavior is only the separation between type and path.
556556
pathResult = parseExprPostfixSuffix(inner, /*isExprBasic=*/true,
557-
/*periodHasKeyPathBehaviour=*/false,
557+
/*periodHasKeyPathBehavior=*/false,
558558
unusedHasBindOptional);
559559
if (pathResult.isParseError() || pathResult.hasCodeCompletion())
560560
return pathResult;
@@ -1062,7 +1062,7 @@ static bool canParseTypeOf(Parser &P) {
10621062

10631063
ParserResult<Expr>
10641064
Parser::parseExprPostfixSuffix(ParserResult<Expr> Result, bool isExprBasic,
1065-
bool periodHasKeyPathBehaviour,
1065+
bool periodHasKeyPathBehavior,
10661066
bool &hasBindOptional) {
10671067
hasBindOptional = false;
10681068

@@ -1078,7 +1078,7 @@ Parser::parseExprPostfixSuffix(ParserResult<Expr> Result, bool isExprBasic,
10781078
// A key path is special, because it allows .[, unlike anywhere else. The
10791079
// period itself should be left in the token stream. (.? and .! end up
10801080
// being operators, and so aren't handled here.)
1081-
if (periodHasKeyPathBehaviour && peekToken().is(tok::l_square)) {
1081+
if (periodHasKeyPathBehavior && peekToken().is(tok::l_square)) {
10821082
break;
10831083
}
10841084

@@ -1259,7 +1259,7 @@ Parser::parseExprPostfixSuffix(ParserResult<Expr> Result, bool isExprBasic,
12591259
if (Tok.is(tok::oper_postfix)) {
12601260
// KeyPaths are more restricted in what can go after a ., and so we treat
12611261
// them specially.
1262-
if (periodHasKeyPathBehaviour && startsWithSymbol(Tok, '.'))
1262+
if (periodHasKeyPathBehavior && startsWithSymbol(Tok, '.'))
12631263
break;
12641264

12651265
Expr *oper = parseExprOperator();
@@ -1738,7 +1738,7 @@ ParserResult<Expr> Parser::parseExprPostfix(Diag<> ID, bool isExprBasic) {
17381738

17391739
bool hasBindOptional = false;
17401740
Result = parseExprPostfixSuffix(Result, isExprBasic,
1741-
/*periodHasKeyPathBehaviour=*/InSwiftKeyPath,
1741+
/*periodHasKeyPathBehavior=*/InSwiftKeyPath,
17421742
hasBindOptional);
17431743
if (Result.isParseError() || Result.hasCodeCompletion())
17441744
return Result;

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/CSSolver.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2538,7 +2538,7 @@ bool ConstraintSystem::solveSimplified(
25382538

25392539
// Select a disjunction based on a few factors, prioritizing
25402540
// coercions and initializer disjunctions, followed by bind overload
2541-
// disjunctions with with fewest unbound argument types.
2541+
// disjunctions with fewest unbound argument types.
25422542
Optional<Constraint *> selection;
25432543
Optional<unsigned> lowestUnbound;
25442544
Optional<unsigned> lowestActive;

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
}

test/stdlib/TestDecimal.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -420,7 +420,7 @@ class TestDecimal : TestDecimalSuper {
420420
expectEqual(0, result._isNegative, "0 * -1")
421421
}
422422

423-
func test_Normalise() {
423+
func test_Normalize() {
424424
var one = Decimal(1)
425425
var ten = Decimal(-10)
426426
expectEqual(.noError, NSDecimalNormalize(&one, &ten, .plain))
@@ -598,7 +598,7 @@ DecimalTests.test("test_Misc") { TestDecimal().test_Misc() }
598598
DecimalTests.test("test_MultiplicationOverflow") { TestDecimal().test_MultiplicationOverflow() }
599599
DecimalTests.test("test_NaNInput") { TestDecimal().test_NaNInput() }
600600
DecimalTests.test("test_NegativeAndZeroMultiplication") { TestDecimal().test_NegativeAndZeroMultiplication() }
601-
DecimalTests.test("test_Normalise") { TestDecimal().test_Normalise() }
601+
DecimalTests.test("test_Normalize") { TestDecimal().test_Normalize() }
602602
DecimalTests.test("test_NSDecimal") { TestDecimal().test_NSDecimal() }
603603
DecimalTests.test("test_RepeatingDivision") { TestDecimal().test_RepeatingDivision() }
604604
DecimalTests.test("test_Round") { TestDecimal().test_Round() }

tools/SourceKit/docs/Protocol.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -637,7 +637,7 @@ To gather documentation, SourceKit must be given either the name of a module (ke
637637
// these must include the path to that file.
638638
[opt] <key.cancel_on_subsequent_request>: (int64) // Whether this request should be canceled if a
639639
// new cursor-info request is made that uses the same AST.
640-
// This behaviour is a workaround for not having first-class
640+
// This behavior is a workaround for not having first-class
641641
// cancelation. For backwards compatibility, the default is 1.
642642
}
643643
```
Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,2 @@
11
// RUN: not %target-sil-opt %s
2-
// REQUIRES: asserts
32
class C}sil_vtable C{#C

0 commit comments

Comments
 (0)