Skip to content

Remove tailing semi-colons in .swift #694

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 2 commits into from
Dec 21, 2015
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
4 changes: 2 additions & 2 deletions test/1_stdlib/SceneKit.swift
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@ if #available(iOS 8.0, OSX 10.10, *) {
node.position.z = scn_float_from_cg
expectTrue(SCNVector3EqualToVector3(node.position, scn_vec3_ref))

let f1: SCNFloat = scn_vec3_ref.x;
let f2: SCNFloat = scn_vec4_ref.y;
let f1: SCNFloat = scn_vec3_ref.x
let f2: SCNFloat = scn_vec4_ref.y
expectEqual(f1, 1.0);
expectEqual(f2, 2.0);
}
Expand Down
12 changes: 6 additions & 6 deletions test/BuildConfigurations/basicDeclarations.swift
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
class A {}

#if FOO
typealias A1 = A;
typealias A1 = A
#endif
var a: A = A()
var a1: A1 = A1() // should not result in an error
Expand All @@ -16,14 +16,14 @@ var c = C() // should not result in an error

class D {
#if FOO
var x: Int;
var x: Int
#endif

init() {
#if !BAR
x = "BAR"; // should not result in an error
#else
x = 1;
x = 1
#endif
}
}
Expand All @@ -48,13 +48,13 @@ var i: Int = f1()

protocol P1 {
#if FOO
func fFOO() -> Int;
func fFOO() -> Int
#endif

#if !BAR
func fNotBAR() -> Int;
func fNotBAR() -> Int
#else
func fBAR() -> Int;
func fBAR() -> Int
#endif
}

Expand Down
2 changes: 1 addition & 1 deletion test/BuildConfigurations/module_top_level.swift
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@
class C {}

func > (lhs: C, rhs: C) -> Bool {
return false;
return false
}
#endif
2 changes: 1 addition & 1 deletion test/BuildConfigurations/pound-if-inside-function-4.swift
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

