Skip to content

Commit fa76656

Browse files
committed
Remove instances of duplicated words
1 parent 31feb1f commit fa76656

30 files changed

+45
-46
lines changed

docs/HighLevelSILOptimizations.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -237,7 +237,7 @@ To complete the semantics understood by the optimizer, we define these relations
237237

238238
interferes-with
239239

240-
Given idempotent ``OpA``, the the sequence "``OpA, OpB, OpA``" is
240+
Given idempotent ``OpA``, the sequence "``OpA, OpB, OpA``" is
241241
semantically equivalent to the sequence "``OpA, OpB``" *iff* ``OpB``
242242
does not interfere with ``OpA``.
243243

docs/ObjectInitialization.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -515,7 +515,7 @@ make use of ``self``. This is important uses of ``self``---say,
515515
calling a method on ``self``---could end up referring to stored
516516
properties before they are initialized. Consider the following
517517
Objective-C code, where instance variables are initialized *after* the
518-
call to the the superclass initializer::
518+
call to the superclass initializer::
519519

520520
@interface A : NSObject
521521
- (instancetype)init;

docs/archive/LangRef.html

+2-2
Original file line numberDiff line numberDiff line change
@@ -106,8 +106,8 @@ <h3 id="decl-import">import Declarations</h3>
106106

107107
<p>An import without an explicit import-kind names a module; all of the
108108
module's members are imported into the current scope. The module's name is
109-
also imported into the the current scope in order to allow qualified access
110-
to the module's members, which can be useful for disambiguation.</p>
109+
also imported into the current scope in order to allow qualified access to
110+
the module's members, which can be useful for disambiguation.</p>
111111

112112
<p>If an import-kind is provided, the last element of the import path is
113113
taken to be the name of a decl <em>within</em> the module named by the rest of

docs/proposals/OptimizerEffects.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -492,7 +492,7 @@ elt2's destructor can't change the uniqueness state of the arrays.::
492492
setElement(&a.array, elt2, i)
493493
}
494494

495-
In the the following loop it is not safe to hoist the makeUnique(&a)
495+
In the following loop it is not safe to hoist the makeUnique(&a)
496496
call even for trivial types. 'appendAssumingUnique' captures its argument 'a'
497497
which forces a copy on 'a' on every iteration of the loop.::
498498

