Skip to content

Commit 268c2b6

Browse files
authored
Merge pull request #6325 from practicalswift/gardening-20161216
2 parents 370ad9d + e143e5e commit 268c2b6

32 files changed

+76
-66
lines changed

docs/ABI.rst

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -744,8 +744,8 @@ character.
744744
Some less important operators are longer and may also contain one or more
745745
natural numbers. But it's always important that the demangler can identify the
746746
end (the last character) of an operator. For example, it's not possible to
747-
determince the last character if there are two operators ``M`` and ``Ma``:
748-
``a`` could belong to ``M`` or it could be the first charater of the next
747+
determine the last character if there are two operators ``M`` and ``Ma``:
748+
``a`` could belong to ``M`` or it could be the first character of the next
749749
operator.
750750

751751
The intention of the post-fix order is to optimize for common pre-fixes.
@@ -766,7 +766,7 @@ Globals
766766
global ::= type 'MP' // type metadata pattern
767767
global ::= type 'Ma' // type metadata access function
768768
global ::= type 'ML' // type metadata lazy cache variable
769-
global ::= nomianl-type 'Mm' // class metaclass
769+
global ::= nominal-type 'Mm' // class metaclass
770770
global ::= nominal-type 'Mn' // nominal type descriptor
771771
global ::= protocol 'Mp' // protocol descriptor
772772
global ::= type 'MF' // metadata for remote mirrors: field descriptor
@@ -1171,7 +1171,7 @@ values indicates a single generic parameter at the outermost depth::
11711171
x_xCru // <T_0_0> T_0_0 -> T_0_0
11721172
d_0__xCr_0_u // <T_0_0><T_1_0, T_1_1> T_0_0 -> T_1_1
11731173

1174-
A generic signature must only preceed an operator character which is different
1174+
A generic signature must only precede an operator character which is different
11751175
from any character in a ``<GENERIC-PARAM-COUNT>``.
11761176

11771177
Identifiers
@@ -1222,7 +1222,7 @@ A maximum of 26 words in a mangling can be used for substitutions.
12221222

12231223
::
12241224

1225-
identifier ::= '00' natural '_'? IDENTIFIER-CHAR+ // '_' is inserted if the identifer starts with a digit or '_'.
1225+
identifier ::= '00' natural '_'? IDENTIFIER-CHAR+ // '_' is inserted if the identifier starts with a digit or '_'.
12261226

12271227
Identifiers that contain non-ASCII characters are encoded using the Punycode
12281228
algorithm specified in RFC 3492, with the modifications that ``_`` is used
@@ -1274,7 +1274,7 @@ Substitutions
12741274

12751275
::
12761276

1277-
substitution ::= 'A' INDEX // substiution of N+26
1277+
substitution ::= 'A' INDEX // substitution of N+26
12781278
substitution ::= 'A' [a-z]* [A-Z] // One or more consecutive substitutions of N < 26
12791279

12801280

@@ -1346,7 +1346,7 @@ The type is the function type of the specialized function.
13461346
specialization ::= spec-arg* 'Tf' SPEC-INFO ARG-SPEC-KIND* '_' ARG-SPEC-KIND // Function signature specialization kind
13471347

13481348
The ``<ARG-SPEC-KIND>`` describes how arguments are specialized.
1349-
Some kinds need arguments, which preceed ``Tf``.
1349+
Some kinds need arguments, which precede ``Tf``.
13501350

13511351
::
13521352

