Skip to content

Commit d1ec089

Browse files
authored
Merge pull request #72088 from language-core/main
chore: fix some comments
2 parents 4d78345 + 127077b commit d1ec089

33 files changed

+33
-33
lines changed

SwiftCompilerSources/Sources/Optimizer/Analysis/AliasAnalysis.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ struct AliasAnalysis {
6363
let path = SmallProjectionPath(.anyValueFields)
6464
if let apply = inst as? ApplySite {
6565
// Workaround for quadratic complexity in ARCSequenceOpts.
66-
// We need to use an ever lower budget to not get into noticable compile time troubles.
66+
// We need to use an ever lower budget to not get into noticeable compile time troubles.
6767
let budget = complexityBudget / 10
6868
let effect = getOwnershipEffect(of: apply, for: obj, path: path, complexityBudget: budget, context)
6969
return effect.destroy

SwiftCompilerSources/Sources/Optimizer/Utilities/EscapeUtils.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,7 @@ struct EscapeUtilityTypes {
225225
/// store %other to %2 // 4. ignore (followStores == false): %other doesn't impact the "escapeness" of %1
226226
/// \endcode
227227
///
228-
/// But once the the up-walk sees a load, it has to follow stores from that point on.
228+
/// But once the up-walk sees a load, it has to follow stores from that point on.
229229
/// Example:
230230
/// \code
231231
/// bb0(%function_arg): // 7. escaping! %1 escapes through %function_arg

SwiftCompilerSources/Sources/Optimizer/Utilities/OwnershipLiveness.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -476,7 +476,7 @@ struct InteriorUseWalker {
476476
///
477477
/// .escaping may either be a non-address operand with
478478
/// .pointerEscape ownership, or and address operand that escapes
479-
/// the adderss (address_to_pointer).
479+
/// the address (address_to_pointer).
480480
///
481481
/// .unknown is an address operand whose user is unrecognized.
482482
enum InteriorPointerStatus {

SwiftCompilerSources/Sources/SIL/Argument.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -244,7 +244,7 @@ public struct ArgumentConventions : Collection, CustomStringConvertible {
244244
/// The SIL argument index of the function type's first parameter.
245245
public var firstParameterIndex: Int { indirectSILResultCount }
246246

247-
/// The SIL argument index of the 'self' paramter.
247+
/// The SIL argument index of the 'self' parameter.
248248
var selfIndex: Int? {
249249
guard convention.hasSelfParameter else { return nil }
250250
// self is the last parameter

benchmark/utils/ArgParse.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ class ArgumentParser<U> {
8383
/// Argument holds the name of the command line parameter, its help
8484
/// description and a rule that's applied to process it.
8585
///
86-
/// The the rule is typically a value processing closure used to convert it
86+
/// The rule is typically a value processing closure used to convert it
8787
/// into given type and storing it in the parsing result.
8888
///
8989
/// See also: addArgument, parseArgument

docs/EmbeddedSwift/UserManual.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ A typical setup and build + run cycle for an embedded development board involves
2626
- (5) Uploading the flashable binary to the board over a USB cable using some vendor-provided JTAG/SWD tool or by copying it to a fake USB Mass Storage volume presented by the board.
2727
- (6) Restarting the board, observing physical effects of the firmware (LEDs light up) or UART output over USB, or presence on network, etc.
2828

29-
Most of these steps are out of scope for this document, instead refer to the vendor provided documentation and get familiar with the details of firmware development for your board without Swift in the mix first. Even if you want to build a completely pure Swift firmware, you are still very likely going to need the the vendor provided tooling for linking, post-processing, uploading, etc.
29+
Most of these steps are out of scope for this document, instead refer to the vendor provided documentation and get familiar with the details of firmware development for your board without Swift in the mix first. Even if you want to build a completely pure Swift firmware, you are still very likely going to need the vendor provided tooling for linking, post-processing, uploading, etc.
3030

3131
## Building code using Embedded Swift
3232

docs/Generics/chapters/basic-operation.tex

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -528,7 +528,7 @@ \section{Protocol Components}\label{protocol component}
528528
\item (Check) If the worklist is empty, go to Step~8.
529529
\item (Next) Otherwise, remove the next protocol $p$ from the worklist. If $p\in\texttt{S}$, go back to Step~2, otherwise set $\texttt{S}\leftarrow\texttt{S}\cup\{p\}$.
530530
\item (Component) Use Algorithm~\ref{tarjan} to compute the component ID for $p$.
531-
\item (Machine) Let $m$ be the the requirement machine for this component, creating it first if necessary. If $m\not\in\texttt{M}$, set $\texttt{M}\leftarrow\texttt{M}\cup\{m\}$.
531+
\item (Machine) Let $m$ be the requirement machine for this component, creating it first if necessary. If $m\not\in\texttt{M}$, set $\texttt{M}\leftarrow\texttt{M}\cup\{m\}$.
532532
\item (Successors) Add each successor of $p$ to the worklist.
533533
\item (Loop) Go back to Step~1.
534534
\item (Collect) Return the concatenation of the local rules from each $m\in\texttt{M}$.

docs/Generics/chapters/completion.tex

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -351,7 +351,7 @@ \chapter{Completion}\label{completion}
351351
This new kind of trie lookup can be thought of as a \index{coroutine}coroutine or an iterator, yielding zero or more results as the search proceeds. We implement it as a higher-order function taking a callback.
352352

353353
\begin{algorithm}[Overlap lookup in rule trie]\label{overlap trie lookup}
354-
Takes a term $t$, position $i$ with $0\leq i<|t|$, and a callback. For each rule $u\Rightarrow v$ where $t[i:]$ is a prefix of $u$ or $u$ is a prefix of $t[i:]$, invokes the the callback with the rule $u\Rightarrow v$.
354+
Takes a term $t$, position $i$ with $0\leq i<|t|$, and a callback. For each rule $u\Rightarrow v$ where $t[i:]$ is a prefix of $u$ or $u$ is a prefix of $t[i:]$, invokes the callback with the rule $u\Rightarrow v$.
355355
\begin{enumerate}
356356
\item (Initialize) Set \texttt{N} to the root node of the trie.
357357
\item (End) If $i=|t|$, we've reached the end of the term. Perform a pre-order traversal of all child nodes of \texttt{N}, and for those children that have an associated rewrite rule, invoke the callback with that rule (this is the case where $t[i:]$ is a prefix of each $u$).

docs/ReferenceGuides/UnderscoredAttributes.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1135,7 +1135,7 @@ doing a textual search.
11351135

11361136
Like `@available`, this attribute indicates a decl is available only as an SPI.
11371137
This implies several behavioral changes comparing to regular `@available`:
1138-
1. Type checker diagnoses when a client accidently exposes such a symbol in library APIs.
1138+
1. Type checker diagnoses when a client accidentally exposes such a symbol in library APIs.
11391139
2. When emitting public interfaces, `@_spi_available` is printed as `@available(platform, unavailable)`.
11401140
3. ClangImporter imports ObjC macros `SPI_AVAILABLE` and `__SPI_AVAILABLE` to this attribute.
11411141

include/swift/AST/Expr.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4716,7 +4716,7 @@ class ApplyExpr : public Expr {
47164716
/// complete type-checking.
47174717
///
47184718
/// Returns the thrown error destination, which includes both the type
4719-
/// thrown from this application as well as the the context's error type,
4719+
/// thrown from this application as well as the context's error type,
47204720
/// which may be different.
47214721
ThrownErrorDestination throws() const {
47224722
assert(Bits.ApplyExpr.ThrowsIsSet);

include/swift/IRGen/IRABIDetailsProvider.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -235,7 +235,7 @@ class IRABIDetailsProvider {
235235
SmallVector<TypeRecordABIRepresentation, 4> parameterTypes;
236236
};
237237

238-
/// Returns the function signature that is used for the the type metadata
238+
/// Returns the function signature that is used for the type metadata
239239
/// access function.
240240
FunctionABISignature getTypeMetadataAccessFunctionSignature();
241241

include/swift/Serialization/SerializedModuleLoader.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ struct SerializedModuleBaseName {
7474
llvm::vfs::FileSystem &fs) const;
7575

7676
/// Returns the .package.swiftinterface path if its package-name also applies to
77-
/// the the importing module. Returns an empty optional otherwise.
77+
/// the importing module. Returns an empty optional otherwise.
7878
std::optional<std::string>
7979
getPackageInterfacePathIfInSamePackage(llvm::vfs::FileSystem &fs,
8080
ASTContext &ctx) const;

lib/AST/ASTPrinter.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2583,7 +2583,7 @@ static void addNamespaceMembers(Decl *decl,
25832583
}
25842584
for (auto member : redecl->decls()) {
25852585
if (auto classTemplate = dyn_cast<clang::ClassTemplateDecl>(member)) {
2586-
// Add all specializations to a worklist so we don't accidently mutate
2586+
// Add all specializations to a worklist so we don't accidentally mutate
25872587
// the list of decls we're iterating over.
25882588
llvm::SmallPtrSet<const clang::ClassTemplateSpecializationDecl *, 16> specWorklist;
25892589
for (auto spec : classTemplate->specializations())

lib/AST/ClangTypeConverter.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -906,7 +906,7 @@ ClangTypeConverter::getClangTemplateArguments(
906906
}
907907
if (failedTypes.empty())
908908
return nullptr;
909-
// Clear "templateArgs" to prevent the clients from accidently reading a
909+
// Clear "templateArgs" to prevent the clients from accidentally reading a
910910
// partially converted set of template arguments.
911911
templateArgs.clear();
912912
auto errorInfo = std::make_unique<TemplateInstantiationError>();

lib/AST/Decl.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9518,7 +9518,7 @@ BraceStmt *AbstractFunctionDecl::getBody(bool canSynthesize) const {
95189518

95199519
// Don't allow getBody() to trigger parsing of an unparsed body containing the
95209520
// IDE inspection location.
9521-
// FIXME: We should be properly constructing the range of the the body as a
9521+
// FIXME: We should be properly constructing the range of the body as a
95229522
// CharSourceRange but we can't because we don't have access to the lexer
95239523
// here. Using the end location of the SourceRange works good enough here
95249524
// because the last token is a '}' and the IDE inspection point is not inside

lib/Refactoring/Async/AsyncConverter.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -578,7 +578,7 @@ bool AsyncConverter::walkToStmtPost(Stmt *S) {
578578
if (ClosedScopeWasWrappedInContinuation &&
579579
!Scopes.back().isWrappedInContination()) {
580580
// The nested scope was wrapped in a continuation but the current one
581-
// isn't anymore. Add the '}' that corresponds to the the call to
581+
// isn't anymore. Add the '}' that corresponds to the call to
582582
// withChecked(Throwing)Continuation.
583583
insertCustom(S->getEndLoc(), [&]() { OS << tok::r_brace << '\n'; });
584584
}

lib/Refactoring/Async/AsyncRefactoring.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -922,7 +922,7 @@ class DeclReferenceFinder : private SourceEntityWalker {
922922
///
923923
/// Calls to functions with an async alternative will be replaced with a call
924924
/// to the alternative, possibly wrapped in a do/catch. The do/catch is skipped
925-
/// if the the closure either:
925+
/// if the closure either:
926926
/// 1. Has no error
927927
/// 2. Has an error but no error handling (eg. just ignores)
928928
/// 3. Has error handling that only calls the containing function's handler

lib/Refactoring/MoveMembersToExtension.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ bool RefactoringActionMoveMembersToExtension::isApplicable(
2121
case RangeKind::MultiTypeMemberDecl: {
2222
DeclContext *DC = Info.RangeContext;
2323

24-
// The the common decl context is not a nomial type, we cannot create an
24+
// The common decl context is not a nomial type, we cannot create an
2525
// extension for it
2626
if (!DC || !DC->getInnermostDeclarationDeclContext() ||
2727
!isa<NominalTypeDecl>(DC->getInnermostDeclarationDeclContext()))

lib/SIL/Utils/MemAccessUtils.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1595,7 +1595,7 @@ class AccessPathDefUseTraversal {
15951595
// apply. For other storage, it is the same as accessPath.getRoot().
15961596
//
15971597
// 'base' is typically invalid, maning that all uses of 'storage' for the
1598-
// access path will be visited. When 'base' is set, the the visitor is
1598+
// access path will be visited. When 'base' is set, the visitor is
15991599
// restricted to a specific access base, such as a particular
16001600
// ref_element_addr.
16011601
SILValue base;

lib/SILGen/SILGenBackDeploy.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -224,7 +224,7 @@ void SILGenFunction::emitBackDeploymentThunk(SILDeclRef thunk) {
224224
SmallVector<ManagedValue, 4> indirectErrorResults;
225225
collectThunkParams(loc, params, &indirectParams, &indirectErrorResults);
226226

227-
// Build up the list of arguments that we're going to invoke the the real
227+
// Build up the list of arguments that we're going to invoke the real
228228
// function with.
229229
SmallVector<SILValue, 8> paramsForForwarding;
230230
for (auto indirectParam : indirectParams) {

lib/SILGen/SILGenDecl.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -569,7 +569,7 @@ class LocalVariableInitialization : public SingleBufferInitialization {
569569
// pointer to a box can be formed; and the box doesn't synchronize on
570570
// deinit.
571571
//
572-
// Only add a lexical lifetime to the box if the the variable it stores
572+
// Only add a lexical lifetime to the box if the variable it stores
573573
// requires one.
574574
Box = SGF.B.createBeginBorrow(
575575
decl, Box, /*isLexical=*/lifetime.isLexical(),

lib/SILOptimizer/Mandatory/MoveOnlyAddressCheckerUtils.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@
101101
/// ```
102102
///
103103
/// The variants of SMOA form can be classified by the specific
104-
/// mark_unresolved_non_copyable_value kind put on the the checker mark
104+
/// mark_unresolved_non_copyable_value kind put on the checker mark
105105
/// instruction and are as follows:
106106
///
107107
/// 1. no_consume_or_assign. This means that the address can only be consumed by

lib/SILOptimizer/Utils/CastOptimizer.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1203,7 +1203,7 @@ CastOptimizer::optimizeCheckedCastBranchInst(CheckedCastBranchInst *Inst) {
12031203
}
12041204
return B.createCheckedCastBranch(
12051205
dynamicCast.getLocation(), false /*isExact*/, mi,
1206-
// The cast is now from the the MetatypeInst, so get the source formal
1206+
// The cast is now from the MetatypeInst, so get the source formal
12071207
// type from it.
12081208
mi->getType().getASTType(),
12091209
dynamicCast.getTargetLoweredType(),

lib/Sema/BuilderTransform.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1424,7 +1424,7 @@ ResultBuilderOpSupport TypeChecker::checkBuilderOpSupport(
14241424
continue;
14251425
}
14261426

1427-
// Check if the the candidate has a suitable availability for the
1427+
// Check if the candidate has a suitable availability for the
14281428
// calling context.
14291429
if (isUnavailable(func)) {
14301430
foundUnavailable = true;

lib/Sema/CSGen.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1770,7 +1770,7 @@ namespace {
17701770
auto *base = expr->getChainBase();
17711771
assert(base == TypeChecker::getUnresolvedMemberChainBase(tail));
17721772

1773-
// The result type of the chain is is represented by a new type variable.
1773+
// The result type of the chain is represented by a new type variable.
17741774
auto locator = CS.getConstraintLocator(
17751775
expr, ConstraintLocator::UnresolvedMemberChainResult);
17761776
auto chainResultTy = CS.createTypeVariable(

lib/Sema/CSSimplify.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12086,7 +12086,7 @@ ConstraintSystem::simplifyBridgingConstraint(Type type1,
1208612086
return SolutionKind::Solved;
1208712087
}
1208812088

12089-
// In a previous version of Swift, we could accidently drop the coercion
12089+
// In a previous version of Swift, we could accidentally drop the coercion
1209012090
// constraint in certain cases. In most cases this led to either miscompiles
1209112091
// or crashes later down the pipeline, but for coercions between collections
1209212092
// we generated somewhat reasonable code that performed a force cast. To

lib/Sema/TypeCheckConcurrency.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,7 @@ bool IsDefaultActorRequest::evaluate(
207207
// Any 'distributed actor' declared with availability lower than the
208208
// introduction of custom executors for distributed actors, must be treated as default actor,
209209
// even if it were to declared the unowned executor property, as older compilers
210-
// do not have the the logic to handle that case.
210+
// do not have the logic to handle that case.
211211
return true;
212212
}
213213
}

lib/Sema/TypeCheckEffects.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -617,7 +617,7 @@ class PotentialEffectReason {
617617
/// argument that was not rethrows/reasync-only in this context.
618618
ByDefaultClosure,
619619

620-
/// The the function is rethrows/reasync, and it was called with
620+
/// The function is rethrows/reasync, and it was called with
621621
/// a throwing conformance as one of its generic arguments.
622622
ByConformance,
623623

stdlib/public/Concurrency/TaskStatus.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ namespace {
6969
/// it sees that the locked bit is set in the `Status` field, it
7070
/// must acquire the global status-record lock, find this record
7171
/// (which should be the innermost record), and wait for an unlock if
72-
/// the the task is not the lock owner. If it already owns the
72+
/// the task is not the lock owner. If it already owns the
7373
/// status record lock, it may proceed.
7474
///
7575
class StatusRecordLockRecord

test/Macros/Inputs/syntax_macro_definitions.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1015,7 +1015,7 @@ public struct WrapInType: PeerMacro {
10151015
}
10161016

10171017
// Build a new function with the same signature that forwards arguments
1018-
// to the the original function.
1018+
// to the original function.
10191019
let parameterList = funcDecl.signature.parameterClause.parameters
10201020
let callArguments: [String] = parameterList.map { param in
10211021
let argName = param.secondName ?? param.firstName

test/SourceKit/Macros/macro_semantic_token.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ macro anonymousTypes(_: () -> String) = #externalMacro(module: "MacroDefinition"
1111
//##-- Prepare the macro plugin.
1212
// RUN: %host-build-swift -swift-version 5 -emit-library -o %t/%target-library-name(MacroDefinition) -module-name=MacroDefinition %S/../../Macros/Inputs/syntax_macro_definitions.swift -g -no-toolchain-stdlib-rpath
1313

14-
// Check the output of the the `#anonymousTypes` macro
14+
// Check the output of the `#anonymousTypes` macro
1515
// RUN: %sourcekitd-test -req=semantic-tokens @__swiftmacro_9MacroUser33_8C2BB8A10AE555140C0EDFDEB4A9572DLl14anonymousTypesfMf_.swift -primary-file %s -- -swift-version 5 -load-plugin-library %t/%target-library-name(MacroDefinition) -module-name MacroUser %s | %FileCheck %s --check-prefix IN_BUFFER
1616

1717
// Check that we get some semantic tokens. Checking exact offsets is brittle.

test/embedded/FixedArray.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ func globalWithAppend() {
7575
printit(S.a)
7676
}
7777

78-
// First method to pass a FixedArray to a function: as `borrowing` paramter
78+
// First method to pass a FixedArray to a function: as `borrowing` parameter
7979
func printit<T: Printable>(_ a: borrowing FixedArray<T>) {
8080
// Currently FixedArray cannot conform to Collection, yet.
8181
// For iteration, we need to take the detour through BufferView.

validation-test/stdlib/StringWordBreaking.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ if #available(SwiftStdlib 5.9, *) {
8585

8686
// rdar://116652595
8787
//
88-
// We were accidently hanging when rounding word indices for some concoctions of
88+
// We were accidentally hanging when rounding word indices for some concoctions of
8989
// strings. In particular, where we had a pair of scalars create a constraint
9090
// for the preceeding pair, but the preceeding extend rules were not taking the
9191
// constraint into consideration.

0 commit comments

Comments
 (0)