Skip to content

Gardening: remove trailing whitespaces in libswift #40782

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jan 10, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import SIL

struct AliasAnalysis {
let bridged: BridgedAliasAnalysis

func mayRead(_ inst: Instruction, fromAddress: Value) -> Bool {
switch AliasAnalysis_getMemBehavior(bridged, inst.bridged, fromAddress.bridged) {
case MayReadBehavior, MayReadWriteBehavior, MayHaveSideEffectsBehavior:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ public struct CalleeAnalysis {

public struct FunctionArray : RandomAccessCollection, CustomReflectable {
fileprivate let bridged: BridgedCalleeList

public var startIndex: Int { 0 }
public var endIndex: Int { BridgedFunctionArray_size(bridged) }

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ let simplifyGlobalValuePass = InstructionPass<GlobalValueInst>(
users.removeAll()
}
})

/// Returns true if reference counting and debug_value users of a global_value
/// can be deleted.
private func checkUsers(of val: Value, users: inout StackList<Instruction>) -> Bool {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ let simplifyStrongRetainPass = InstructionPass<StrongRetainInst>(
}
}
})

let simplifyStrongReleasePass = InstructionPass<StrongReleaseInst>(
name: "simplify-strong_release", {
(release: StrongReleaseInst, context: PassContext) in
Expand All @@ -65,7 +65,7 @@ let simplifyStrongReleasePass = InstructionPass<StrongReleaseInst>(
}
}
})

/// Returns true if \p value is something where reference counting instructions
/// don't have any effect.
private func isNotReferenceCounted(value: Value, context: PassContext) -> Bool {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,16 +21,16 @@ public typealias BridgedInstructionPassCtxt =
struct PassContext {

fileprivate let passContext: BridgedPassContext

var isSwift51RuntimeAvailable: Bool {
PassContext_isSwift51RuntimeAvailable(passContext) != 0
}

var aliasAnalysis: AliasAnalysis {
let bridgedAA = PassContext_getAliasAnalysis(passContext)
return AliasAnalysis(bridged: bridgedAA)
}

var calleeAnalysis: CalleeAnalysis {
let bridgeCA = PassContext_getCalleeAnalysis(passContext)
return CalleeAnalysis(bridged: bridgeCA)
Expand All @@ -52,7 +52,7 @@ struct PassContext {
}
}
}

if instruction is FullApplySite {
PassContext_notifyChanges(passContext, callsChanged)
}
Expand Down
16 changes: 8 additions & 8 deletions SwiftCompilerSources/Sources/SIL/BasicBlock.swift
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,13 @@ final public class BasicBlock : ListNode, CustomStringConvertible {
public var reverseInstructions: ReverseList<Instruction> {
ReverseList(startAt: SILBasicBlock_lastInst(bridged).instruction)
}

public var terminator: TermInst {
SILBasicBlock_lastInst(bridged).instruction as! TermInst
}

public var successors: SuccessorArray { terminator.successors }

public var predecessors: PredecessorList {
PredecessorList(startAt: SILBasicBlock_getFirstPred(bridged))
}
Expand All @@ -60,7 +60,7 @@ final public class BasicBlock : ListNode, CustomStringConvertible {
}
fatalError()
}

public var label: String { "bb\(index)" }

var bridged: BridgedBasicBlock { BridgedBasicBlock(obj: SwiftObject(self)) }
Expand All @@ -82,20 +82,20 @@ public struct ArgumentArray : RandomAccessCollection {

public struct SuccessorArray : RandomAccessCollection, CustomReflectable {
private let succArray: BridgedArrayRef

init(succArray: BridgedArrayRef) {
self.succArray = succArray
}

public var startIndex: Int { return 0 }
public var endIndex: Int { return Int(succArray.numElements) }

public subscript(_ index: Int) -> BasicBlock {
precondition(index >= 0 && index < endIndex)
let s = BridgedSuccessor(succ: succArray.data + index &* BridgedSuccessorSize);
return SILSuccessor_getTargetBlock(s).block
}

public var customMirror: Mirror {
let c: [Mirror.Child] = map { (label: nil, value: $0.label) }
return Mirror(self, children: c)
Expand All @@ -104,7 +104,7 @@ public struct SuccessorArray : RandomAccessCollection, CustomReflectable {

public struct PredecessorList : Sequence, IteratorProtocol, CustomReflectable {
private var currentSucc: OptionalBridgedSuccessor

public init(startAt: OptionalBridgedSuccessor) { currentSucc = startAt }

public mutating func next() -> BasicBlock? {
Expand Down
2 changes: 1 addition & 1 deletion SwiftCompilerSources/Sources/SIL/Builder.swift
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ public struct Builder {
return cf.getAs(CondFailInst.self)
}
}

public func createIntegerLiteral(_ value: Int, type: Type) -> IntegerLiteralInst {
notifyInstructionsChanged()
let literal = SILBuilder_createIntegerLiteral(
Expand Down