Skip to content

Commit c18a24e

Browse files
authored
[SwiftCompilerSources] Fix typos
1 parent ffba6d1 commit c18a24e

21 files changed

+44
-44
lines changed

SwiftCompilerSources/Sources/Optimizer/FunctionPasses/AsyncDemotion.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -590,7 +590,7 @@ private func analyzeForDemotion(_ function: Function) -> Node? {
590590
// because it may be a caller of a function that can be demoted.
591591

592592
var executors = Set<Executor>()
593-
var knownAsyncApplys: [ApplySite] = []
593+
var knownAsyncApplySites: [ApplySite] = []
594594
var hops: [Instruction] = []
595595
var unknownAsyncOp: Instruction? = nil
596596

@@ -614,7 +614,7 @@ private func analyzeForDemotion(_ function: Function) -> Node? {
614614
if apply.referencedFunction == nil {
615615
unknownAsyncOp.setIfUnset(inst)
616616
} else {
617-
knownAsyncApplys.append(apply)
617+
knownAsyncApplySites.append(apply)
618618
stats.tick(.asyncKnownCallsCount)
619619
}
620620

@@ -630,7 +630,7 @@ private func analyzeForDemotion(_ function: Function) -> Node? {
630630

631631
let data: AnalysisResult.Data =
632632
(function: function,
633-
knownAsyncCalls: knownAsyncApplys,
633+
knownAsyncCalls: knownAsyncApplySites,
634634
executors: executors,
635635
hops: hops)
636636

SwiftCompilerSources/Sources/Optimizer/FunctionPasses/ComputeSideEffects.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ private struct CollectedEffects {
145145
// In addition to the effects of the apply, also consider the
146146
// effects of the capture, which reads the captured value in
147147
// order to move it into the context. This only applies to
148-
// addressible values, because capturing does not dereference
148+
// addressable values, because capturing does not dereference
149149
// any class objects.
150150
//
151151
// Ignore captures for on-stack partial applies. They only
@@ -332,7 +332,7 @@ private struct CollectedEffects {
332332
/// Adds effects to a specific value.
333333
///
334334
/// If the value comes from an argument (or multiple arguments), then the effects are added
335-
/// to the corrseponding `argumentEffects`. Otherwise they are added to the `global` effects.
335+
/// to the corresponding `argumentEffects`. Otherwise they are added to the `global` effects.
336336
private mutating func addEffects(_ effects: SideEffects.GlobalEffects, to value: Value) {
337337
addEffects(effects, to: value, fromInitialPath: defaultPath(for: value))
338338
}

SwiftCompilerSources/Sources/Optimizer/FunctionPasses/LifetimeDependenceScopeFixup.swift

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ private func extendAccessScopes(dependence: LifetimeDependence,
112112
/// caller scope, which is handled separately). A nested 'read' access can never interfere with another access in the
113113
/// same outer 'read', because it is impossible to nest a 'modify' access within a 'read'. For 'modify' accesses,
114114
/// however, the inner scope must be extended for correctness. A 'modify' access can interfere with other 'modify'
115-
/// accesss in the same scope. We rely on exclusivity diagnostics to report these interferences. For example:
115+
/// access in the same scope. We rely on exclusivity diagnostics to report these interferences. For example:
116116
///
117117
/// sil @foo : $(@inout C) -> () {
118118
/// bb0(%0 : $*C):
@@ -133,12 +133,12 @@ private func extendAccessScopes(dependence: LifetimeDependence,
133133
/// violation, and that subsequent optimizations do not shrink the inner access `%a1`.
134134
private func extendAccessScope(beginAccess: BeginAccessInst, range: inout InstructionRange,
135135
_ context: FunctionPassContext) -> FunctionArgument? {
136-
var endAcceses = [Instruction]()
136+
var endAccesses = [Instruction]()
137137
// Collect the original end_access instructions and extend the range to to cover them. The resulting access scope must
138138
// cover the original scope because it may protect other memory operations.
139139
var requiresExtension = false
140140
for end in beginAccess.endInstructions {
141-
endAcceses.append(end)
141+
endAccesses.append(end)
142142
if range.contains(end) {
143143
// If any end_access is inside the new range, then all end_accesses must be rewritten.
144144
requiresExtension = true
@@ -171,7 +171,7 @@ private func extendAccessScope(beginAccess: BeginAccessInst, range: inout Instru
171171
range.insert(endAccess)
172172
}
173173
// Delete original end_access instructions
174-
for endAccess in endAcceses {
174+
for endAccess in endAccesses {
175175
context.erase(instruction: endAccess)
176176
}
177177
// TODO: Add SIL support for lifetime dependence and write unit test for nested access scopes

SwiftCompilerSources/Sources/Optimizer/FunctionPasses/StackPromotion.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -273,7 +273,7 @@ private struct ComputeOuterBlockrange : EscapeVisitorWithResult {
273273
// instructions (for which the `visitUse` closure is not called).
274274
result.insert(operandsDefinitionBlock)
275275

276-
// We need to explicitly add predecessor blocks of phis becaues they
276+
// We need to explicitly add predecessor blocks of phis because they
277277
// are not necesesarily visited during the down-walk in `isEscaping()`.
278278
// This is important for the special case where there is a back-edge from the
279279
// inner range to the inner rage's begin-block:

SwiftCompilerSources/Sources/Optimizer/InstructionSimplification/SimplifyBeginBorrow.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ private extension Instruction {
132132
// In instruction simplification we don't have a domtree. Therefore do a simple dominance
133133
// check based on same-block relations.
134134
if parentBlock == value.parentBlock {
135-
// The value and instruction are in the same block. All uses are dominanted by both.
135+
// The value and instruction are in the same block. All uses are dominated by both.
136136
return true
137137
}
138138
let destroys = value.uses.filterUsers(ofType: DestroyValueInst.self)

SwiftCompilerSources/Sources/Optimizer/InstructionSimplification/SimplifyLoad.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ extension LoadInst : OnoneSimplifyable, SILCombineSimplifyable {
2020
if optimizeLoadFromStringLiteral(context) {
2121
return
2222
}
23-
if optmizeLoadFromEmptyCollection(context) {
23+
if optimizeLoadFromEmptyCollection(context) {
2424
return
2525
}
2626
if replaceLoadOfGlobalLet(context) {
@@ -85,7 +85,7 @@ extension LoadInst : OnoneSimplifyable, SILCombineSimplifyable {
8585

8686
/// Loading `count` or `capacity` from the empty `Array`, `Set` or `Dictionary` singleton
8787
/// is replaced by a 0 literal.
88-
private func optmizeLoadFromEmptyCollection(_ context: SimplifyContext) -> Bool {
88+
private func optimizeLoadFromEmptyCollection(_ context: SimplifyContext) -> Bool {
8989
if self.isZeroLoadFromEmptyCollection() {
9090
let builder = Builder(before: self, context)
9191
let zeroLiteral = builder.createIntegerLiteral(0, type: type)

SwiftCompilerSources/Sources/Optimizer/PassManager/Context.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,7 @@ extension MutatingContext {
184184
}
185185

186186
func inlineFunction(apply: FullApplySite, mandatoryInline: Bool) {
187-
// This is only a best-effort attempt to notity the new cloned instructions as changed.
187+
// This is only a best-effort attempt to notify the new cloned instructions as changed.
188188
// TODO: get a list of cloned instructions from the `inlineFunction`
189189
let instAfterInling: Instruction?
190190
switch apply {

SwiftCompilerSources/Sources/Optimizer/Utilities/AddressUtils.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,7 @@ extension AddressUseVisitor {
194194
if operand.instruction.isIncidentalUse {
195195
return leafAddressUse(of: operand)
196196
}
197-
// Unkown instruction.
197+
// Unknown instruction.
198198
return unknownAddressUse(of: operand)
199199
}
200200
}
@@ -289,7 +289,7 @@ extension AddressInitializationWalker {
289289
}
290290
}
291291

292-
// Implement AddresUseVisitor
292+
// Implement AddressUseVisitor
293293
extension AddressInitializationWalker {
294294
/// An address projection produces a single address result and does not
295295
/// escape its address operand in any other way.
@@ -359,7 +359,7 @@ extension AddressInitializationWalker {
359359
}
360360
}
361361

362-
/// A live range representing the ownership of addressible memory.
362+
/// A live range representing the ownership of addressable memory.
363363
///
364364
/// This live range represents the minimal guaranteed lifetime of the object being addressed. Uses of derived addresses
365365
/// may be extended up to the ends of this scope without violating ownership.

SwiftCompilerSources/Sources/Optimizer/Utilities/BorrowUtils.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@
126126
//
127127
//
128128
// TODO: These utilities should be integrated with OSSA SIL verification and
129-
// guaranteed to be compelete (produce known results for all legal SIL
129+
// guaranteed to be complete (produce known results for all legal SIL
130130
// patterns).
131131
// ===----------------------------------------------------------------------===//
132132

@@ -211,7 +211,7 @@ enum BorrowingInstruction : CustomStringConvertible, Hashable {
211211
/// the last in the function (e.g. a store rather than a destroy or return).
212212
/// The client needs to use LifetimeDependenceDefUseWalker to do better.
213213
///
214-
/// TODO: to hande reborrow-extended uses, migrate ExtendedLiveness
214+
/// TODO: to handle reborrow-extended uses, migrate ExtendedLiveness
215215
/// to SwiftCompilerSources.
216216
///
217217
/// TODO: Handle .partialApply and .markDependence forwarded uses
@@ -278,7 +278,7 @@ enum BorrowingInstruction : CustomStringConvertible, Hashable {
278278
///
279279
/// If the value is a begin_apply result, then it may be the token or
280280
/// one of the yielded values. In any case, the scope ending operands
281-
/// are on the end_apply or abort_apply intructions that use the
281+
/// are on the end_apply or abort_apply instructions that use the
282282
/// token.
283283
///
284284
/// Note: equivalent to C++ BorrowedValue, but also handles begin_apply.

SwiftCompilerSources/Sources/Optimizer/Utilities/EscapeUtils.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ protocol EscapeVisitor {
156156
/// If true, the traversals follow values with trivial types.
157157
var followTrivialTypes: Bool { get }
158158

159-
/// If true, the traveral follows loaded values.
159+
/// If true, the traversal follows loaded values.
160160
var followLoads: Bool { get }
161161
}
162162

0 commit comments

Comments
 (0)