Skip to content

Commit 4f11ecc

Browse files
committed
Get rid of Int in the debug info tests and preform some general cleanup.
<rdar://problem/20856296> Extinguish 'Int' from DebugInfo tests Swift SVN r31177
1 parent 10afd15 commit 4f11ecc

Some content is hidden

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

43 files changed

+161
-256
lines changed

test/DebugInfo/ASTSection.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
// A type that should be serialized.
2323
class Foo {
2424
init() { }
25-
func bar() -> Int { return 42 }
25+
func bar() -> Int64 { return 42 }
2626
}
2727

2828
// Some toplevel code that should not be serialized.

test/DebugInfo/Constructors.swift

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
// RUN: %target-swift-frontend %s -emit-ir -g -o - | FileCheck %s
22
struct Foo {
33
// Allocating constructor - should have no line table info.
4-
// CHECK: !DISubprogram(name: "init", linkageName: "_TFV12Constructors3FooCfMS0_FT1xSi_S0_",
4+
// CHECK: !DISubprogram(name: "init", linkageName: "_TFV12Constructors3FooCfMS0_FT1xVSs5Int64_S0_",
55
// CHECK-SAME: line: [[@LINE+3]]
66
// CHECK-NOT: scopeLine: 0
77
// CHECK-SAME: isDefinition: true
8-
init(x: Int) {}
9-
func bar(x: Int) {}
8+
init(x: Int64) {}
9+
func bar(x: Int64) {}
1010
}
1111

1212
var f = Foo(x: 1)

test/DebugInfo/Destructors.swift

+2-2
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ class Foo {
66
// CHECK: !DISubprogram(name: "deinit", linkageName: "_TFC11Destructors3FooD"
77
// CHECK-SAME: line: [[@LINE-2]]
88
// CHECK-SAME: isDefinition: true
9-
var x : Int
10-
init(x: Int) { self.x = x }
9+
var x : Int64
10+
init(x: Int64) { self.x = x }
1111
func bar() -> (() -> ()) { return { markUsed(self.x) } }
1212
}
1313

test/DebugInfo/DynamicSelf.swift

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
// RUN: %target-swift-frontend %s -emit-ir -g -o - | FileCheck %s
22

