Skip to content

Commit 43debc5

Browse files
committed
[NFC] minor cleanup
1 parent 28daec0 commit 43debc5

File tree

5 files changed

+6
-9
lines changed

5 files changed

+6
-9
lines changed

SwiftCompilerSources/Sources/Optimizer/Utilities/BorrowUtils.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -425,7 +425,7 @@ enum BeginBorrowValue {
425425
var baseOperand: Operand? {
426426
switch self {
427427
case let .beginBorrow(beginBorrow):
428-
return beginBorrow.operand
428+
return beginBorrow.operand
429429
case let .loadBorrow(loadBorrow):
430430
return loadBorrow.operand
431431
case .beginApply, .functionArgument, .reborrow, .uncheckOwnershipConversion:

SwiftCompilerSources/Sources/Optimizer/Utilities/OptUtils.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -456,7 +456,7 @@ extension Instruction {
456456
}
457457
}
458458

459-
/// Returns true if `otherInst` is in the same block and dominated by this instruction.
459+
/// Returns true if `otherInst` is in the same block and is strictly dominated by this instruction.
460460
/// To be used as simple dominance check if both instructions are most likely located in the same block
461461
/// and no DominatorTree is available (like in instruction simplification).
462462
func dominatesInSameBlock(_ otherInst: Instruction) -> Bool {

SwiftCompilerSources/Sources/SIL/Instruction.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1474,7 +1474,7 @@ final public class LoadBorrowInst : SingleValueInstruction, LoadInstruction, Bor
14741474
}
14751475

14761476
final public class StoreBorrowInst : SingleValueInstruction, StoringInstruction, BorrowIntroducingInstruction {
1477-
var allocStack: AllocStackInst {
1477+
public var allocStack: AllocStackInst {
14781478
var dest = destination
14791479
if let mark = dest as? MarkUnresolvedNonCopyableValueInst {
14801480
dest = mark.operand.value

SwiftCompilerSources/Sources/SIL/Utilities/AccessUtils.swift

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -556,10 +556,6 @@ public struct AccessBaseAndScopes {
556556
self.scopes = scopes
557557
}
558558

559-
public var outerAddress: Value? {
560-
base.address ?? scopes.last?.address
561-
}
562-
563559
public var enclosingAccess: EnclosingAccessScope {
564560
return scopes.first ?? .base(base)
565561
}

SwiftCompilerSources/Sources/SIL/Utilities/WalkUtils.swift

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,10 +39,11 @@ public enum WalkResult {
3939
}
4040

4141
extension Sequence {
42+
// Walk each element until the walk aborts.
4243
public func walk(
43-
_ predicate: (Element) throws -> WalkResult
44+
_ walker: (Element) throws -> WalkResult
4445
) rethrows -> WalkResult {
45-
return try contains { try predicate($0) == .abortWalk } ? .abortWalk : .continueWalk
46+
return try contains { try walker($0) == .abortWalk } ? .abortWalk : .continueWalk
4647
}
4748
}
4849

0 commit comments

Comments
 (0)