Skip to content

Commit d82682e

Browse files
authored
Merge pull request #3733 from practicalswift/typo-fixes-20160724
[gardening] Fix recently introduced typos.
2 parents 717213c + 7e89679 commit d82682e

File tree

22 files changed

+33
-33
lines changed

22 files changed

+33
-33
lines changed

cmake/modules/SwiftSharedCMakeConfig.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ macro(swift_common_standalone_build_config_llvm product is_cross_compiling)
9191
include(AddSwiftTableGen) # This imports TableGen from LLVM.
9292
include(HandleLLVMOptions)
9393

94-
# HACK: this ugly tweaking is to prevent the propogation of the flag from LLVM
94+
# HACK: this ugly tweaking is to prevent the propagation of the flag from LLVM
9595
# into swift. The use of this flag pollutes all targets, and we are not able
9696
# to remove it on a per-target basis which breaks cross-compilation.
9797
string(REGEX REPLACE "-Wl,-z,defs" "" CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS}")

docs/Generics.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -855,7 +855,7 @@ is effectively parsed as::
855855

856856
by splitting the '>>' operator token into two '>' operator tokens.
857857

858-
However, this is manageable, and is already implemented for the (now depreacted)
858+
However, this is manageable, and is already implemented for the (now deprecated)
859859
protocol composition syntax (protocol<>). The larger problem occurs at expression
860860
context, where the parser cannot disambiguate the tokens::
861861

docs/Lexicon.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ source code, tests, and commit messages. See also the `LLVM lexicon`_.
8484

8585
IWYU (include what you use)
8686
The accepted wisdom that implementation files (``.cpp``, ``.c``, ``.m``,
87-
``.mm``) should explicity ``#include`` or ``#import`` the headers they use.
87+
``.mm``) should explicitly ``#include`` or ``#import`` the headers they use.
8888
Doing so prevents compilation errors when header files are included in a
8989
different order, or when header files are modified to use forward
9090
declarations instead of direct includes.