include/swift/AST/ASTMangler.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ class ASTMangler : public Mangler {
109109
std::string mangleGlobalInit(const VarDecl *decl, int counter,
110110
bool isInitFunc);
111111

112-
std::string mangleReabstructionThunkHelper(CanSILFunctionType ThunkType,
112+
std::string mangleReabstractionThunkHelper(CanSILFunctionType ThunkType,
113113
Type FromType, Type ToType,
114114
ModuleDecl *Module);
115115

include/swift/AST/Decl.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4051,7 +4051,7 @@ class AbstractStorageDecl : public ValueDecl {
40514051
return OverriddenDecl;
40524052
}
40534053
void setOverriddenDecl(AbstractStorageDecl *over) {
4054-
// FIXME: Hack due to broken class circulatity checking.
4054+
// FIXME: Hack due to broken class circularity checking.
40554055
if (over == this) return;
40564056
OverriddenDecl = over;
40574057
over->setIsOverridden();
@@ -5168,7 +5168,7 @@ class FuncDecl final : public AbstractFunctionDecl,
51685168
return OverriddenOrBehaviorParamDecl.dyn_cast<FuncDecl *>();
51695169
}
51705170
void setOverriddenDecl(FuncDecl *over) {
5171-
// FIXME: Hack due to broken class circulatity checking.
5171+
// FIXME: Hack due to broken class circularity checking.
51725172
if (over == this) return;
51735173

51745174
// A function cannot be an override if it is also a derived global decl
@@ -5598,7 +5598,7 @@ class ConstructorDecl : public AbstractFunctionDecl {
55985598

55995599
ConstructorDecl *getOverriddenDecl() const { return OverriddenDecl; }
56005600
void setOverriddenDecl(ConstructorDecl *over) {
5601-
// FIXME: Hack due to broken class circulatity checking.
5601+
// FIXME: Hack due to broken class circularity checking.
56025602
if (over == this) return;
56035603

56045604
OverriddenDecl = over;

include/swift/AST/Pattern.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ class alignas(8) Pattern {
131131
/// Set the type of this pattern as an interface type whose resolution to
132132
/// a context type will be performed lazily.
133133
///
134-
/// \param dc The context in whch the type will be resolved.
134+
/// \param dc The context in which the type will be resolved.
135135
void setDelayedInterfaceType(Type interfaceTy, DeclContext *dc);
136136

137137
/// Overwrite the type of this pattern.

include/swift/AST/StmtTransformer.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55
// Copyright (c) 2014 - 2016 Apple Inc. and the Swift project authors
66
// Licensed under Apache License v2.0 with Runtime Library Exception
77
//
8-
// See http://swift.org/LICENSE.txt for license information
9-
// See http://swift.org/CONTRIBUTORS.txt for the list of Swift project authors
8+
// See https://swift.org/LICENSE.txt for license information
9+
// See https://swift.org/CONTRIBUTORS.txt for the list of Swift project authors
1010
//
1111
//===----------------------------------------------------------------------===//
1212
//

include/swift/Basic/ManglingUtils.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,7 @@ void mangleIdentifier(Mangler &M, StringRef ident) {
205205
if (Idx < End - 2) {
206206
M.Buffer << (char)(Repl.WordIdx + 'a');
207207
} else {
208-
// The last word substitution is a captial letter.
208+
// The last word substitution is a capital letter.
209209
M.Buffer << (char)(Repl.WordIdx + 'A');
210210
if (Pos == ident.size())
211211
M.Buffer << '0';

include/swift/Basic/Punycode.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
// - Encoding digits are represented using [a-zA-J] instead of [a-z0-9], because
1919
// symbol names are case-sensitive, and Swift mangled identifiers cannot begin
2020
// with a digit.
21-
// - Optinally, non-symbol ASCII characters (characters except [$_a-zA-Z0-9])
21+
// - Optionally, non-symbol ASCII characters (characters except [$_a-zA-Z0-9])
2222
// are mapped to the code range 0xD800 - 0xD880 and are also encoded like
2323
// non-ASCII unicode characters.
2424
//

include/swift/Basic/Unreachable.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
//===--- Unreachable.h - Implements swift_unrachable ------------*- C++ -*-===//
1+
//===--- Unreachable.h - Implements swift_unreachable -----------*- C++ -*-===//
22
//
33
// This source file is part of the Swift.org open source project
44
//

include/swift/SIL/SILInstruction.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1766,7 +1766,7 @@ class BeginBorrowInst
17661766
};
17671767

17681768
/// Represents a store of a borrowed value into an address. Returns the borrowed
1769-
/// address. Must be paired with a end_borrow in its use-def list.
1769+
/// address. Must be paired with an end_borrow in its use-def list.
17701770
class StoreBorrowInst : public SILInstruction {
17711771
friend class SILBuilder;
17721772

include/swift/SILOptimizer/PassManager/PassPipeline.def

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55
// Copyright (c) 2014 - 2016 Apple Inc. and the Swift project authors
66
// Licensed under Apache License v2.0 with Runtime Library Exception
77
//
8-
// See http://swift.org/LICENSE.txt for license information
9-
// See http://swift.org/CONTRIBUTORS.txt for the list of Swift project authors
8+
// See https://swift.org/LICENSE.txt for license information
9+
// See https://swift.org/CONTRIBUTORS.txt for the list of Swift project authors
1010
//
1111
//===----------------------------------------------------------------------===//
1212
///

include/swift/SILOptimizer/PassManager/PassPipeline.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
//===--- PassPipeline.h ---------------------------------------------------===//
1+
//===--- PassPipeline.h -----------------------------------------*- C++ -*-===//
22
//
33
// This source file is part of the Swift.org open source project
44
//
55
// Copyright (c) 2014 - 2016 Apple Inc. and the Swift project authors
66
// Licensed under Apache License v2.0 with Runtime Library Exception
77
//
8-
// See http://swift.org/LICENSE.txt for license information
9-
// See http://swift.org/CONTRIBUTORS.txt for the list of Swift project authors
8+
// See https://swift.org/LICENSE.txt for license information
9+
// See https://swift.org/CONTRIBUTORS.txt for the list of Swift project authors
1010
//
1111
//===----------------------------------------------------------------------===//
1212
///

lib/AST/ASTMangler.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -238,7 +238,7 @@ std::string ASTMangler::mangleGlobalInit(const VarDecl *decl, int counter,
238238
return finalize();
239239
}
240240

241-
std::string ASTMangler::mangleReabstructionThunkHelper(
241+
std::string ASTMangler::mangleReabstractionThunkHelper(
242242
CanSILFunctionType ThunkType,
243243
Type FromType,
244244
Type ToType,

lib/AST/StmtTransformer.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
//===--- Stmt.cpp - Swift Language Statement ASTs -------------------------===//
1+
//===--- StmtTransformer.cpp - Swift Language Statement ASTs --------------===//
22
//
33
// This source file is part of the Swift.org open source project
44
//
55
// Copyright (c) 2016 Apple Inc. and the Swift project authors
66
// Licensed under Apache License v2.0 with Runtime Library Exception
77
//
8-
// See http://swift.org/LICENSE.txt for license information
9-
// See http://swift.org/CONTRIBUTORS.txt for the list of Swift project authors
8+
// See https://swift.org/LICENSE.txt for license information
9+
// See https://swift.org/CONTRIBUTORS.txt for the list of Swift project authors
1010
//
1111
//===----------------------------------------------------------------------===//
1212
//

lib/RemoteAST/InProcessMemoryReader.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
//===--- InProcessMemoryReader.cpp - Reads local memory ---------*- C++ -*-===//
1+
//===--- InProcessMemoryReader.cpp - Reads local memory -------------------===//
22
//
33
// This source file is part of the Swift.org open source project
44
//

lib/SILGen/SILGenDecl.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2000,7 +2000,7 @@ getOrCreateReabstractionThunk(GenericEnvironment *genericEnv,
20002000
std::string Old = mangler.finalize();
20012001

20022002
NewMangling::ASTMangler NewMangler;
2003-
std::string New = NewMangler.mangleReabstructionThunkHelper(thunkType,
2003+
std::string New = NewMangler.mangleReabstractionThunkHelper(thunkType,
20042004
fromInterfaceType, toInterfaceType, M.getSwiftModule());
20052005

20062006
name = NewMangling::selectMangling(Old, New);

lib/SILOptimizer/PassManager/PassPipeline.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
//===--- Passes.cpp - Swift Compiler SIL Pass Entrypoints -----------------===//
1+
//===--- PassPipeline.cpp - Swift Compiler SIL Pass Entrypoints -----------===//
22
//
33
// This source file is part of the Swift.org open source project
44
//

lib/SILOptimizer/UtilityPasses/BugReducerTester.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55
// Copyright (c) 2014 - 2016 Apple Inc. and the Swift project authors
66
// Licensed under Apache License v2.0 with Runtime Library Exception
77
//
8-
// See http://swift.org/LICENSE.txt for license information
9-
// See http://swift.org/CONTRIBUTORS.txt for the list of Swift project authors
8+
// See https://swift.org/LICENSE.txt for license information
9+
// See https://swift.org/CONTRIBUTORS.txt for the list of Swift project authors
1010
//
1111
//===----------------------------------------------------------------------===//
1212
///

lib/Sema/CSDiag.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4651,7 +4651,7 @@ static bool diagnoseImplicitSelfErrors(Expr *fnExpr, Expr *argExpr,
46514651
return false;
46524652

46534653
auto context = CS->DC;
4654-
using CandididateMap =
4654+
using CandidateMap =
46554655
llvm::SmallDenseMap<ValueDecl *, llvm::SmallVector<OverloadChoice, 2>>;
46564656

46574657
auto getBaseKind = [](ValueDecl *base) -> DescriptiveDeclKind {
@@ -4734,7 +4734,7 @@ static bool diagnoseImplicitSelfErrors(Expr *fnExpr, Expr *argExpr,
47344734
if (!result || result.empty())
47354735
continue;
47364736

4737-
CandididateMap candidates;
4737+
CandidateMap candidates;
47384738
for (const auto &candidate : result) {
47394739
auto base = candidate.Base;
47404740
if ((base && base->isInvalid()) || candidate->isInvalid())

lib/Sema/ConstraintSystem.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1135,7 +1135,7 @@ class ConstraintSystem {
11351135

11361136
private:
11371137
/// The list of constraints that have been retired along the
1138-
/// current path, this list is used in LIFO fasion when constaints
1138+
/// current path, this list is used in LIFO fashion when constraints
11391139
/// are added back to the circulation.
11401140
ConstraintList retiredConstraints;
11411141

lib/Sema/TypeChecker.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1029,7 +1029,7 @@ class TypeChecker final : public LazyResolver {
10291029
/// Revert the dependent types within the given generic parameter list.
10301030
void revertGenericParamList(GenericParamList *genericParams);
10311031

1032-
/// Construct a new generic environonment for the given declaration context.
1032+
/// Construct a new generic environment for the given declaration context.
10331033
///
10341034
/// \param genericParams The generic parameters to validate.
10351035
///
@@ -1052,7 +1052,7 @@ class TypeChecker final : public LazyResolver {
10521052
llvm::function_ref<void(ArchetypeBuilder &)>
10531053
inferRequirements);
10541054

1055-
/// Construct a new generic environonment for the given declaration context.
1055+
/// Construct a new generic environment for the given declaration context.
10561056
///
10571057
/// \param genericParams The generic parameters to validate.
10581058
///

stdlib/public/SDK/Foundation/Data.swift

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ internal func _NSWriteDataToFile_Swift(url: NSURL, data: NSData, options: UInt,
4848

4949
public final class _DataStorage {
5050
public enum Backing {
51-
// A mirror of the objective-c implementation that is suitable to inline in swift
51+
// A mirror of the Objective-C implementation that is suitable to inline in Swift
5252
case swift
5353

5454
// these two storage points for immutable and mutable data are reserved for references that are returned by "known"
@@ -59,7 +59,7 @@ public final class _DataStorage {
5959
case immutable(NSData) // This will most often (perhaps always) be NSConcreteData
6060
case mutable(NSMutableData) // This will often (perhaps always) be NSConcreteMutableData
6161

62-
// These are reserved for foregin sources where neither Swift nor Foundation are fully certain whom they belong
62+
// These are reserved for foreign sources where neither Swift nor Foundation are fully certain whom they belong
6363
// to from an object inheritance standpoint, this means that all bets are off and the values of bytes, mutableBytes,
6464
// and length cannot be cached. This also means that all methods are expected to dynamically dispatch out to the
6565
// backing reference.
@@ -759,7 +759,7 @@ public final class _DataStorage {
759759
return d
760760
case .customMutableReference(let d):
761761
// Because this is returning an object that may be mutated in the future it needs to create a copy to prevent
762-
// any further mutations out from under the reciever
762+
// any further mutations out from under the receiver
763763
return d.copy() as! NSData
764764
}
765765
}
@@ -865,7 +865,7 @@ internal class _NSSwiftData : NSData {
865865
override var bytes: UnsafeRawPointer {
866866
// NSData's byte pointer methods are not annotated for nullability correctly
867867
// (but assume non-null by the wrapping macro guards). This placeholder value
868-
// is to work-around this bug. Any indirection to the underlying bytes of a NSData
868+
// is to work-around this bug. Any indirection to the underlying bytes of an NSData
869869
// with a length of zero would have been a programmer error anyhow so the actual
870870
// return value here is not needed to be an allocated value. This is specifically
871871
// needed to live like this to be source compatible with Swift3. Beyond that point

stdlib/public/runtime/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ if(SWIFT_BUILD_STATIC_STDLIB AND "${sdk}" STREQUAL "LINUX")
7575
set(static_binary_lnk_file_list)
7676
string(TOLOWER "${sdk}" lowercase_sdk)
7777

78-
# These two libaries are only used with the static swiftcore
78+
# These two libraries are only used with the static swiftcore
7979
add_library(swiftImageInspectionStatic STATIC ImageInspectionStatic.cpp)
8080
set_target_properties(swiftImageInspectionStatic PROPERTIES
8181
ARCHIVE_OUTPUT_DIRECTORY "${SWIFTSTATICLIB_DIR}/${lowercase_sdk}")

stdlib/public/runtime/ImageInspectionStatic.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ swift::initializeTypeMetadataRecordLookup() {
5555

5656
// This is called from Errors.cpp when dumping a stack trace entry.
5757
// It could be implemented by parsing the ELF information in the
58-
// executable. For now it returns 0 for error (cant lookup address).
58+
// executable. For now it returns 0 for error (can't lookup address).
5959
int
6060
swift::lookupSymbol(const void *address, SymbolInfo *info) {
6161
return 0;

stdlib/public/runtime/ProtocolConformance.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -341,7 +341,7 @@ searchInConformanceCache(const Metadata *type,
341341
// An up-to-date entry for the original type is authoritative.
342342
isAuthoritative = true;
343343
} else {
344-
// A up-to-date cached failure for a superclass of the type is not
344+
// An up-to-date cached failure for a superclass of the type is not
345345
// authoritative: there may be a still-undiscovered conformance
346346
// for the original query type.
347347
isAuthoritative = false;

tools/sil-passpipeline-dumper/SILPassPipelineDumper.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55
// Copyright (c) 2014 - 2016 Apple Inc. and the Swift project authors
66
// Licensed under Apache License v2.0 with Runtime Library Exception
77
//
8-
// See http://swift.org/LICENSE.txt for license information
9-
// See http://swift.org/CONTRIBUTORS.txt for the list of Swift project authors
8+
// See https://swift.org/LICENSE.txt for license information
9+
// See https://swift.org/CONTRIBUTORS.txt for the list of Swift project authors
1010
//
1111
//===----------------------------------------------------------------------===//
1212
///

utils/bug_reducer/bug_reducer/bug_reducer_utils.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,8 @@ def __init__(self, config, tools, input_file):
193193
def tool(self):
194194
return self.tools.sil_func_extractor
195195

196-
def _cmdline(self, input_file, funclist_path, output_file='-', invert=False):
196+
def _cmdline(self, input_file, funclist_path, output_file='-',
197+
invert=False):
197198
sanity_check_file_exists(input_file)
198199
sanity_check_file_exists(funclist_path)
199200
assert(isinstance(funclist_path, str))
@@ -204,13 +205,15 @@ def _cmdline(self, input_file, funclist_path, output_file='-', invert=False):
204205
base_args.append('-invert')
205206
return base_args
206207

207-
def _invoke(self, input_file, funclist_path, output_filename, invert=False):
208+
def _invoke(self, input_file, funclist_path, output_filename,
209+
invert=False):
208210
assert(isinstance(funclist_path, str))
209211
cmdline = self._cmdline(input_file, funclist_path, output_filename,
210212
invert)
211213
return br_call(cmdline)
212214

213-
def invoke_with_functions(self, funclist_path, output_filename, invert=False):
215+
def invoke_with_functions(self, funclist_path, output_filename,
216+
invert=False):
214217
assert(isinstance(funclist_path, str))
215218
return self._invoke(self.input_file, funclist_path, output_filename,
216219
invert)

utils/bug_reducer/bug_reducer/list_reducer.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ def __init__(self, l):
1818
self.max_iters_without_progress = 3
1919

2020
# Maximal number of allowed single-element trim iterations. We add a
21-
# threshhold here as single-element reductions may otherwise take a
21+
# threshold here as single-element reductions may otherwise take a
2222
# very long time to complete.
2323
self.max_trim_iterations_without_back_jump = 3
2424
self.shuffling_enabled = True

0 commit comments

Comments
 (0)