Skip to content

Commit 48dc469

Browse files
committed
Merge pull request #694 from dduan/semicolon_removal
Remove tailing semi-colons in .swift
2 parents 4165aca + 3d12cec commit 48dc469

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

48 files changed

+204
-141
lines changed

test/1_stdlib/SceneKit.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,8 @@ if #available(iOS 8.0, OSX 10.10, *) {
3838
node.position.z = scn_float_from_cg
3939
expectTrue(SCNVector3EqualToVector3(node.position, scn_vec3_ref))
4040

41-
let f1: SCNFloat = scn_vec3_ref.x;
42-
let f2: SCNFloat = scn_vec4_ref.y;
41+
let f1: SCNFloat = scn_vec3_ref.x
42+
let f2: SCNFloat = scn_vec4_ref.y
4343
expectEqual(f1, 1.0);
4444
expectEqual(f2, 2.0);
4545
}

test/BuildConfigurations/basicDeclarations.swift

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
class A {}
44

55
#if FOO
6-
typealias A1 = A;
6+
typealias A1 = A
77
#endif
88
var a: A = A()
99
var a1: A1 = A1() // should not result in an error
@@ -16,14 +16,14 @@ var c = C() // should not result in an error
1616

1717
class D {
1818
#if FOO
19-
var x: Int;
19+
var x: Int
2020
#endif
2121

2222
init() {
2323
#if !BAR
2424
x = "BAR"; // should not result in an error
2525
#else
26-
x = 1;
26+
x = 1
2727
#endif
2828
}
2929
}
@@ -48,13 +48,13 @@ var i: Int = f1()
4848

4949
protocol P1 {
5050
#if FOO
51-
func fFOO() -> Int;
51+
func fFOO() -> Int
5252
#endif
5353

5454
#if !BAR
55-
func fNotBAR() -> Int;
55+
func fNotBAR() -> Int
5656
#else
57-
func fBAR() -> Int;
57+
func fBAR() -> Int
5858
#endif
5959
}
6060

test/BuildConfigurations/module_top_level.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,6 @@
44
class C {}
55

66
func > (lhs: C, rhs: C) -> Bool {
7-
return false;
7+
return false
88
}
99
#endif