include/swift/AST/PrintOptions.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -313,7 +313,7 @@ struct PrintOptions {
313313
/// \brief The information for converting archetypes to specialized types.
314314
std::shared_ptr<TypeTransformContext> TransformContext;
315315

316-
/// \brief If this is not \c nullptr then functions (incuding accessors and
316+
/// \brief If this is not \c nullptr then functions (including accessors and
317317
/// constructors) will be printed with a body that is determined by this
318318
/// function.
319319
std::function<std::string(const ValueDecl *)> FunctionBody;

include/swift/SIL/SILOpenedArchetypesTracker.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ class SILOpenedArchetypesTracker : public DeleteNotificationHandler {
4949

5050
const SILFunction &getFunction() const { return F; }
5151

52-
// Register a definiton of a given opened archetype.
52+
// Register a definition of a given opened archetype.
5353
void addOpenedArchetypeDef(Type archetype, SILValue Def);
5454

5555
void removeOpenedArchetypeDef(Type archetype, SILValue Def) {

include/swift/SILOptimizer/Analysis/ARCAnalysis.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -396,7 +396,7 @@ namespace swift {
396396
/// EpilogueARCBlockState - Keep track of whether an epilogue ARC instruction
397397
/// has been found.
398398
struct EpilogueARCBlockState {
399-
/// Keep track of whether a eplogue release has been found before and after
399+
/// Keep track of whether a epilogue release has been found before and after
400400
/// this basic block.
401401
bool BBSetIn;
402402
/// The basic block local SILValue we are interested to find epilogue ARC in.

lib/Immediate/ImmediateImpl.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ namespace swift {
3535
namespace immediate {
3636

3737
// Returns a handle to the runtime suitable for other 'dlsym' or 'dlclose'
38-
// calls or 'NULL' if an error occured.
38+
// calls or 'NULL' if an error occurred.
3939
void *loadSwiftRuntime(StringRef runtimeLibPath);
4040
bool tryLoadLibraries(ArrayRef<LinkLibrary> LinkLibraries,
4141
SearchPathOptions SearchPathOpts,

lib/Parse/ParseType.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -417,8 +417,8 @@ ParserResult<TypeRepr> Parser::parseTypeIdentifierOrTypeComposition() {
417417
SourceLoc RAngleLoc = consumeStartingGreater();
418418
auto AnyRange = SourceRange(ProtocolLoc, RAngleLoc);
419419

420-
// Warn that 'protocol<>' is depreacted and offer to
421-
// repalace with the 'Any' keyword
420+
// Warn that 'protocol<>' is deprecated and offer to
421+
// replace with the 'Any' keyword
422422
diagnose(LAngleLoc, diag::deprecated_any_composition)
423423
.fixItReplace(AnyRange, "Any");
424424

lib/SILOptimizer/Transforms/CSE.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -673,7 +673,7 @@ bool CSE::processOpenExistentialRef(SILInstruction *Inst, ValueBase *V,
673673
SILOpenedArchetypesTracker OpenedArchetypesTracker(*Inst->getFunction());
674674
// Register the new archetype to be used.
675675
OpenedArchetypesTracker.registerOpenedArchetypes(dyn_cast<SILInstruction>(V));
676-
// Use a cloner. It makes copying the instruction and remaping of
676+
// Use a cloner. It makes copying the instruction and remapping of
677677
// opened archetypes trivial.
678678
InstructionCloner Cloner(I->getFunction());
679679
Cloner.registerOpenedExistentialRemapping(
@@ -744,7 +744,7 @@ bool CSE::processNode(DominanceInfoNode *Node) {
744744
if (ValueBase *V = AvailableValues->lookup(Inst)) {
745745
DEBUG(llvm::dbgs() << "SILCSE CSE: " << *Inst << " to: " << *V << '\n');
746746
// Instructions producing a new opened archetype need a special handling,
747-
// because replacing these intructions may require a replacement
747+
// because replacing these instructions may require a replacement
748748
// of the opened archetype type operands in some of the uses.
749749
if (!isa<OpenExistentialRefInst>(Inst) ||
750750
processOpenExistentialRef(Inst, V, I)) {

lib/Sema/CSApply.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1388,7 +1388,7 @@ namespace {
13881388
Expr *bridgeErrorToObjectiveC(Expr *value) {
13891389
auto &tc = cs.getTypeChecker();
13901390

1391-
// Use _bridgeErrorToNSError to conver to an NSError.
1391+
// Use _bridgeErrorToNSError to convert to an NSError.
13921392
auto fn = tc.Context.getBridgeErrorToNSError(&tc);
13931393
SourceLoc loc = value->getLoc();
13941394
if (!fn) {

lib/Sema/CSDiag.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2279,7 +2279,7 @@ diagnoseEnumInstanceMemberLookup(EnumElementDecl *enumElementDecl,
22792279
if (decl0->getName() == decl0->getASTContext().Id_MatchOperator) {
22802280
assert(binaryExpr->getArg()->getElements().size() == 2);
22812281

2282-
// If the rhs of '~=' is the enum type, a single dot suffices
2282+
// If the rhs of '~=' is the enum type, a single dot suffixes
22832283
// since the type can be inferred
22842284
Type secondArgType = binaryExpr->getArg()->getElement(1)->getType();
22852285
if (secondArgType->isEqual(enumMetatype->getInstanceType())) {
@@ -2580,7 +2580,7 @@ bool FailureDiagnosis::diagnoseConversionToBool(Expr *expr, Type exprType) {
25802580
}
25812581

25822582
// If we're trying to convert something from optional type to Bool, then a
2583-
// comparision against nil was probably expected.
2583+
// comparison against nil was probably expected.
25842584
// TODO: It would be nice to handle "!x" --> x == false, but we have no way
25852585
// to get to the parent expr at present.
25862586
if (exprType->getAnyOptionalObjectType()) {

lib/Sema/TypeCheckProtocol.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1993,7 +1993,7 @@ static void diagnoseNoWitness(ValueDecl *Requirement, Type RequirementType,
19931993
llvm_unreachable("Unknown adopter kind");
19941994
}
19951995

1996-
// FIXME: Infer body indention from the source rather than hard-coding
1996+
// FIXME: Infer body indentation from the source rather than hard-coding
19971997
// 4 spaces.
19981998
std::string ExtraIndent = " ";
19991999
StringRef CurrentIndent = Lexer::getIndentationForLine(TC.Context.SourceMgr,

lib/Sema/TypeChecker.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1317,7 +1317,7 @@ class TypeRefinementContextBuilder : private ASTWalker {
13171317
if (CurrentInfo.isContainedIn(NewConstraint)) {
13181318
DiagnosticEngine &Diags = TC.Diags;
13191319
// Some availability checks will always pass because the minimum
1320-
// deployment target gurantees they will never be false. We don't
1320+
// deployment target guarantees they will never be false. We don't
13211321
// diagnose these checks as useless because the source file may
13221322
// be shared with other projects/targets having older deployment
13231323
// targets. We don't currently have a mechanism for the user to

stdlib/public/SDK/Foundation/NSError.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ class _NSErrorRecoveryAttempter {
7171
}
7272
}
7373

74-
/// Describes an error that may be recoverably by presenting several
74+
/// Describes an error that may be recoverable by presenting several
7575
/// potential recovery options to the user.
7676
public protocol RecoverableError : Error {
7777
/// Provides a set of possible recovery options to present to the user.
@@ -93,7 +93,7 @@ public protocol RecoverableError : Error {
9393
///
9494
/// This entry point is used for recovery of errors handled at
9595
/// the "application" granularity, where nothing else in the
96-
/// application can proceed until the attmpted error recovery
96+
/// application can proceed until the attempted error recovery
9797
/// completes.
9898
func attemptRecovery(optionIndex recoveryOptionIndex: Int) -> Bool
9999
}

stdlib/public/core/Policy.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
/// The return type of functions that do not return normally; a type with no
1919
/// values.
2020
///
21-
/// Use `Never` as the return type when declarting a closure, function, or
21+
/// Use `Never` as the return type when declaring a closure, function, or
2222
/// method that unconditionally throws an error, traps, or otherwise does
2323
/// not terminate.
2424
///

stdlib/public/core/UnsafeRawPointer.swift.gyb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -383,7 +383,7 @@ public struct Unsafe${Mutable}RawPointer : Strideable, Hashable, _Pointer {
383383
/// - Note: Storing a copy of a nontrivial value into memory
384384
/// requires that the user know the type of value previously in
385385
/// memory, and requires initialization or assignment of the
386-
/// memory. This can be acheived via a typed `UnsafeMutablePointer`
386+
/// memory. This can be achieved via a typed `UnsafeMutablePointer`
387387
/// or via a raw pointer `self`, as follows, where `U` is the
388388
/// previous type and `T` is the copied value's type:
389389
/// `let typedPtr = self.bindMemory(to: U.self, capacity: 1)`

stdlib/public/stubs/Stubs.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -387,7 +387,7 @@ __muloti4(ti_int a, ti_int b, int* overflow)
387387
// FIXME: ideally we would have a slow path here for Windows which would be
388388
// lowered to instructions as though MSVC had generated. There does not seem to
389389
// be a MSVC provided multiply with overflow detection that I can see, but this
390-
// avoids an unncessary dependency on compiler-rt for a single function.
390+
// avoids an unnecessary dependency on compiler-rt for a single function.
391391
#if (defined(__linux__) && defined(__arm__)) || defined(_MSC_VER)
392392
// Similar to above, but with mulodi4. Perhaps this is
393393
// something that shouldn't be done, and is a bandaid over

test/Constraints/diagnostics.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -757,7 +757,7 @@ func r24251022() {
757757

758758
func overloadSetResultType(_ a : Int, b : Int) -> Int {
759759
// https://twitter.com/_jlfischer/status/712337382175952896
760-
// TODO: <rdar://problem/27391581> QoI: Nonsensitical "binary operator '&&' cannot be applied to two 'Bool' operands"
760+
// TODO: <rdar://problem/27391581> QoI: Nonsensical "binary operator '&&' cannot be applied to two 'Bool' operands"
761761
return a == b && 1 == 2 // expected-error {{binary operator '&&' cannot be applied to two 'Bool' operands}}
762762
// expected-note @-1 {{expected an argument list of type '(Bool, @autoclosure () throws -> Bool)'}}
763763
}
@@ -820,7 +820,7 @@ class Foo23752537 {
820820

821821
extension Foo23752537 {
822822
func isEquivalent(other: Foo23752537) {
823-
// TODO: <rdar://problem/27391581> QoI: Nonsensitical "binary operator '&&' cannot be applied to two 'Bool' operands"
823+
// TODO: <rdar://problem/27391581> QoI: Nonsensical "binary operator '&&' cannot be applied to two 'Bool' operands"
824824
// expected-error @+1 {{binary operator '&&' cannot be applied to two 'Bool' operands}}
825825
return (self.title != other.title && self.message != other.message)
826826
// expected-note @-1 {{expected an argument list of type '(Bool, @autoclosure () throws -> Bool)'}}

test/Parse/enum.swift

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -459,40 +459,40 @@ enum SE0036 {
459459
_ = SE0036.A
460460
}
461461

462-
func staticReferencInInstanceMethod() {
462+
func staticReferenceInInstanceMethod() {
463463
_ = A // expected-error {{enum element 'A' cannot be referenced as an instance member}} {{9-9=SE0036.}}
464464
_ = SE0036.A
465465
}
466466

467-
static func staticReferencInSwitchInStaticMethod() {
467+
static func staticReferenceInSwitchInStaticMethod() {
468468
switch SE0036.A {
469469
case A: break
470470
case B(_): break
471471
}
472472
}
473473

474-
func staticReferencInSwitchInInstanceMethod() {
474+
func staticReferenceInSwitchInInstanceMethod() {
475475
switch self {
476476
case A: break // expected-error {{enum element 'A' cannot be referenced as an instance member}} {{10-10=.}}
477477
case B(_): break // expected-error {{enum element 'B' cannot be referenced as an instance member}} {{10-10=.}}
478478
}
479479
}
480480

481-
func explicitReferencInSwitch() {
481+
func explicitReferenceInSwitch() {
482482
switch SE0036.A {
483483
case SE0036.A: break
484484
case SE0036.B(_): break
485485
}
486486
}
487487

488-
func dotReferencInSwitchInInstanceMethod() {
488+
func dotReferenceInSwitchInInstanceMethod() {
489489
switch self {
490490
case .A: break
491491
case .B(_): break
492492
}
493493
}
494494

495-
static func dotReferencInSwitchInStaticMethod() {
495+
static func dotReferenceInSwitchInStaticMethod() {
496496
switch SE0036.A {
497497
case .A: break
498498
case .B(_): break

test/SILOptimizer/swap_refcnt.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// RUN: %target-swift-frontend -O -emit-sil %s | FileCheck %s
2-
// REQUIRES: rdar:27506150> SILOptimizer/swap_refcnt.swift failes after noreturn -> Never changes
2+
// REQUIRES: rdar:27506150> SILOptimizer/swap_refcnt.swift fails after noreturn -> Never changes
33

44
// Make sure we can swap two values in an array without retaining anything.
55

tools/SourceKit/lib/SwiftLang/SwiftEditorInterfaceGen.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ class SwiftInterfaceGenContext::Implementation {
7979
SourceTextInfo Info;
8080
// This is the non-typechecked AST for the generated interface source.
8181
CompilerInstance TextCI;
82-
// Syncronize access to the embedded compiler instance (if we don't have an
82+
// Synchronize access to the embedded compiler instance (if we don't have an
8383
// ASTUnit).
8484
WorkQueue Queue{WorkQueue::Dequeuing::Serial,
8585
"sourcekit.swift.InterfaceGenContext"};

tools/SourceKit/lib/SwiftLang/SwiftSourceDocInfo.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -670,7 +670,7 @@ static bool passCursorInfoForDecl(const ValueDecl *VD,
670670
llvm::raw_svector_ostream OS(SS);
671671
SwiftLangSupport::printTypeUSR(ContainerTy, OS);
672672
}
673-
unsigned MangedContainerTypeEnd = SS.size();
673+
unsigned MangledContainerTypeEnd = SS.size();
674674

675675
unsigned DocCommentBegin = SS.size();
676676
{
@@ -791,7 +791,7 @@ static bool passCursorInfoForDecl(const ValueDecl *VD,
791791
MangledTypeEnd - MangledTypeStart);
792792

793793
StringRef ContainerTypeUsr = StringRef(SS.begin()+MangledContainerTypeStart,
794-
MangedContainerTypeEnd - MangledContainerTypeStart);
794+
MangledContainerTypeEnd - MangledContainerTypeStart);
795795
StringRef DocComment = StringRef(SS.begin()+DocCommentBegin,
796796
DocCommentEnd-DocCommentBegin);
797797
StringRef AnnotatedDecl = StringRef(SS.begin()+DeclBegin,

0 commit comments

Comments
 (0)