func foo() { // expected-note {{to match this opening '{'}}
#if BLAH
_ = 123;
_ = 123
#elseif !BLAH
#else
#else // expected-error{{further conditions after #else are unreachable}}
Expand Down
2 changes: 1 addition & 1 deletion test/ClangModules/no-sdk.swift
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@
// RUN: %target-swift-frontend -parse -sdk "" -I %S/Inputs/custom-modules %s

// Verify that we can still import modules even without an SDK.
import ExternIntX;
import ExternIntX

let y: CInt = ExternIntX.x
2 changes: 1 addition & 1 deletion test/ClangModules/nullability_silgen.swift
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

// REQUIRES: objc_interop

import nullability;
import nullability

// null_resettable properties.
// CHECK-LABEL: sil hidden @_TF18nullability_silgen18testNullResettable
Expand Down
2 changes: 1 addition & 1 deletion test/Constraints/closures.swift
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ mySort(strings, { x, y in x < y })

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

Expand Down
2 changes: 1 addition & 1 deletion test/DebugInfo/argument.swift
Original file line number Diff line number Diff line change
Expand Up @@ -64,5 +64,5 @@ func uncurry (a: Int64) (b: Int64) -> (Int64, Int64) {
// CHECK: !DILocalVariable(name: "x", arg: 1,{{.*}} line: [[@LINE+2]]
// CHECK: !DILocalVariable(name: "y", arg: 2,{{.*}} line: [[@LINE+1]]
func tuple(x: Int64, y: (Int64, Float, String)) -> Int64 {
return x+y.0;
return x+y.0
}
2 changes: 1 addition & 1 deletion test/DebugInfo/generic_args.swift
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
func markUsed<T>(t: T) {}

protocol AProtocol {
func f() -> String;
func f() -> String
}
class AClass : AProtocol {
func f() -> String { return "A" }
Expand Down
2 changes: 1 addition & 1 deletion test/DebugInfo/linetable.swift
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ class MyClass
init(input: Int64) { x = input }
func do_something(input: Int64) -> Int64
{
return x * input;
return x * input
}
}

Expand Down
2 changes: 1 addition & 1 deletion test/DebugInfo/patternmatching.swift
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ func markUsed<T>(t: T) {}
func classifyPoint2(p: (Double, Double)) {
func return_same (input : Double) -> Double {
var input = input
return input;
return input
}

switch p {
Expand Down
4 changes: 2 additions & 2 deletions test/DebugInfo/protocol.swift
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ class Point : PointUtils {
var x : Float
var y : Float
init (_x : Float, _y : Float) {
x = _x;
y = _y;
x = _x
y = _y
}

func distanceFromOrigin() -> Float {
Expand Down
14 changes: 7 additions & 7 deletions test/DebugInfo/returnlocation.swift
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import Foundation
public func none(inout a: Int64) {
// CHECK_NONE: call void @llvm.dbg{{.*}}, !dbg
// CHECK_NONE: !dbg ![[NONE_INIT:.*]]
a -= 2;
a -= 2
// CHECK_NONE: ret {{.*}}, !dbg ![[NONE_RET:.*]]
// CHECK_NONE: ![[NONE_INIT]] = !DILocation(line: [[@LINE-2]], column:
// CHECK_NONE: ![[NONE_RET]] = !DILocation(line: [[@LINE+1]], column: 1,
Expand All @@ -28,7 +28,7 @@ public func empty(inout a: Int64) {
return
}

a -= 2;
a -= 2
// CHECK-DAG_EMPTY: br {{.*}}, !dbg ![[EMPTY_RET2:.*]]
// CHECK-DAG_EMPTY_RET2: ![[EMPTY_RET]] = !DILocation(line: [[@LINE+1]], column: 3,
return
Expand All @@ -40,10 +40,10 @@ public func empty(inout a: Int64) {
// CHECK_EMPTY_NONE: define {{.*}}empty_none
public func empty_none(inout a: Int64) {
if a > 24 {
return;
return
}

a -= 2;
a -= 2
// CHECK_EMPTY_NONE: ret {{.*}}, !dbg ![[EMPTY_NONE_RET:.*]]
// CHECK_EMPTY_NONE: ![[EMPTY_NONE_RET]] = !DILocation(line: [[@LINE+1]], column: 1,
}
Expand All @@ -52,7 +52,7 @@ public func empty_none(inout a: Int64) {
// CHECK_SIMPLE_RET: define {{.*}}simple
public func simple(a: Int64) -> Int64 {
if a > 24 {
return 0;
return 0
}
return 1
// CHECK_SIMPLE_RET: ret i{{.*}}, !dbg ![[SIMPLE_RET:.*]]
Expand Down Expand Up @@ -108,7 +108,7 @@ public func cleanup_none(inout a: NSString) {
// CHECK_CLEANUP_EMPTY: define {{.*}}cleanup_empty
public func cleanup_empty(inout a: NSString) {
if a.length > 24 {
return;
return
}

a = "empty"
Expand All @@ -121,7 +121,7 @@ public func cleanup_empty(inout a: NSString) {
// CHECK_CLEANUP_EMPTY_NONE: define {{.*}}cleanup_empty_none
public func cleanup_empty_none(inout a: NSString) {
if a.length > 24 {
return;
return
}

a = "empty"
Expand Down
2 changes: 1 addition & 1 deletion test/DebugInfo/typearg.swift
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// RUN: %target-swift-frontend %s -emit-ir -g -o - | FileCheck %s

protocol AProtocol {
func f() -> String;
func f() -> String
}
class AClass : AProtocol {
func f() -> String { return "A" }
Expand Down
18 changes: 9 additions & 9 deletions test/DebugInfo/variables.swift
Original file line number Diff line number Diff line change
Expand Up @@ -11,17 +11,17 @@
// CHECK-DAG: ![[TLC:.*]] = !DIModule({{.*}}, name: "variables"

// Global variables.
var glob_i8: Int8 = 8;
var glob_i8: Int8 = 8
// CHECK-DAG: !DIGlobalVariable(name: "glob_i8",{{.*}} scope: ![[TLC]],{{.*}} line: [[@LINE-1]],{{.*}} type: ![[I8:[^,]+]]
var glob_i16: Int16 = 16;
var glob_i16: Int16 = 16
// CHECK-DAG: !DIGlobalVariable(name: "glob_i16",{{.*}} scope: ![[TLC]],{{.*}} line: [[@LINE-1]],{{.*}} type: ![[I16:[^,]+]]
var glob_i32: Int32 = 32;
var glob_i32: Int32 = 32
// CHECK-DAG: !DIGlobalVariable(name: "glob_i32",{{.*}} scope: ![[TLC]],{{.*}} line: [[@LINE-1]],{{.*}} type: ![[I32:[^,]+]]
var glob_i64: Int64 = 64;
var glob_i64: Int64 = 64
// CHECK-DAG: !DIGlobalVariable(name: "glob_i64",{{.*}} scope: ![[TLC]],{{.*}} line: [[@LINE-1]],{{.*}} type: ![[I64:[^,]+]]
var glob_f: Float = 2.89;
var glob_f: Float = 2.89
// CHECK-DAG: !DIGlobalVariable(name: "glob_f",{{.*}} scope: ![[TLC]],{{.*}} line: [[@LINE-1]],{{.*}} type: ![[F:[^,]+]]
var glob_d: Double = 3.14;
var glob_d: Double = 3.14
// CHECK-DAG: !DIGlobalVariable(name: "glob_d",{{.*}} scope: ![[TLC]],{{.*}} line: [[@LINE-1]],{{.*}} type: ![[D:[^,]+]]
var glob_b: Bool = true
// CHECK-DAG: !DIGlobalVariable(name: "glob_b",{{.*}} scope: ![[TLC]],{{.*}} line: [[@LINE-1]],{{.*}} type: ![[B:[^,]+]]
Expand All @@ -47,10 +47,10 @@ var unused: Int32 = -1
func foo(dt: Float) -> Float {
// CHECK-DAG: call void @llvm.dbg.declare
// CHECK-DAG: !DILocalVariable(name: "f"
var f: Float = 9.78;
var f: Float = 9.78
// CHECK-DAG: !DILocalVariable(name: "r"
var r: Float = f*dt;
return r;
var r: Float = f*dt
return r
}

var g = foo(1.0);
Expand Down
2 changes: 1 addition & 1 deletion test/Generics/associated_self_constraints.swift
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ class Subject<T>: Observer, Observable {
observer.onError(error)
}

return self;
return self
}
}

Expand Down
4 changes: 2 additions & 2 deletions test/Generics/function_defs.swift
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ protocol EqualComparable {
func doCompare<T : EqualComparable, U : EqualComparable>(t1: T, t2: T, u: U) -> Bool {
var b1 = t1.isEqual(t2)
if b1 {
return true;
return true
}

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

Expand Down
2 changes: 1 addition & 1 deletion test/IDE/complete_unresolved_members.swift
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ enum SomeEnum3 {
}

struct NotOptions1 {
static let NotSet = 1;
static let NotSet = 1
}

struct SomeOptions1 : OptionSetType {
Expand Down
2 changes: 1 addition & 1 deletion test/IRGen/Inputs/report_dead_method_call/main.swift
Original file line number Diff line number Diff line change
Expand Up @@ -38,5 +38,5 @@ case 3:
callPublicClass()

default:
break;
break
}
4 changes: 2 additions & 2 deletions test/IRGen/abitypes.swift
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ class Foo {
// Make sure the caller-side from Swift also uses indirect-byval for the argument
// x86_64-macosx: define hidden float @_TFC8abitypes3Foo25getXFromRectIndirectSwift{{.*}}(%VSC6MyRect* noalias nocapture dereferenceable({{.*}}), %C8abitypes3Foo*) {{.*}} {
func getXFromRectIndirectSwift(r: MyRect) -> Float {
let f : Float = 1.0;
let f : Float = 1.0
// x86_64-macosx: [[TEMP:%.*]] = alloca [[TEMPTYPE:%.*]], align 4
// 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]])
// x86_64-macosx: ret float [[RESULT]]
Expand Down Expand Up @@ -427,7 +427,7 @@ class Foo {
// Test that the makeOne() that we generate somewhere below doesn't
// use arm_aapcscc for armv7.
func callInline() -> Float {
return makeOne(3,5).second;
return makeOne(3,5).second
}
}

Expand Down
2 changes: 1 addition & 1 deletion test/IRGen/objc_class_export.swift
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ struct BigStructWithNativeObjects {
// CHECK: call void @_TFC17objc_class_export3Foo6boundsfT_VSC6NSRect([[NSRECT]]* noalias nocapture sret {{.*}}, [[FOO]]* [[CAST]])

func convertRectToBacking(r r: NSRect) -> NSRect {
return r;
return r
}
// CHECK: define internal void @_TToFC17objc_class_export3Foo20convertRectToBackingfT1rVSC6NSRect_S1_([[NSRECT]]* noalias nocapture sret, [[OPAQUE5:%.*]]*, i8*, [[NSRECT]]* byval align 8) unnamed_addr {{.*}} {
// CHECK: [[CAST:%[a-zA-Z0-9]+]] = bitcast [[OPAQUE5]]* %1 to [[FOO]]*
Expand Down
2 changes: 1 addition & 1 deletion test/IRGen/objc_subclass.swift
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,7 @@ class SwiftGizmo : Gizmo {
var x = Int()

func getX() -> Int {
return x;
return x
}

override func duplicate() -> Gizmo {
Expand Down
2 changes: 1 addition & 1 deletion test/IRGen/objc_type_encoding.swift
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ func testArchetype(work: P3) {
// CHECK-tvos: private unnamed_addr constant [11 x i8] c"v24@0:8@16\00"

@objc func foo(x: Int -> Int) -> Int {
return 1;
return 1
}
// CHECK-macosx: private unnamed_addr constant [12 x i8] c"q24@0:8@?16\00"
// CHECK-ios: private unnamed_addr constant [12 x i8] c"q24@0:8@?16\00"
Expand Down
2 changes: 1 addition & 1 deletion test/IRGen/sil_witness_tables_inherited_conformance.swift
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ class Cat : Panda {
required init() { }

func getCutenessLevel() -> Int {
return 3;
return 3
}
}

Expand Down
Loading