include/swift/AST/AvailabilitySpec.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ class VersionConstraintAvailabilitySpec : public AvailabilitySpec {
9696
/// deployment target. This specification is designed to ease porting
9797
/// to new platforms. Because new platforms typically branch from
9898
/// existing platforms, the wildcard allows an #available() check to do the
99-
/// "right" thing (executing the the guarded branch) on the new platform without
99+
/// "right" thing (executing the guarded branch) on the new platform without
100100
/// requiring a modification to every availablity guard in the program. Note
101101
/// that we still do compile-time availability checking with '*', so the
102102
/// compiler will still catch references to potentially unavailable symbols.

include/swift/ASTSectionImporter/ASTSectionImporter.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@ namespace swift {
2727
/// section, this function makes memory buffer copies of all swift
2828
/// modules found in it and registers them using
2929
/// registerMemoryBuffer() so they can be found by loadModule(). The
30-
/// the access path of all modules found in the section is appended
31-
/// to the vector foundModules.
30+
/// access path of all modules found in the section is appended to
31+
/// the vector foundModules.
3232
/// \return true if successful.
3333
bool parseASTSection(SerializedModuleLoader* SML, StringRef Data,
3434
SmallVectorImpl<std::string> &foundModules);

include/swift/Basic/ClusteredBitVector.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ class ClusteredBitVector {
9999
///
100100
/// c) 0 < LengthInBits < ChunkSizeInBits. In this case, Data contains
101101
/// a single chunk, with its unused high bits zeroed like in the
102-
/// the out-of-line case.
102+
/// out-of-line case.
103103
///
104104
/// Therefore, an efficient way to test whether all bits are zero:
105105
/// Data != 0. (isInlineAndAllClear()) Not *guaranteed* to find

include/swift/Runtime/ObjCBridge.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ typedef struct objc_image_info {
5555

5656
// Class and metaclass construction from a compiler-generated memory image.
5757
// cls and cls->isa must each be OBJC_MAX_CLASS_SIZE bytes.·
58-
// Extra bytes not used the the metadata must be zero.
58+
// Extra bytes not used the metadata must be zero.
5959
// info is the same objc_image_info that would be emitted by a static compiler.
6060
// Returns nil if a class with the same name already exists.
6161
// Returns nil if the superclass is nil and the class is not marked as a root.

lib/ClangImporter/ImportDecl.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -4332,7 +4332,7 @@ namespace {
43324332
return subscript;
43334333
}
43344334

4335-
/// Import the the accessor and its attributes.
4335+
/// Import the accessor and its attributes.
43364336
FuncDecl *importAccessor(clang::ObjCMethodDecl *clangAccessor,
43374337
DeclContext *dc) {
43384338
auto *accessor =
@@ -4711,7 +4711,7 @@ namespace {
47114711

47124712
/// \brief Import the members of all of the protocols to which the given
47134713
/// Objective-C class, category, or extension explicitly conforms into
4714-
/// the given list of members, so long as the the method was not already
4714+
/// the given list of members, so long as the method was not already
47154715
/// declared in the class.
47164716
///
47174717
/// FIXME: This whole thing is a hack, because name lookup should really

lib/ClangImporter/ImporterImpl.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -957,7 +957,7 @@ class LLVM_LIBRARY_VISIBILITY ClangImporter::Implementation
957957
/// \returns The named type, or null if the type could not be found.
958958
Type getNamedSwiftType(Module *module, StringRef name);
959959

960-
/// \brief Retrieve a specialization of the the named Swift type, e.g.,
960+
/// \brief Retrieve a specialization of the named Swift type, e.g.,
961961
/// UnsafeMutablePointer<T>.
962962
///
963963
/// \param module The name of the module in which the type should occur.

lib/IDE/CodeCompletion.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -2709,7 +2709,7 @@ class CompletionLookup final : public swift::VisibleDeclConsumer {
27092709
// Ignore the internal members of Optional, like getLogicValue() and
27102710
// _getMirror().
27112711
// These are not commonly used and cause noise and confusion when showing
2712-
// among the the members of the underlying type. If someone really wants to
2712+
// among the members of the underlying type. If someone really wants to
27132713
// use them they can write them directly.
27142714

27152715
return true;

lib/IRGen/GenCast.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ namespace irgen {
6464
llvm::Value *casted;
6565
};
6666

67-
/// \brief Convert the given value to the the exact destination type.
67+
/// \brief Convert the given value to the exact destination type.
6868
FailableCastResult emitClassIdenticalCast(IRGenFunction &IGF,
6969
llvm::Value *from,
7070
SILType fromType,

lib/IRGen/IRBuilder.h

+1-2
Original file line numberDiff line numberDiff line change
@@ -80,8 +80,7 @@ class IRBuilder : public IRBuilderBase {
8080

8181
/// A stable insertion point in the function. "Stable" means that
8282
/// it will point to the same location in the function, even if
83-
/// instructions are subsequently added to the the current basic
84-
/// block.
83+
/// instructions are subsequently added to the current basic block.
8584
class StableIP {
8685
/// Either an instruction that we're inserting after or the basic
8786
/// block that we're inserting at the beginning of.

lib/IRGen/IRGenSIL.cpp

+4-4
Original file line numberDiff line numberDiff line change
@@ -397,7 +397,7 @@ class IRGenSILFunction :
397397
///
398398
/// Unlike \c setLoweredObjCMethod, which finds the method in the actual
399399
/// runtime type of the object, this routine starts at the static type of the
400-
/// object and searches up the the class hierarchy (toward superclasses).
400+
/// object and searches up the class hierarchy (toward superclasses).
401401
///
402402
/// \param searchType The class from which the Objective-C runtime will start
403403
/// its search for a method.
@@ -1571,8 +1571,8 @@ void IRGenSILFunction::visitSILBasicBlock(SILBasicBlock *BB) {
15711571
auto DS = I.getDebugScope();
15721572
// Handle cleanup locations.
15731573
if (ILoc.getKind() == SILLocation::CleanupKind) {
1574-
// Cleanup locations point to the decl of the the value that
1575-
// is being destroyed (for diagnostic generation). As far as
1574+
// Cleanup locations point to the decl of the value that is
1575+
// being destroyed (for diagnostic generation). As far as
15761576
// the linetable is concerned, cleanups at the end of a
15771577
// lexical scope should point to the cleanup location, which
15781578
// is the location of the last instruction in the basic block.
@@ -2686,7 +2686,7 @@ mapTriviallyToInt(IRGenSILFunction &IGF, const EnumImplStrategy &EIS, SelectEnum
26862686
// Cast to the result type.
26872687
result = IGF.Builder.CreateIntCast(result, resultType, false);
26882688
if (commonOffset != 0) {
2689-
// The the offset, if any.
2689+
// The offset, if any.
26902690
auto *offsetConst = llvm::ConstantInt::get(resultType, commonOffset);
26912691
result = IGF.Builder.CreateAdd(result, offsetConst);
26922692
}

lib/Parse/ParseDecl.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -4305,7 +4305,7 @@ ParserStatus Parser::parseDeclEnumCase(ParseDeclOptions Flags,
43054305
}
43064306
}
43074307

4308-
// For recovery, again make sure the the user didn't try to spell a switch
4308+
// For recovery, again make sure the user didn't try to spell a switch
43094309
// case label:
43104310
// 'case Identifier:' or
43114311
// 'case Identifier where ...:'

lib/Parse/ParseStmt.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -2022,7 +2022,7 @@ static BraceStmt *ConvertClosureToBraceStmt(Expr *E, ASTContext &Ctx) {
20222022
CE->setExplicitResultType(CE->getStartLoc(), empty);
20232023

20242024
// The trick here is that the ClosureExpr provides a DeclContext for stuff
2025-
// inside of it, so it isn't safe to just drop it and rip the the BraceStmt
2025+
// inside of it, so it isn't safe to just drop it and rip the BraceStmt
20262026
// from inside of it. While we could try to walk the body and update any
20272027
// Decls, ClosureExprs, etc within the body of the ClosureExpr, it is easier
20282028
// to just turn it into BraceStmt(CallExpr(TheClosure, VoidTuple)). This also

lib/SILGen/SILGenForeignError.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,7 @@ emitBridgeReturnValueForForeignError(SILLocation loc,
230230
return emitIntValue(*this, loc, bridgedType, 0);
231231

232232
// If an error is signalled by a zero result, but we've preserved
233-
// the rest of the return value, then just return the the normal
233+
// the rest of the return value, then just return the normal
234234
// result, assuming (hoping!) that it isn't zero.
235235
case ForeignErrorConvention::ZeroPreservedResult:
236236
return result;

lib/SILPasses/IPO/FunctionSignatureOpts.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -397,7 +397,7 @@ updateOptimizedBBArgs(SILBuilder &Builder, SILBasicBlock *BB,
397397
ProjTree.replaceValueUsesWithLeafUses(Builder, BB->getParent()->getLocation(),
398398
LeafValues);
399399

400-
// Replace all uses of the the original arg with undef so it does not have any
400+
// Replace all uses of the original arg with undef so it does not have any
401401
// uses.
402402
SILValue OrigArg = SILValue(BB->getBBArg(OldArgOffset));
403403
OrigArg.replaceAllUsesWith(SILUndef::get(OrigArg.getType(),

lib/SILPasses/Loop/LoopRotate.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -391,7 +391,7 @@ bool swift::rotateLoop(SILLoop *L, DominanceInfo *DT, SILLoopInfo *LI,
391391
// the latch.
392392
Header->moveAfter(Latch);
393393

394-
// Merge the the old latch with the old header if possible.
394+
// Merge the old latch with the old header if possible.
395395
mergeBasicBlockWithSuccessor(Latch, DT, LI);
396396

397397
// Create a new preheader.

lib/SILPasses/Scalar/RedundantLoadElimination.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@
6363
/// value) and then aggregate them.
6464
///
6565
/// However, this may introduce a lot of extraction and aggregation which may
66-
/// not be necessary. i.e. a store the the struct followed by a load from the
66+
/// not be necessary. i.e. a store the struct followed by a load from the
6767
/// struct. To solve this problem, when RLE detects that an load instruction
6868
/// can be replaced by forwarded value, it will try to find minimum # of
6969
/// extraction necessary to form the forwarded value. It will group the

lib/SILPasses/Utils/CheckedCastBrJumpThreading.cpp

+6-6
Original file line numberDiff line numberDiff line change
@@ -614,15 +614,15 @@ bool CheckedCastBrJumpThreading::trySimplify(TermInst *Term) {
614614
// TODO:
615615
// If the dominating checked_cast_br is non-exact, then
616616
// it is in general not safe to assume that current exact cast
617-
// would have the same outcome. But if the the dominating
618-
// non-exact checked_cast_br fails, then the current exact cast
619-
// would always fail as well.
617+
// would have the same outcome. But if the dominating non-exact
618+
// checked_cast_br fails, then the current exact cast would
619+
// always fail as well.
620620
//
621621
// If the dominating checked_cast_br is exact then then
622622
// it is in general not safe to assume that the current non-exact
623-
// cast would have the same outcome. But if the the dominating
624-
// exact checked_cast_br succeeds, then the current non-exact
625-
// cast would always succeed as well.
623+
// cast would have the same outcome. But if the dominating exact
624+
// checked_cast_br succeeds, then the current non-exact cast
625+
// would always succeed as well.
626626
//
627627
// TODO: In some specific cases, it is possible to prove that
628628
// success or failure of the dominating cast is equivalent to

lib/Sema/MiscDiagnostics.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -1075,7 +1075,7 @@ class AvailabilityWalker : public ASTWalker {
10751075
walkInContext(E->getBase(), MemberAccessContext::Getter);
10761076

10771077
ValueDecl *D = E->getMember().getDecl();
1078-
// Diagnose for the the member declaration itself.
1078+
// Diagnose for the member declaration itself.
10791079
if (diagAvailability(TC, D, E->getNameLoc(), DC)) {
10801080
return;
10811081
}

lib/Sema/TypeCheckNameLookup.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -354,7 +354,7 @@ LookupTypeResult TypeChecker::lookupMemberType(DeclContext *dc,
354354
}
355355
}
356356

357-
// Substitute the the base into the member's type.
357+
// Substitute the base into the member's type.
358358
if (Type memberType = substMemberTypeWithBase(dc->getParentModule(),
359359
typeDecl, type,
360360
/*isTypeReference=*/true)) {

lib/Sema/TypeChecker.cpp

+4-4
Original file line numberDiff line numberDiff line change
@@ -1273,7 +1273,7 @@ class TypeRefinementContextBuilder : private ASTWalker {
12731273

12741274
// If the starting version range is not completely contained in the
12751275
// false flow version range then it must be the case that false flow range
1276-
// is strictly smaller than the the starting range (because the false flow
1276+
// is strictly smaller than the starting range (because the false flow
12771277
// range *is* contained in the starting range), so we should introduce a
12781278
// new refinement for the false flow.
12791279
if (!StartingTRC->getPotentialVersions().isContainedIn(FalseFlow)) {
@@ -1487,7 +1487,7 @@ void TypeChecker::diagnosePotentialUnavailability(
14871487
/// This class finds the innermost nodes of interest by walking
14881488
/// down the root until it has found the target range (in a Pre-visitor)
14891489
/// and then recording the innermost node on the way back up in the
1490-
/// the Post-visitors. It does its best to not search unnecessary subtrees,
1490+
/// Post-visitors. It does its best to not search unnecessary subtrees,
14911491
/// although this is complicated by the fact that not all nodes have
14921492
/// source range information.
14931493
class InnermostAncestorFinder : private ASTWalker {
@@ -1911,8 +1911,8 @@ static void fixAvailabilityForDecl(SourceRange ReferenceRange, const Decl *D,
19111911
SourceLoc InsertLoc;
19121912

19131913
// To avoid exposing the pattern binding declaration to the user, get the
1914-
// descriptive kind from one of the VarDecls. We get the the Fix-It
1915-
// location from the PatternBindingDecl unless the VarDecl has attributes,
1914+
// descriptive kind from one of the VarDecls. We get the Fix-It location
1915+
// from the PatternBindingDecl unless the VarDecl has attributes,
19161916
// in which case we get the start location of the VarDecl attributes.
19171917
DeclAttributes AttrsForLoc;
19181918
if (KindForDiagnostic == DescriptiveDeclKind::PatternBinding) {

stdlib/public/core/Algorithm.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ public func split<S : CollectionType, R : BooleanType>(
118118
fatalError("unavailable function can't be called")
119119
}
120120

121-
/// Returns `true` iff the the initial elements of `s` are equal to `prefix`.
121+
/// Returns `true` iff the initial elements of `s` are equal to `prefix`.
122122
@available(*, unavailable, message="call the 'startsWith()' method on the sequence")
123123
public func startsWith<
124124
S0 : SequenceType, S1 : SequenceType

stdlib/public/core/Builtin.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ func _canBeClass<T>(_: T.Type) -> Int8 {
9595
return Int8(Builtin.canBeClass(T.self))
9696
}
9797

98-
/// Returns the the bits of `x`, interpreted as having type `U`.
98+
/// Returns the bits of `x`, interpreted as having type `U`.
9999
///
100100
/// - Warning: Breaks the guarantees of Swift's type system; use
101101
/// with extreme care. There's almost always a better way to do

stdlib/public/core/SequenceAlgorithms.swift.gyb

+1-1
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ if preds:
140140
rethrows_ = "rethrows "
141141
else:
142142
comment = """
143-
/// Return true iff the the initial elements of `self` are equal to `prefix`.
143+
/// Return true iff the initial elements of `self` are equal to `prefix`.
144144
/// Return true if `other` is empty."""
145145
rethrows_ = ""
146146
}%

test/Sema/Inputs/availability_multi_other.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// This file is used by Sema/availability_versions_multi.swift to
22
// test that we build enough of the type refinement context as needed to
33
// validate declarations when resolving declaration signatures.
4-
// This file relies on the the minimum deployment target for OS X being 10.9.
4+
// This file relies on the minimum deployment target for OS X being 10.9.
55

66
@available(OSX, introduced=10.11)
77
private class PrivateIntroduced10_11 { }

unittests/SourceKit/SwiftLang/CursorInfoTest.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -298,7 +298,7 @@ TEST_F(CursorInfoTest, CursorInfoMustWaitDueDeclLoc) {
298298
StringRef TextToReplace = "0";
299299
replaceText(DocName, findOffset(TextToReplace, Contents), TextToReplace.size(),
300300
ExpensiveInit);
301-
// Edit over the the 'foo' decl.
301+
// Edit over the 'foo' decl.
302302
replaceText(DocName, FooOffs, strlen("foo"), "foo");
303303

304304
// Should wait for the new AST, because the declaration location for the 'foo'
@@ -328,7 +328,7 @@ TEST_F(CursorInfoTest, CursorInfoMustWaitDueOffset) {
328328
StringRef TextToReplace = "0";
329329
replaceText(DocName, findOffset(TextToReplace, Contents), TextToReplace.size(),
330330
ExpensiveInit);
331-
// Edit over the the 'foo' reference.
331+
// Edit over the 'foo' reference.
332332
replaceText(DocName, FooRefOffs, strlen("foo"), "foo");
333333

334334
// Should wait for the new AST, because the cursor location has been edited

utils/gyb.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -506,7 +506,7 @@ def tokenGenerator(self, baseTokens):
506506

507507

508508
def nextToken(self):
509-
"""Move to the the next token"""
509+
"""Move to the next token"""
510510
for kind in self.tokens:
511511
return self.tokenKind
512512

0 commit comments

Comments
 (0)