test/BuildConfigurations/pound-if-inside-function-4.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
func foo() { // expected-note {{to match this opening '{'}}
77
#if BLAH
8-
_ = 123;
8+
_ = 123
99
#elseif !BLAH
1010
#else
1111
#else // expected-error{{further conditions after #else are unreachable}}

test/ClangModules/no-sdk.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,6 @@
22
// RUN: %target-swift-frontend -parse -sdk "" -I %S/Inputs/custom-modules %s
33

44
// Verify that we can still import modules even without an SDK.
5-
import ExternIntX;
5+
import ExternIntX
66

77
let y: CInt = ExternIntX.x

test/ClangModules/nullability_silgen.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
// REQUIRES: objc_interop
44

5-
import nullability;
5+
import nullability
66

77
// null_resettable properties.
88
// CHECK-LABEL: sil hidden @_TF18nullability_silgen18testNullResettable

test/Constraints/closures.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ mySort(strings, { x, y in x < y })
1919

2020
// Closures with inout arguments.
2121
func f0<T, U>(t: T, _ f: (inout T) -> U) -> U {
22-
var t2 = t;
22+
var t2 = t
2323
return f(&t2)
2424
}
2525

test/DebugInfo/argument.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,5 +64,5 @@ func uncurry (a: Int64) (b: Int64) -> (Int64, Int64) {
6464
// CHECK: !DILocalVariable(name: "x", arg: 1,{{.*}} line: [[@LINE+2]]
6565
// CHECK: !DILocalVariable(name: "y", arg: 2,{{.*}} line: [[@LINE+1]]
6666
func tuple(x: Int64, y: (Int64, Float, String)) -> Int64 {
67-
return x+y.0;
67+
return x+y.0
6868
}

test/DebugInfo/generic_args.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
func markUsed<T>(t: T) {}
44

55
protocol AProtocol {
6-
func f() -> String;
6+
func f() -> String
77
}
88
class AClass : AProtocol {
99
func f() -> String { return "A" }

test/DebugInfo/linetable.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ class MyClass
1212
init(input: Int64) { x = input }
1313
func do_something(input: Int64) -> Int64
1414
{
15-
return x * input;
15+
return x * input
1616
}
1717
}
1818

test/DebugInfo/patternmatching.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ func markUsed<T>(t: T) {}
88
func classifyPoint2(p: (Double, Double)) {
99
func return_same (input : Double) -> Double {
1010
var input = input
11-
return input;
11+
return input
1212
}
1313

1414
switch p {

test/DebugInfo/protocol.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ class Point : PointUtils {
99
var x : Float
1010
var y : Float
1111
init (_x : Float, _y : Float) {
12-
x = _x;
13-
y = _y;
12+
x = _x
13+
y = _y
1414
}
1515

1616
func distanceFromOrigin() -> Float {

test/DebugInfo/returnlocation.swift

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import Foundation
1313
public func none(inout a: Int64) {
1414
// CHECK_NONE: call void @llvm.dbg{{.*}}, !dbg
1515
// CHECK_NONE: !dbg ![[NONE_INIT:.*]]
16-
a -= 2;
16+
a -= 2
1717
// CHECK_NONE: ret {{.*}}, !dbg ![[NONE_RET:.*]]
1818
// CHECK_NONE: ![[NONE_INIT]] = !DILocation(line: [[@LINE-2]], column:
1919
// CHECK_NONE: ![[NONE_RET]] = !DILocation(line: [[@LINE+1]], column: 1,
@@ -28,7 +28,7 @@ public func empty(inout a: Int64) {
2828
return
2929
}
3030

31-
a -= 2;
31+
a -= 2
3232
// CHECK-DAG_EMPTY: br {{.*}}, !dbg ![[EMPTY_RET2:.*]]
3333
// CHECK-DAG_EMPTY_RET2: ![[EMPTY_RET]] = !DILocation(line: [[@LINE+1]], column: 3,
3434
return
@@ -40,10 +40,10 @@ public func empty(inout a: Int64) {
4040
// CHECK_EMPTY_NONE: define {{.*}}empty_none
4141
public func empty_none(inout a: Int64) {
4242
if a > 24 {
43-
return;
43+
return
4444
}
4545

46-
a -= 2;
46+
a -= 2
4747
// CHECK_EMPTY_NONE: ret {{.*}}, !dbg ![[EMPTY_NONE_RET:.*]]
4848
// CHECK_EMPTY_NONE: ![[EMPTY_NONE_RET]] = !DILocation(line: [[@LINE+1]], column: 1,
4949
}
@@ -52,7 +52,7 @@ public func empty_none(inout a: Int64) {
5252
// CHECK_SIMPLE_RET: define {{.*}}simple
5353
public func simple(a: Int64) -> Int64 {
5454
if a > 24 {
55-
return 0;
55+
return 0
5656
}
5757
return 1
5858
// CHECK_SIMPLE_RET: ret i{{.*}}, !dbg ![[SIMPLE_RET:.*]]
@@ -108,7 +108,7 @@ public func cleanup_none(inout a: NSString) {
108108
// CHECK_CLEANUP_EMPTY: define {{.*}}cleanup_empty
109109
public func cleanup_empty(inout a: NSString) {
110110
if a.length > 24 {
111-
return;
111+
return
112112
}
113113

114114
a = "empty"
@@ -121,7 +121,7 @@ public func cleanup_empty(inout a: NSString) {
121121
// CHECK_CLEANUP_EMPTY_NONE: define {{.*}}cleanup_empty_none
122122
public func cleanup_empty_none(inout a: NSString) {
123123
if a.length > 24 {
124-
return;
124+
return
125125
}
126126

127127
a = "empty"

test/DebugInfo/typearg.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// RUN: %target-swift-frontend %s -emit-ir -g -o - | FileCheck %s
22

33
protocol AProtocol {
4-
func f() -> String;
4+
func f() -> String
55
}
66
class AClass : AProtocol {
77
func f() -> String { return "A" }

test/DebugInfo/variables.swift

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -11,17 +11,17 @@
1111
// CHECK-DAG: ![[TLC:.*]] = !DIModule({{.*}}, name: "variables"
1212

1313
// Global variables.
14-
var glob_i8: Int8 = 8;
14+
var glob_i8: Int8 = 8
1515
// CHECK-DAG: !DIGlobalVariable(name: "glob_i8",{{.*}} scope: ![[TLC]],{{.*}} line: [[@LINE-1]],{{.*}} type: ![[I8:[^,]+]]
16-
var glob_i16: Int16 = 16;
16+
var glob_i16: Int16 = 16
1717
// CHECK-DAG: !DIGlobalVariable(name: "glob_i16",{{.*}} scope: ![[TLC]],{{.*}} line: [[@LINE-1]],{{.*}} type: ![[I16:[^,]+]]
18-
var glob_i32: Int32 = 32;
18+
var glob_i32: Int32 = 32
1919
// CHECK-DAG: !DIGlobalVariable(name: "glob_i32",{{.*}} scope: ![[TLC]],{{.*}} line: [[@LINE-1]],{{.*}} type: ![[I32:[^,]+]]
20-
var glob_i64: Int64 = 64;
20+
var glob_i64: Int64 = 64
2121
// CHECK-DAG: !DIGlobalVariable(name: "glob_i64",{{.*}} scope: ![[TLC]],{{.*}} line: [[@LINE-1]],{{.*}} type: ![[I64:[^,]+]]
22-
var glob_f: Float = 2.89;
22+
var glob_f: Float = 2.89
2323
// CHECK-DAG: !DIGlobalVariable(name: "glob_f",{{.*}} scope: ![[TLC]],{{.*}} line: [[@LINE-1]],{{.*}} type: ![[F:[^,]+]]
24-
var glob_d: Double = 3.14;
24+
var glob_d: Double = 3.14
2525
// CHECK-DAG: !DIGlobalVariable(name: "glob_d",{{.*}} scope: ![[TLC]],{{.*}} line: [[@LINE-1]],{{.*}} type: ![[D:[^,]+]]
2626
var glob_b: Bool = true
2727
// CHECK-DAG: !DIGlobalVariable(name: "glob_b",{{.*}} scope: ![[TLC]],{{.*}} line: [[@LINE-1]],{{.*}} type: ![[B:[^,]+]]
@@ -47,10 +47,10 @@ var unused: Int32 = -1
4747
func foo(dt: Float) -> Float {
4848
// CHECK-DAG: call void @llvm.dbg.declare
4949
// CHECK-DAG: !DILocalVariable(name: "f"
50-
var f: Float = 9.78;
50+
var f: Float = 9.78
5151
// CHECK-DAG: !DILocalVariable(name: "r"
52-
var r: Float = f*dt;
53-
return r;
52+
var r: Float = f*dt
53+
return r
5454
}
5555

5656
var g = foo(1.0);

test/Generics/associated_self_constraints.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ class Subject<T>: Observer, Observable {
5050
observer.onError(error)
5151
}
5252

53-
return self;
53+
return self
5454
}
5555
}
5656

test/Generics/function_defs.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ protocol EqualComparable {
1414
func doCompare<T : EqualComparable, U : EqualComparable>(t1: T, t2: T, u: U) -> Bool {
1515
var b1 = t1.isEqual(t2)
1616
if b1 {
17-
return true;
17+
return true
1818
}
1919

2020
return t1.isEqual(u) // expected-error {{cannot invoke 'isEqual' with an argument list of type '(U)'}}
@@ -195,7 +195,7 @@ func conformanceViaRequires<T
195195
>(t1: T, t2: T) -> Bool {
196196
let b1 = t1.isEqual(t2)
197197
if b1 || t1.isLess(t2) {
198-
return true;
198+
return true
199199
}
200200
}
201201

test/IDE/complete_unresolved_members.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ enum SomeEnum3 {
4949
}
5050

5151
struct NotOptions1 {
52-
static let NotSet = 1;
52+
static let NotSet = 1
5353
}
5454

5555
struct SomeOptions1 : OptionSetType {

test/IRGen/Inputs/report_dead_method_call/main.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,5 +38,5 @@ case 3:
3838
callPublicClass()
3939

4040
default:
41-
break;
41+
break
4242
}

test/IRGen/abitypes.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ class Foo {
103103
// Make sure the caller-side from Swift also uses indirect-byval for the argument
104104
// x86_64-macosx: define hidden float @_TFC8abitypes3Foo25getXFromRectIndirectSwift{{.*}}(%VSC6MyRect* noalias nocapture dereferenceable({{.*}}), %C8abitypes3Foo*) {{.*}} {
105105
func getXFromRectIndirectSwift(r: MyRect) -> Float {
106-
let f : Float = 1.0;
106+
let f : Float = 1.0
107107
// x86_64-macosx: [[TEMP:%.*]] = alloca [[TEMPTYPE:%.*]], align 4
108108
// x86_64-macosx: [[RESULT:%.*]] = call float bitcast (void ()* @objc_msgSend to float (i8*, i8*, float, float, float, float, float, float, float, [[TEMPTYPE]]*)*)(i8* %{{.*}}, i8* %{{.*}}, float 1.000000e+00, float 1.000000e+00, float 1.000000e+00, float 1.000000e+00, float 1.000000e+00, float 1.000000e+00, float 1.000000e+00, [[TEMPTYPE]]* byval align 4 [[TEMP]])
109109
// x86_64-macosx: ret float [[RESULT]]
@@ -427,7 +427,7 @@ class Foo {
427427
// Test that the makeOne() that we generate somewhere below doesn't
428428
// use arm_aapcscc for armv7.
429429
func callInline() -> Float {
430-
return makeOne(3,5).second;
430+
return makeOne(3,5).second
431431
}
432432
}
433433

test/IRGen/objc_class_export.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ struct BigStructWithNativeObjects {
9696
// CHECK: call void @_TFC17objc_class_export3Foo6boundsfT_VSC6NSRect([[NSRECT]]* noalias nocapture sret {{.*}}, [[FOO]]* [[CAST]])
9797

9898
func convertRectToBacking(r r: NSRect) -> NSRect {
99-
return r;
99+
return r
100100
}
101101
// CHECK: define internal void @_TToFC17objc_class_export3Foo20convertRectToBackingfT1rVSC6NSRect_S1_([[NSRECT]]* noalias nocapture sret, [[OPAQUE5:%.*]]*, i8*, [[NSRECT]]* byval align 8) unnamed_addr {{.*}} {
102102
// CHECK: [[CAST:%[a-zA-Z0-9]+]] = bitcast [[OPAQUE5]]* %1 to [[FOO]]*

test/IRGen/objc_subclass.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -280,7 +280,7 @@ class SwiftGizmo : Gizmo {
280280
var x = Int()
281281

282282
func getX() -> Int {
283-
return x;
283+
return x
284284
}
285285

286286
override func duplicate() -> Gizmo {

test/IRGen/objc_type_encoding.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ func testArchetype(work: P3) {
112112
// CHECK-tvos: private unnamed_addr constant [11 x i8] c"v24@0:8@16\00"
113113

114114
@objc func foo(x: Int -> Int) -> Int {
115-
return 1;
115+
return 1
116116
}
117117
// CHECK-macosx: private unnamed_addr constant [12 x i8] c"q24@0:8@?16\00"
118118
// CHECK-ios: private unnamed_addr constant [12 x i8] c"q24@0:8@?16\00"

test/IRGen/sil_witness_tables_inherited_conformance.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ class Cat : Panda {
1111
required init() { }
1212

1313
func getCutenessLevel() -> Int {
14-
return 3;
14+
return 3
1515
}
1616
}
1717

0 commit comments

Comments
 (0)