Skip to content

Commit 3a4ee89

Browse files
[gardening] Use consistent formatting.
1 parent e05afb2 commit 3a4ee89

File tree

19 files changed

+29
-29
lines changed

19 files changed

+29
-29
lines changed

include/swift/AST/Expr.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -1753,7 +1753,7 @@ class DynamicSubscriptExpr final
17531753
/// bar.foo. These always have unresolved type.
17541754
class UnresolvedMemberExpr final
17551755
: public Expr,
1756-
public TrailingCallArguments<UnresolvedMemberExpr> {
1756+
public TrailingCallArguments<UnresolvedMemberExpr> {
17571757
SourceLoc DotLoc;
17581758
DeclNameLoc NameLoc;
17591759
DeclName Name;

lib/AST/ASTScope.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ ASTScope::ASTScope(const ASTScope *parent, ArrayRef<ASTScope *> children)
132132

133133
// Add child nodes, reparenting them to this node.
134134
storedChildren.reserve(children.size());
135-
for (auto child : children ) {
135+
for (auto child : children) {
136136
child->parentAndExpanded.setPointer(this);
137137
storedChildren.push_back(child);
138138
}

lib/AST/ArchetypeBuilder.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -1196,7 +1196,7 @@ bool ArchetypeBuilder::addSameTypeRequirementBetweenArchetypes(
11961196
// along back edges.
11971197
bool creatingCycle = false;
11981198
auto T2Parent = T2;
1199-
while(T2Parent != nullptr) {
1199+
while (T2Parent != nullptr) {
12001200
if (T2Parent->getRepresentative() == T1)
12011201
creatingCycle = true;
12021202
T2Parent = T2Parent->getParent();

lib/Parse/ParseType.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -464,7 +464,7 @@ ParserResult<TypeRepr> Parser::parseTypeIdentifierOrTypeComposition() {
464464
SmallString<32> replacement;
465465
auto Begin = Protocols.begin();
466466
replacement += extractText(*Begin);
467-
while(++Begin != Protocols.end()) {
467+
while (++Begin != Protocols.end()) {
468468
replacement += " & ";
469469
replacement += extractText(*Begin);
470470
}

lib/SILOptimizer/Analysis/EpilogueARCAnalysis.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ bool EpilogueARCContext::convergeDataflow() {
103103
Changed |= (BS->BBSetIn != BBSetOut);
104104
BS->BBSetIn = BBSetOut;
105105
}
106-
} while(Changed);
106+
} while (Changed);
107107
return true;
108108
}
109109

lib/Serialization/DeserializeSIL.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -1187,8 +1187,8 @@ bool SILDeserializer::readSILInstruction(SILFunction *Fn, SILBasicBlock *BB,
11871187
auto Ty2 = MF->getType(TyID2);
11881188
auto ResultTy = MF->getType(TyID3);
11891189
ResultVal = Builder.createTailAddr(Loc,
1190-
getLocalValue(ValID, getSILType(Ty, SILValueCategory::Address)),
1191-
getLocalValue(ValID2, getSILType(Ty2, SILValueCategory::Object)),
1190+
getLocalValue(ValID, getSILType(Ty, SILValueCategory::Address)),
1191+
getLocalValue(ValID2, getSILType(Ty2, SILValueCategory::Object)),
11921192
getSILType(ResultTy, SILValueCategory::Address));
11931193
break;
11941194
}

stdlib/public/Platform/tgmath.swift.gyb

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ public func sqrt<T: FloatingPoint>(_ x: T) -> T {
2323

2424
@_transparent
2525
public func fma<T: FloatingPoint>(_ x: T, _ y: T, _ z: T) -> T {
26-
return z.addingProduct(x,y)
26+
return z.addingProduct(x, y)
2727
}
2828

2929
@_transparent

stdlib/public/SDK/Foundation/Data.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -363,7 +363,7 @@ public struct Data : ReferenceConvertible, Equatable, Hashable, RandomAccessColl
363363

364364
private func _shouldUseNonAtomicWriteReimplementation(options: Data.WritingOptions = []) -> Bool {
365365

366-
// Avoid a crash that happens on OSX 10.11.x and iOS 9.x or before when writing a bridged Data non-atomically with Foundation's standard write() implementation.
366+
// Avoid a crash that happens on OS X 10.11.x and iOS 9.x or before when writing a bridged Data non-atomically with Foundation's standard write() implementation.
367367
if !options.contains(.atomic) {
368368
#if os(OSX)
369369
return NSFoundationVersionNumber <= Double(NSFoundationVersionNumber10_11_Max)

stdlib/public/SDK/Foundation/URLComponents.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -334,7 +334,7 @@ extension URLComponents : CustomStringConvertible, CustomDebugStringConvertible,
334334

335335
c.append((label: "path", value: self.path))
336336
if #available(OSX 10.10, iOS 8.0, *) {
337-
if let qi = self.queryItems { c.append((label: "queryItems", value: qi )) }
337+
if let qi = self.queryItems { c.append((label: "queryItems", value: qi)) }
338338
}
339339
if let f = self.fragment { c.append((label: "fragment", value: f)) }
340340
let m = Mirror(self, children: c, displayStyle: Mirror.DisplayStyle.struct)

stdlib/public/core/AnyHashable.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ internal struct _ConcreteHashableBox<Base : Hashable> : _AnyHashableBox {
8181
func _downCastConditional<T>(into result: UnsafeMutablePointer<T>) -> Bool {
8282
guard let value = _baseHashable as? T else { return false }
8383
result.initialize(to: value)
84-
return true;
84+
return true
8585
}
8686
}
8787

stdlib/public/core/DebuggerSupport.swift

+2-2
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,8 @@ public enum _DebuggerSupport {
4747

4848
internal static func checkValue<T>(
4949
_ value: Any,
50-
ifClass: (AnyObject)->T,
51-
otherwise: ()->T
50+
ifClass: (AnyObject) -> T,
51+
otherwise: () -> T
5252
) -> T {
5353
if isClass(value) {
5454
return ifClass(_unsafeDowncastToAnyObject(fromAny: value))

stdlib/public/core/Integers.swift.gyb

+1-1
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ infix operator &>>= : AssignmentPrecedence
6767
//===----------------------------------------------------------------------===//
6868

6969

70-
//FIXME(integers): This should go in the stdlib separately, probably.
70+
// FIXME(integers): This should go in the stdlib separately, probably.
7171
extension ExpressibleByIntegerLiteral
7272
where Self : _ExpressibleByBuiltinIntegerLiteral {
7373
/// Create an instance initialized to `value`.

test/Constraints/dictionary_literal.swift

+3-3
Original file line numberDiff line numberDiff line change
@@ -78,9 +78,9 @@ func testDefaultExistentials() {
7878

7979
let _: Int = d2 // expected-error{{value of type 'Dictionary<AnyHashable, Any>'}}
8080

81-
let _ = ["a" : 1,
82-
"b" : [ "a", 2, 3.14159 ],
83-
"c" : [ "a" : 2, "b" : 3.5] ]
81+
let _ = ["a": 1,
82+
"b": ["a", 2, 3.14159],
83+
"c": ["a": 2, "b": 3.5]]
8484
// expected-error@-3{{heterogeneous collection literal could only be inferred to 'Dictionary<String, Any>'; add explicit type annotation if this is intentional}}
8585

8686
let d3 = ["b" : B(), "c" : C()]

test/Constraints/override.swift

+6-6
Original file line numberDiff line numberDiff line change
@@ -14,19 +14,19 @@ func removeOverrides<SomeSub: Sub>(concrete: Sub, generic: SomeSub) {
1414
}
1515

1616
class Base1 {
17-
func foo1(a : Int, b : @escaping ()->()) {} // expected-note{{potential overridden instance method 'foo1(a:b:)' here}}
18-
func foo2(a : @escaping (Int)->(Int), b : @escaping ()->()) {} // expected-note{{potential overridden instance method 'foo2(a:b:)' here}}
17+
func foo1(a : Int, b : @escaping () -> ()) {} // expected-note{{potential overridden instance method 'foo1(a:b:)' here}}
18+
func foo2(a : @escaping (Int)->(Int), b : @escaping () -> ()) {} // expected-note{{potential overridden instance method 'foo2(a:b:)' here}}
1919
}
2020

2121
class Sub1 : Base1 {
22-
override func foo1(a : Int, b : ()->()) {} // expected-error {{method does not override any method from its superclass}} expected-note {{type does not match superclass instance method with type '(Int, @escaping () -> ()) -> ()'}} {{34-34=@escaping }}
23-
override func foo2(a : (Int)->(Int), b : ()->()) {} // expected-error {{method does not override any method from its superclass}} expected-note{{type does not match superclass instance method with type '(@escaping (Int) -> (Int), @escaping () -> ()) -> ()'}} {{25-25=@escaping }} {{43-43=@escaping }}
22+
override func foo1(a : Int, b : () -> ()) {} // expected-error {{method does not override any method from its superclass}} expected-note {{type does not match superclass instance method with type '(Int, @escaping () -> ()) -> ()'}} {{34-34=@escaping }}
23+
override func foo2(a : (Int)->(Int), b : () -> ()) {} // expected-error {{method does not override any method from its superclass}} expected-note{{type does not match superclass instance method with type '(@escaping (Int) -> (Int), @escaping () -> ()) -> ()'}} {{25-25=@escaping }} {{43-43=@escaping }}
2424
}
2525

2626
class Base2 {
27-
func foo<T>(a : @escaping (T) ->()) {} // expected-note{{potential overridden instance method 'foo(a:)' here}}
27+
func foo<T>(a : @escaping (T) -> ()) {} // expected-note{{potential overridden instance method 'foo(a:)' here}}
2828
}
2929

3030
class Sub2 : Base2 {
31-
override func foo<T>(a : (T) ->()) {} // expected-error {{method does not override any method from its superclass}} expected-note{{type does not match superclass instance method with type '(@escaping (T) -> ()) -> ()'}}{{28-28=@escaping }}
31+
override func foo<T>(a : (T) -> ()) {} // expected-error {{method does not override any method from its superclass}} expected-note{{type does not match superclass instance method with type '(@escaping (T) -> ()) -> ()'}}{{28-28=@escaping }}
3232
}

test/Constraints/tuple.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,7 @@ extension r25271859 {
190190
func map<U>(f: (T) -> U) -> r25271859<U> {
191191
}
192192

193-
func andThen<U>(f: (T)->r25271859<U>) {
193+
func andThen<U>(f: (T) -> r25271859<U>) {
194194
}
195195
}
196196

test/IRGen/objc_super.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ class PartialApply : Gizmo {
7575
// CHECK: define hidden void @_TFC10objc_super12PartialApply4frobfT_T_([[PARTIAL_APPLY_CLASS]]*) {{.*}} {
7676
override func frob() {
7777
// CHECK: call void @_TF10objc_super8acceptFnFFT_T_T_(i8* bitcast (void (%swift.refcounted*)* [[PARTIAL_FORWARDING_THUNK:@[A-Za-z0-9_]+]] to i8*), %swift.refcounted* %3)
78-
acceptFn( super.frob )
78+
acceptFn(super.frob)
7979
}
8080
// CHECK: }
8181

test/attr/attr_escaping.swift

+2-2
Original file line numberDiff line numberDiff line change
@@ -32,13 +32,13 @@ struct StoresClosure {
3232
closure = fn // expected-error{{assigning non-escaping parameter 'fn' to an @escaping closure}}
3333
}
3434

35-
func arrayPack(_ fn: () -> Int) -> [()->Int] {
35+
func arrayPack(_ fn: () -> Int) -> [() -> Int] {
3636
// expected-note@-1{{parameter 'fn' is implicitly non-escaping}} {{24-24=@escaping }}
3737

3838
return [fn] // expected-error{{using non-escaping parameter 'fn' in a context expecting an @escaping closure}}
3939
}
4040

41-
func arrayPack(_ fn: @escaping () -> Int, _ fn2 : () -> Int) -> [()->Int] {
41+
func arrayPack(_ fn: @escaping () -> Int, _ fn2 : () -> Int) -> [() -> Int] {
4242
// expected-note@-1{{parameter 'fn2' is implicitly non-escaping}} {{53-53=@escaping }}
4343

4444
return [fn, fn2] // expected-error{{using non-escaping parameter 'fn2' in a context expecting an @escaping closure}}

test/stdlib/ArrayBridge.swift.gyb

+1-1
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ class Thunks : NSObject {
134134
@objc func acceptSubclassArray(
135135
_ x: [Subclass],
136136
expecting expected: NSArray
137-
) {
137+
) {
138138
expectEqualSequence(
139139
expected.lazy.map { ObjectIdentifier($0 as AnyObject) },
140140
x.lazy.map { ObjectIdentifier($0 as AnyObject) }

tools/SourceKit/docs/Protocol.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -578,7 +578,7 @@ Welcome to SourceKit. Type ':help' for assistance.
578578
key.request: source.request.cursorinfo,
579579
key.sourcefile: "/path/to/file.swift",
580580
key.offset: 7,
581-
key.compilerargs: [ "/path/to/file.swift" ]
581+
key.compilerargs: ["/path/to/file.swift"]
582582
}
583583
```
584584

0 commit comments

Comments
 (0)