33
class C {
4-
let n : Int
5-
required init (number i :Int) {
4+
let n : Int64
5+
required init (number i :Int64) {
66
self.n = i
77
}
88
}

test/DebugInfo/PrivateDiscriminator.swift

+4-4
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,14 @@
99
func markUsed<T>(t: T) {}
1010

1111
private class A {
12-
init(val : Int) { member = val }
13-
private let member : Int
12+
init(val : Int64) { member = val }
13+
private let member : Int64
1414
// CHECK: !DISubprogram(name: "getMember"
1515
// CHECK-SAME: linkageName: "{{[^"]*}}[[DISCRIMINATOR]]
1616
// CHECK-SAME: line: [[@LINE+2]]
1717
// CHECK-SAME: isLocal: true, isDefinition: true
18-
private func getMember() -> Int { return member }
19-
func getVal() -> Int { return getMember() }
18+
private func getMember() -> Int64 { return member }
19+
func getVal() -> Int64 { return getMember() }
2020
}
2121

2222
func f() {

test/DebugInfo/accessors.swift

+3-3
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@
55
// CHECK: !DISubprogram(name: "x.set"
66

77
// Variable getter/setter
8-
var _x : Int = 0
9-
var x_modify_count : Int = 0
10-
var x: Int {
8+
var _x : Int64 = 0
9+
var x_modify_count : Int64 = 0
10+
var x: Int64 {
1111
get {
1212
return _x
1313
}

test/DebugInfo/anonymous.swift

+2-2
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,12 @@ protocol F_ {
1010
}
1111

1212
protocol F : F_ {
13-
func ~> (_: Self, _: (_Distance, (Self))) -> Int
13+
func ~> (_: Self, _: (_Distance, (Self))) -> Int64
1414
}
1515

1616
struct _Distance {}
1717

18-
func ~> <I: F_>(self_:I, _: (_Distance, (I))) -> Int {
18+
func ~> <I: F_>(self_:I, _: (_Distance, (I))) -> Int64 {
1919
self_.successor()
2020
markUsed("F")
2121
return 0

test/DebugInfo/apple-types-accel.swift

+3-3
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
// REQUIRES: OS=macosx
77

88
// Verify that the unmangles basenames end up in the accelerator table.
9-
// CHECK-ACCEL-DAG: str[0]{{.*}}"Int"
9+
// CHECK-ACCEL-DAG: str[0]{{.*}}"Int64"
1010
// CHECK-ACCEL-DAG: str[0]{{.*}}"foo"
1111

1212
// Verify that the mangled names end up in the debug info.
@@ -21,10 +21,10 @@
2121
// CHECK-SAME: line: [[@LINE+2]]
2222
// CHECK-SAME: identifier: "_TtC4main3foo"
2323
class foo {
24-
var x : Int = 1
24+
var x : Int64 = 1
2525
}
2626

27-
func main() -> Int {
27+
func main() -> Int64 {
2828
var thefoo = foo();
2929
return thefoo.x
3030
}

test/DebugInfo/archetypes2.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,4 @@ class C<A> {
1010
}
1111
}
1212

13-
C<Int>().foo(1, y: 3.14);
13+
C<Int64>().foo(1, y: 3.14);

test/DebugInfo/arg-debug_value.swift

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@
22

33
// Verify that arguments described by debug_value intrinsics are only
44
// emitted once.
5-
var g = 1
5+
var g: Int64 = 1
66

77
class Foo {
8-
var x: Int
8+
var x: Int64
99
// CHECK: define {{.*}}_TFC4main3FoocfMS0_FT_S0_
1010
// CHECK: entry:
1111
// CHECK-NEXT: %[[SELF:.*]] = alloca

test/DebugInfo/argument.swift

+9-9
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
func markUsed<T>(t: T) {}
44

55
// CHECK-DAG: !DILocalVariable(tag: DW_TAG_arg_variable, name: "arg", arg: 1,{{.*}} line: [[@LINE+1]]
6-
func a(arg : Int)
6+
func a(arg : Int64)
77
{
88
// CHECK-DAG: !DILocalVariable(tag: DW_TAG_auto_variable, name: "local",{{.*}} line: [[@LINE+1]]
99
var local = arg
@@ -12,25 +12,25 @@ func a(arg : Int)
1212
// CHECK-DAG: !DILocalVariable(tag: DW_TAG_arg_variable, name: "a", arg: 1,{{.*}} line: [[@LINE+3]]
1313
// CHECK-DAG: !DILocalVariable(tag: DW_TAG_arg_variable, name: "b", arg: 2,{{.*}} line: [[@LINE+2]]
1414
// CHECK-DAG: !DILocalVariable(tag: DW_TAG_arg_variable, name: "c", arg: 3,{{.*}} line: [[@LINE+1]]
15-
func many(a: Int, b: (Int, Int), c: Int) -> Int {
15+
func many(a: Int64, b: (Int64, Int64), c: Int64) -> Int64 {
1616
// CHECK-DAG: !DILocalVariable(tag: DW_TAG_auto_variable, name: "i1",{{.*}} line: [[@LINE+1]]
1717
var i1 = a
1818
// CHECK-DAG: !DILocalVariable(tag: DW_TAG_auto_variable, name: "i2",{{.*}} line: [[@LINE+2]]
1919
// CHECK-DAG: !DILocalVariable(tag: DW_TAG_auto_variable, name: "i3",{{.*}} line: [[@LINE+1]]
20-
var (i2, i3) : (Int, Int) = b
20+
var (i2, i3) : (Int64, Int64) = b
2121
// CHECK-DAG: !DILocalVariable(tag: DW_TAG_auto_variable, name: "i4",{{.*}} line: [[@LINE+1]]
2222
var i4 = c
2323
return i1+i2+i3+i4
2424
}
2525

2626
class A {
27-
var member : Int
27+
var member : Int64
2828
// CHECK-DAG: !DILocalVariable(tag: DW_TAG_arg_variable, name: "a", arg: 1,{{.*}} line: [[@LINE+1]]
29-
init(a: Int) { member = a }
29+
init(a: Int64) { member = a }
3030

3131
// CHECK-DAG: !DILocalVariable(tag: DW_TAG_arg_variable, name: "offset", arg: 1,{{.*}} line: [[@LINE+2]]
3232
// CHECK-DAG: !DILocalVariable(tag: DW_TAG_arg_variable, name: "self", arg: 2,{{.*}} line: [[@LINE+1]]
33-
func getValuePlus(offset: Int) -> Int {
33+
func getValuePlus(offset: Int64) -> Int64 {
3434
// CHECK-DAG: !DILocalVariable(tag: DW_TAG_auto_variable, name: "a",{{.*}} line: [[@LINE+1]]
3535
var a = member
3636
return a+offset
@@ -39,7 +39,7 @@ class A {
3939
// CHECK-DAG: !DILocalVariable(tag: DW_TAG_arg_variable, name: "factor", arg: 1,{{.*}} line: [[@LINE+3]]
4040
// CHECK-DAG: !DILocalVariable(tag: DW_TAG_arg_variable, name: "offset", arg: 2,{{.*}} line: [[@LINE+2]]
4141
// CHECK-DAG: !DILocalVariable(tag: DW_TAG_arg_variable, name: "self", arg: 3,{{.*}} line: [[@LINE+1]]
42-
func getValueTimesPlus(factor: Int, offset: Int) -> Int {
42+
func getValueTimesPlus(factor: Int64, offset: Int64) -> Int64 {
4343
// CHECK-DAG: !DILocalVariable(tag: DW_TAG_auto_variable, name: "a",{{.*}} line: [[@LINE+1]]
4444
var a = member
4545
// CHECK-DAG: !DILocalVariable(tag: DW_TAG_auto_variable, name: "f",{{.*}} line: [[@LINE+1]]
@@ -57,12 +57,12 @@ class A {
5757
// Curried functions have their arguments backwards.
5858
// CHECK: !DILocalVariable(tag: DW_TAG_arg_variable, name: "b", arg: 1,{{.*}} line: [[@LINE+2]]
5959
// CHECK: !DILocalVariable(tag: DW_TAG_arg_variable, name: "a", arg: 2,{{.*}} line: [[@LINE+1]]
60-
func uncurry (a: Int) (b: Int) -> (Int, Int) {
60+
func uncurry (a: Int64) (b: Int64) -> (Int64, Int64) {
6161
return (a, b)
6262
}
6363

6464
// CHECK: !DILocalVariable(tag: DW_TAG_arg_variable, name: "x", arg: 1,{{.*}} line: [[@LINE+2]]
6565
// CHECK: !DILocalVariable(tag: DW_TAG_arg_variable, name: "y", arg: 2,{{.*}} line: [[@LINE+1]]
66-
func tuple(x: Int, y: (Int, Float, String)) -> Int {
66+
func tuple(x: Int64, y: (Int64, Float, String)) -> Int64 {
6767
return x+y.0;
6868
}

test/DebugInfo/attributes.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ class SwiftClass {
1212
@objc func objcmethod() -> () {}
1313
func swiftmethod() -> () {}
1414
// Block attribute
15-
func f(someBlock: @convention(block) (Int) -> Int) {
15+
func f(someBlock: @convention(block) (Int64) -> Int64) {
1616
}
1717
}
1818

test/DebugInfo/autoclosure.swift

+4-8
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,13 @@
11
// RUN: %target-swift-frontend %s -emit-ir -g -o - | FileCheck %s
22

3-
// CHECK: define linkonce_odr hidden void @_TFF11autoclosure7call_meFSiT_u_KT_PSs11BooleanType_
3+
// CHECK: define linkonce_odr hidden void @_TFF11autoclosure7call_meFVSs5Int64T_u_KT_PSs11BooleanType_
44
// CHECK: call void @llvm.dbg.declare{{.*}}, !dbg
55
// CHECK: , !dbg ![[DBG:.*]]
66

7-
func markUsed<T>(t: T) {}
8-
9-
func get_truth(input: Int) -> Int {
7+
func get_truth(input: Int64) -> Int64 {
108
return input % 2
119
}
1210

13-
1411
// Since this is an autoclosure test, don't use &&, which is transparent.
1512
infix operator &&&&& {
1613
associativity left
@@ -21,14 +18,13 @@ func &&&&&(lhs: BooleanType, @autoclosure rhs: ()->BooleanType) -> Bool {
2118
return lhs.boolValue ? rhs().boolValue : false
2219
}
2320

24-
func call_me(var input: Int) -> Void {
21+
func call_me(var input: Int64) -> Void {
2522
// rdar://problem/14627460
2623
// An autoclosure should have a line number in the debug info and a scope line of 0.
27-
// CHECK-DAG: !DISubprogram({{.*}}linkageName: "_TFF11autoclosure7call_meFSiT_u_KT_PSs11BooleanType_",{{.*}} line: [[@LINE+3]],{{.*}} isLocal: false, isDefinition: true
24+
// CHECK-DAG: !DISubprogram({{.*}}linkageName: "_TFF11autoclosure7call_meFVSs5Int64T_u_KT_PSs11BooleanType_",{{.*}} line: [[@LINE+3]],{{.*}} isLocal: false, isDefinition: true
2825
// But not in the line table.
2926
// CHECK-DAG: ![[DBG]] = !DILocation(line: [[@LINE+1]],
3027
if input != 0 &&&&& ( get_truth (input * 2 + 1) > 0 ) {
31-
markUsed("Whew, passed that test.")
3228
}
3329

3430
}

test/DebugInfo/byref-capture.swift

+5-10
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,11 @@
11
// RUN: %target-swift-frontend %s -emit-ir -g -o - | FileCheck %s
22

3-
func markUsed<T>(t: T) {}
4-
5-
func makeIncrementor(inc : Int) -> () -> Int
3+
func makeIncrementor(inc : Int64) -> () -> Int64
64
{
7-
var sum = 0
5+
var sum : Int64 = 0
86
// CHECK: define {{.*}}5inner
9-
func inner() -> Int {
10-
// CHECK: call void @llvm.dbg.declare(metadata %Si** %{{.*}}, metadata ![[SUM_CAPTURE:[0-9]+]], metadata ![[DEREF:[0-9]+]])
7+
func inner() -> Int64 {
8+
// CHECK: call void @llvm.dbg.declare(metadata %VSs5Int64** %{{.*}}, metadata ![[SUM_CAPTURE:[0-9]+]], metadata ![[DEREF:[0-9]+]])
119
// CHECK-DAG: ![[SUM_CAPTURE]] = !DILocalVariable(tag: DW_TAG_arg_variable, name: "sum",{{.*}} line: [[@LINE-4]]
1210
// CHECK-DAG: ![[DEREF]] = !DIExpression(DW_OP_deref
1311
sum += inc
@@ -16,7 +14,4 @@ func makeIncrementor(inc : Int) -> () -> Int
1614
return inner
1715
}
1816

19-
var incrementor = makeIncrementor (5)
20-
var a = 5
21-
var more_than_a = incrementor ()
22-
markUsed("a was \(a) and more_than_a was \(more_than_a)")
17+
var incrementor = makeIncrementor(5)

test/DebugInfo/callexpr.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
func markUsed<T>(t: T) {}
44

5-
func foo(a : Int, _ b : Int) -> Int {
5+
func foo(a : Int64, _ b : Int64) -> Int64 {
66
return a+b
77
}
88

test/DebugInfo/closure-args.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ func main() -> Void
2929
// Ensure the two local_vars are in different lexical scopes.
3030
// CHECK-DAG: !DILocalVariable(tag: DW_TAG_auto_variable, name: "local_var", scope: ![[THENSCOPE:[0-9]+]],{{.*}} line: [[@LINE+2]],
3131
// CHECK-DAG: ![[THENSCOPE]] = distinct !DILexicalBlock({{.*}} line: [[@LINE-3]]
32-
var local_var : Int = 10
32+
var local_var : Int64 = 10
3333
print("I have an int here \(local_var).\n", terminator: "")
3434
return false
3535
}

test/DebugInfo/closure-args2.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ func main () -> Void
1717

1818
if rhs == random_string
1919
|| rhs.unicodeScalars.count == random_int {
20-
var local_var : Int = 10
20+
var local_var : Int64 = 10
2121
print("I have an int here \(local_var).\n", terminator: "")
2222
return false
2323
}

test/DebugInfo/closure.swift

+4-4
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,11 @@ func foldl1<T>(list: [T], _ function: (a: T, b: T) -> T) -> T {
1111
return accumulator
1212
}
1313

14-
var a = [Int](count: 10, repeatedValue: 0)
15-
for i in 0..<10 { a[i] = i }
14+
var a = [Int64](count: 10, repeatedValue: 0)
15+
for i in 0..<10 { a[i] = Int64(i) }
1616
// A closure is not an artificial function (the last i32 0).
17-
// CHECK: !DISubprogram({{.*}}linkageName: "_TF7closureU_FTSiSi_Si",{{.*}} line: 20,{{.*}} scopeLine: 20,
17+
// CHECK: !DISubprogram({{.*}}linkageName: "_TF7closureU_FTVSs5Int64S0__S0_",{{.*}} line: 20,{{.*}} scopeLine: 20,
1818
// CHECK: !DILocalVariable(tag: DW_TAG_arg_variable, name: "$0",{{.*}} line: [[@LINE+2]],
1919
// CHECK: !DILocalVariable(tag: DW_TAG_arg_variable, name: "$1",{{.*}} line: [[@LINE+1]],
20-
var sum:Int = foldl1(a, { $0 + $1 })
20+
var sum:Int64 = foldl1(a, { $0 + $1 })
2121
markUsed(sum)

test/DebugInfo/dynamic_layout.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ class Class <T> {
1616
}
1717

1818
func main() {
19-
var v = Class<Int>(_x: 1)
19+
var v = Class<Int64>(_x: 1)
2020
var tuple = v.foo("hi")
2121
markUsed(tuple.0)
2222
markUsed(tuple.1)

test/DebugInfo/enum.swift

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@
55
// CHECK-SAME: line: [[@LINE+3]]
66
// CHECK-SAME: size: 8, align: 8,
77
// CHECK-SAME: identifier: "_TtO4enum5Color"
8-
enum Color : UInt {
8+
enum Color : UInt64 {
99
// CHECK: !DIDerivedType(tag: DW_TAG_member, name: "Red"
10-
// CHECK-SAME: baseType: !"_TtSu"
10+
// CHECK-SAME: baseType: !"_TtVSs6UInt64"
1111
// CHECK-SAME: size: 8, align: 8{{[,)]}}
1212
case Red, Green, Blue
1313
}

test/DebugInfo/fnptr.swift

+6-6
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
// RUN: %target-swift-frontend %s -emit-ir -g -o - | FileCheck %s
22

3-
// CHECK-DAG: ![[SINODE:.*]] = !DICompositeType(tag: DW_TAG_structure_type, name: "Int",{{.*}} identifier: [[SI:.*]])
3+
// CHECK-DAG: ![[SINODE:.*]] = !DICompositeType(tag: DW_TAG_structure_type, name: "Int64",{{.*}} identifier: [[SI:.*]])
44
// CHECK-DAG: ![[SFNODE:.*]] = !DICompositeType(tag: DW_TAG_structure_type, name: "Float",{{.*}} identifier: [[SF:.*]])
55
// CHECK-DAG: ![[VOIDNODE:.*]] = !DICompositeType(tag: DW_TAG_structure_type, name: "_TtT_",{{.*}} identifier: [[VOID:.*]])
66
func bar() {
77
print("bar()", terminator: "")
88
}
9-
func baz(i: Float) -> Int { return 0; }
10-
func barz(i: Float, _ j: Float) -> Int { return 0; }
11-
func main() -> Int {
9+
func baz(i: Float) -> Int64 { return 0; }
10+
func barz(i: Float, _ j: Float) -> Int64 { return 0; }
11+
func main() -> Int64 {
1212

1313
// CHECK-DAG: !DILocalVariable(tag: DW_TAG_auto_variable, name: "bar_function_pointer",{{.*}} line: [[@LINE+1]],{{.*}} type: !"[[BARPT:[^,]+]]"
1414
var bar_function_pointer = bar
@@ -26,7 +26,7 @@ func main() -> Int {
2626
// CHECK-DAG: ![[BAZMEMBER]] = !DIDerivedType(tag: DW_TAG_member,{{.*}} baseType: ![[BAZPTR:[0-9]+]]
2727
// CHECK-DAG: ![[BAZPTR]] = !DIDerivedType(tag: DW_TAG_pointer_type,{{.*}} baseType: ![[BAZT:[0-9]+]]
2828
// CHECK-DAG: ![[BAZT]] = !DISubroutineType(types: ![[BAZARGS:.*]])
29-
// CHECK-DAG: ![[BAZARGS]] = !{!"_TtSi", !"_TtSf"}
29+
// CHECK-DAG: ![[BAZARGS]] = !{!"_TtVSs5Int64", !"_TtSf"}
3030
var baz_function_pointer = baz
3131
baz_function_pointer(2.89)
3232

@@ -36,7 +36,7 @@ func main() -> Int {
3636
// CHECK-DAG: ![[BARZMEMBER]] = !DIDerivedType(tag: DW_TAG_member,{{.*}} baseType: ![[BARZPTR:[0-9]+]]
3737
// CHECK-DAG: ![[BARZPTR]] = !DIDerivedType(tag: DW_TAG_pointer_type,{{.*}} baseType: ![[BARZT:[0-9]+]]
3838
// CHECK-DAG: ![[BARZT]] = !DISubroutineType(types: ![[BARZARGS:.*]])
39-
// CHECK-DAG: ![[BARZARGS]] = !{!"_TtSi", !"_TtSf", !"_TtSf"}
39+
// CHECK-DAG: ![[BARZARGS]] = !{!"_TtVSs5Int64", !"_TtSf", !"_TtSf"}
4040
var barz_function_pointer = barz
4141
return barz_function_pointer(2.89, -1.0)
4242
}

0 commit comments

Comments
 (0)