Skip to content

[gardening] Fix typos. Remove asserts requirement from fixed crasher. #9428

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 5 commits into from
May 9, 2017
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
2 changes: 1 addition & 1 deletion benchmark/scripts/compare_perf_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,7 @@ def table(title, results, is_strong=False, is_open=False):
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<style>
body {{ font-family: -apple-system, sans-serif; font-size: 14px; }}
table {{ border-spacing: 2px; border-color: grey; border-spacing: 0;
table {{ border-spacing: 2px; border-color: gray; border-spacing: 0;
border-collapse: collapse; }}
table tr {{ background-color: #fff; border-top: 1px solid #c6cbd1; }}
table th, table td {{ padding: 6px 13px; border: 1px solid #dfe2e5; }}
Expand Down
2 changes: 1 addition & 1 deletion benchmark/single-source/SortLargeExistentials.swift
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ protocol LetterKind {
func lessthan(_ rhs: LetterKind) -> Bool
}

// A struct which exeeds the size of the existential inline buffer.
// A struct which exceeds the size of the existential inline buffer.
struct Letter : LetterKind {
let value: String

Expand Down
2 changes: 1 addition & 1 deletion benchmark/utils/TestsUtils.swift
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ struct MyStruct : SomeProtocol {
public func someProtocolFactory() -> SomeProtocol { return MyStruct() }

// Just consume the argument.
// It's important that this function is in a another module than the tests
// It's important that this function is in another module than the tests
// which are using it.
public func blackHole<T>(_ x: T) {
}
Expand Down
2 changes: 1 addition & 1 deletion include/swift/AST/Expr.h
Original file line number Diff line number Diff line change
Expand Up @@ -4858,7 +4858,7 @@ class KeyPathExpr : public Expr {
}
};

/// Represents the unusual behaviour of a . in a \ keypath expression, such as
/// Represents the unusual behavior of a . in a \ keypath expression, such as
/// \.[0] and \Foo.?.
class KeyPathDotExpr : public Expr {
SourceLoc DotLoc;
Expand Down
2 changes: 1 addition & 1 deletion include/swift/AST/SourceEntityWalker.h
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ class SourceEntityWalker {

/// This method is called for each external argument name in function-like
/// declarations like constructor, function and subscript. The function is
/// called only when a external argument label is specifically specified,
/// called only when an external argument label is specifically specified,
/// like func foo(External Internal: Int) {}.
/// If it returns false, the remaining traversal is terminated and returns
/// failure.
Expand Down
2 changes: 1 addition & 1 deletion include/swift/Parse/Parser.h
Original file line number Diff line number Diff line change
Expand Up @@ -1144,7 +1144,7 @@ class Parser {
bool isExprBasic);
ParserResult<Expr> parseExprPostfixSuffix(ParserResult<Expr> inner,
bool isExprBasic,
bool periodHasKeyPathBehaviour,
bool periodHasKeyPathBehavior,
bool &hasBindOptional);
ParserResult<Expr> parseExprPostfix(Diag<> ID, bool isExprBasic);
ParserResult<Expr> parseExprUnary(Diag<> ID, bool isExprBasic);
Expand Down
2 changes: 1 addition & 1 deletion include/swift/SIL/SILModule.h
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ class SILModule {
/// The callback used by the SILLoader.
std::unique_ptr<SerializationCallback> Callback;

// Callbacks registered by the SIL optimizer to run on each deserializaed
// Callbacks registered by the SIL optimizer to run on each deserialized
// function body. This is intentionally a stateless type because the
// ModuleDecl and SILFunction should be sufficient context.
typedef void (*SILFunctionBodyCallback)(ModuleDecl *, SILFunction *F);
Expand Down
2 changes: 1 addition & 1 deletion lib/AST/ProtocolConformance.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -495,7 +495,7 @@ NormalProtocolConformance::getTypeWitnessAndDecl(AssociatedTypeDecl *assocType,
return { witnessType, nullptr };
}

// Otherwise, we fail; this is the only case in which we can retturn a
// Otherwise, we fail; this is the only case in which we can return a
// null type.
return { Type(), nullptr };
}
Expand Down
21 changes: 10 additions & 11 deletions lib/IRGen/LoadableByAddress.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
//===--- LoadableByAddress.cpp - Lower SIL address-only types.
//--------------===//
//===--- LoadableByAddress.cpp - Lower SIL address-only types. ------------===//
//
// This source file is part of the Swift.org open source project
//
Expand Down Expand Up @@ -211,7 +210,7 @@ static SILType getNewSILFunctionType(GenericEnvironment *GenericEnv,
return newSILType;
}

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

void LoadableStorageAllocation::allocateLoadableStorage() {
if (modifiableFunction(pass.F->getLoweredFunctionType())) {
// Turn by-vlaue function args to by-address ones
// Turn by-value function args to by-address ones
convertIndirectFunctionArgs();
} else {
convertIndirectFunctionPointerArgsForUnmodifiable();
}

// Turn by-vlaue BB args to by-address ones
// Turn by-value BB args to by-address ones
convertIndirectBasicBlockArgs();

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

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

SILBuilder allocBuilder(pass.F->begin()->begin());
AllocStackInst *allocInstr =
Expand Down Expand Up @@ -1318,7 +1317,7 @@ static void castTupleInstr(SILInstruction *instr, IRGenModule &Mod) {
SILType currSILType = instr->getType().getObjectType();
CanType currCanType = currSILType.getSwiftRValueType();
SILFunctionType *funcType = dyn_cast<SILFunctionType>(currCanType);
assert(funcType && "Expcted SILFunctionType as tuple's return");
assert(funcType && "Expected SILFunctionType as tuple's return");
CanSILFunctionType canFuncType = CanSILFunctionType(funcType);
GenericEnvironment *genEnv = instr->getFunction()->getGenericEnvironment();
if (!genEnv && canFuncType->isPolymorphic()) {
Expand Down Expand Up @@ -1975,7 +1974,7 @@ void LoadableByAddress::recreateConvInstrs() {
break;
}
default:
llvm_unreachable("Unexected conversion instruction");
llvm_unreachable("Unexpected conversion instruction");
}
convInstr->replaceAllUsesWith(newInstr);
convInstr->getParent()->erase(convInstr);
Expand Down Expand Up @@ -2012,7 +2011,7 @@ void LoadableByAddress::run() {
return;
}

// Scan the module for all refrences of the modified functions:
// Scan the module for all references of the modified functions:
llvm::SetVector<FunctionRefInst *> funcRefs;
for (SILFunction &CurrF : *getModule()) {
for (SILBasicBlock &BB : CurrF) {
Expand Down Expand Up @@ -2090,7 +2089,7 @@ void LoadableByAddress::run() {
updateLoweredTypes(F);
}

// Update all refrences:
// Update all references:
// Note: We don't need to update the witness tables and vtables
// They just contain a pointer to the function
// The pointer does not change
Expand Down
2 changes: 1 addition & 1 deletion lib/Migrator/APIDiffMigratorPass.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -413,7 +413,7 @@ struct APIDiffMigratorPass : public ASTMigratorPass, public SourceEntityWalker {
auto ArgLoc = PD->getArgumentNameLoc();

// If the argument name is not specified, add the argument name before
// the paramter name.
// the parameter name.
if (ArgLoc.isInvalid())
Editor.insertBefore(PD->getNameLoc(),
(llvm::Twine(NewArg) + " ").str());
Expand Down
12 changes: 6 additions & 6 deletions lib/Parse/ParseExpr.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -552,9 +552,9 @@ ParserResult<Expr> Parser::parseExprKeyPath() {
bool unusedHasBindOptional = false;

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

ParserResult<Expr>
Parser::parseExprPostfixSuffix(ParserResult<Expr> Result, bool isExprBasic,
bool periodHasKeyPathBehaviour,
bool periodHasKeyPathBehavior,
bool &hasBindOptional) {
hasBindOptional = false;

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

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

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

bool hasBindOptional = false;
Result = parseExprPostfixSuffix(Result, isExprBasic,
/*periodHasKeyPathBehaviour=*/InSwiftKeyPath,
/*periodHasKeyPathBehavior=*/InSwiftKeyPath,
hasBindOptional);
if (Result.isParseError() || Result.hasCodeCompletion())
return Result;
Expand Down
2 changes: 1 addition & 1 deletion lib/SIL/SILVerifier.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -833,7 +833,7 @@ class SILVerifier : public SILVerifierBase<SILVerifier> {
if (!A)
return;
require(isArchetypeValidInFunction(A, &F),
"Replacment type of a substitution contains an ArchetypeType "
"Replacement type of a substitution contains an ArchetypeType "
"that does not exist in the Caller's generic param list.");
});
}
Expand Down
2 changes: 1 addition & 1 deletion lib/SILOptimizer/Transforms/AllocBoxToStack.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -435,7 +435,7 @@ static void replaceProjectBoxUsers(SILValue HeapBox, SILValue StackBox) {
while (!Worklist.empty()) {
auto *Op = Worklist.pop_back_val();
if (auto *PBI = dyn_cast<ProjectBoxInst>(Op->getUser())) {
// This may result in an alloc_stack being used by begin_access [dymaic].
// This may result in an alloc_stack being used by begin_access [dynamic].
PBI->replaceAllUsesWith(StackBox);
continue;
}
Expand Down
2 changes: 1 addition & 1 deletion lib/Sema/CSSolver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2538,7 +2538,7 @@ bool ConstraintSystem::solveSimplified(

// Select a disjunction based on a few factors, prioritizing
// coercions and initializer disjunctions, followed by bind overload
// disjunctions with with fewest unbound argument types.
// disjunctions with fewest unbound argument types.
Optional<Constraint *> selection;
Optional<unsigned> lowestUnbound;
Optional<unsigned> lowestActive;
Expand Down
2 changes: 1 addition & 1 deletion lib/Sema/TypeCheckSwitchStmt.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -559,7 +559,7 @@ namespace {
return *this;
}

// If one constructor parameter doens't cover the other then we've
// If one constructor parameter doesn't cover the other then we've
// got to report the uncovered cases in a user-friendly way.
if (!s1.isSubspace(s2, TC)) {
foundBad = true;
Expand Down
4 changes: 2 additions & 2 deletions lib/Serialization/SerializeSIL.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1888,7 +1888,7 @@ void SILSerializer::writeSILInstruction(const SILInstruction &SI) {
ListOfValues.push_back(
addSILFunctionRef(component.getComputedPropertyGetter()));
assert(component.getComputedPropertyIndices().empty()
&& "indices not implemnted");
&& "indices not implemented");
break;
case KeyPathPatternComponent::Kind::SettableProperty:
handleComponentCommon(KeyPathComponentKindEncoding::SettableProperty);
Expand All @@ -1898,7 +1898,7 @@ void SILSerializer::writeSILInstruction(const SILInstruction &SI) {
ListOfValues.push_back(
addSILFunctionRef(component.getComputedPropertySetter()));
assert(component.getComputedPropertyIndices().empty()
&& "indices not implemnted");
&& "indices not implemented");
break;
}
}
Expand Down
2 changes: 1 addition & 1 deletion stdlib/public/core/UIntBuffer.swift
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//===--- UIntBuffer.swift - Bounded Collection of Unisigned Integer -------===//
//===--- UIntBuffer.swift - Bounded Collection of Unsigned Integer --------===//
//
// This source file is part of the Swift.org open source project
//
Expand Down
2 changes: 1 addition & 1 deletion test/Interpreter/enforce_exclusive_access.swift
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ func readAndPerform<T>(_ _: UnsafePointer<T>, closure: () ->()) {
closure()
}

/// Begin a modify access to the first paraemter and call the closure inside it.
/// Begin a modify access to the first parameter and call the closure inside it.
func modifyAndPerform<T>(_ _: UnsafeMutablePointer<T>, closure: () ->()) {
closure()
}
Expand Down
4 changes: 2 additions & 2 deletions test/stdlib/TestDecimal.swift
Original file line number Diff line number Diff line change
Expand Up @@ -420,7 +420,7 @@ class TestDecimal : TestDecimalSuper {
expectEqual(0, result._isNegative, "0 * -1")
}

func test_Normalise() {
func test_Normalize() {
var one = Decimal(1)
var ten = Decimal(-10)
expectEqual(.noError, NSDecimalNormalize(&one, &ten, .plain))
Expand Down Expand Up @@ -598,7 +598,7 @@ DecimalTests.test("test_Misc") { TestDecimal().test_Misc() }
DecimalTests.test("test_MultiplicationOverflow") { TestDecimal().test_MultiplicationOverflow() }
DecimalTests.test("test_NaNInput") { TestDecimal().test_NaNInput() }
DecimalTests.test("test_NegativeAndZeroMultiplication") { TestDecimal().test_NegativeAndZeroMultiplication() }
DecimalTests.test("test_Normalise") { TestDecimal().test_Normalise() }
DecimalTests.test("test_Normalize") { TestDecimal().test_Normalize() }
DecimalTests.test("test_NSDecimal") { TestDecimal().test_NSDecimal() }
DecimalTests.test("test_RepeatingDivision") { TestDecimal().test_RepeatingDivision() }
DecimalTests.test("test_Round") { TestDecimal().test_Round() }
Expand Down
2 changes: 1 addition & 1 deletion tools/SourceKit/docs/Protocol.md
Original file line number Diff line number Diff line change
Expand Up @@ -637,7 +637,7 @@ To gather documentation, SourceKit must be given either the name of a module (ke
// these must include the path to that file.
[opt] <key.cancel_on_subsequent_request>: (int64) // Whether this request should be canceled if a
// new cursor-info request is made that uses the same AST.
// This behaviour is a workaround for not having first-class
// This behavior is a workaround for not having first-class
// cancelation. For backwards compatibility, the default is 1.
}
```
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
// RUN: not %target-sil-opt %s
// REQUIRES: asserts
class C}sil_vtable C{#C