Skip to content
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

Mangling: enable new mangling for symbols #8126

Merged
merged 1 commit into from
Mar 16, 2017
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
2 changes: 1 addition & 1 deletion include/swift/Demangling/ManglingMacros.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
// TODO: When we get rid of the old mangling, the term "new mangling" should
// just be renamed to "mangling".

//#define USE_NEW_MANGLING
#define USE_NEW_MANGLING

#define STRINGIFY_MANGLING(M) #M
#define MANGLE_AS_STRING(M) STRINGIFY_MANGLING(M)
Expand Down
4 changes: 2 additions & 2 deletions test/DebugInfo/Errors.swift
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,12 @@ enum MyError : Error {
// thrown error we create a shadow stack location holding the address of the
// location that holds the pointer to the error instead.
func simple(_ placeholder: Int64) throws -> () {
// CHECK: define {{.*}}void @_TF6Errors6simpleFzVs5Int64T_(i64, %swift.refcounted* swiftself, %swift.error**)
// CHECK: define {{.*}}void @_T06Errors6simpleys5Int64VKF(i64, %swift.refcounted* swiftself, %swift.error**)
// CHECK: call void @llvm.dbg.declare
// CHECK: call void @llvm.dbg.declare({{.*}}, metadata ![[ERROR:[0-9]+]], metadata ![[DEREF:[0-9]+]])
// CHECK: ![[ERROR]] = !DILocalVariable(name: "$error", arg: 2,
// CHECK-SAME: type: ![[ERRTY:.*]], flags: DIFlagArtificial)
// CHECK: ![[ERRTY]] = !DICompositeType({{.*}}identifier: "_TtPs5Error_"
// CHECK: ![[ERRTY]] = !DICompositeType({{.*}}identifier: "_T0s5Error_pD"
// CHECK: ![[DEREF]] = !DIExpression(DW_OP_deref)
throw MyError.Simple
}
Expand Down
2 changes: 1 addition & 1 deletion test/DebugInfo/LinetableArtificialFn.swift
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
// Verify that a helper function that is generated on-the-fly does
// not mess up the linetable of the calling function.
// CHECK: store i2048 10, i2048* [[STKLOC:%.*]], align
// CHECK: call swiftcc {{(i32|i64)}} @_TFSiCfT22_builtinIntegerLiteralBi2048__Si(i2048* {{.*}} [[STKLOC]]
// CHECK: call swiftcc {{(i32|i64)}} @_T0S2iBi2048_22_builtinIntegerLiteral_tcfC(i2048* {{.*}} [[STKLOC]]
// CHECK: store {{(i32|i64)}} {{.*}}getelementptr
// CHECK: store {{(i32|i64)}} {{.*}}getelementptr{{.*}}, !dbg ![[DBG:[0-9]+]]
// CHECK-NOT: ![[DBG]] = !{i32 0, i32 0,
Expand Down
4 changes: 2 additions & 2 deletions test/DebugInfo/basic.swift
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ func foo(_ a: Int64, _ b: Int64) -> Int64 {
// CHECK-DAG: smul{{.*}}, !dbg ![[MUL:[0-9]+]]
// CHECK-DAG: [[MUL]] = !DILocation(line: [[@LINE+4]], column: 16,
// Runtime call to multiply function:
// CHECK-NOSIL: @_TFsoi1mFTVs5Int64S__S_{{.*}}, !dbg ![[MUL:[0-9]+]]
// CHECK-NOSIL: @_T0s1mois5Int64VAC_ACtF{{.*}}, !dbg ![[MUL:[0-9]+]]
// CHECK-NOSIL: [[MUL]] = !DILocation(line: [[@LINE+1]], column: 16,
return a*b
} else {
Expand All @@ -74,7 +74,7 @@ func foo(_ a: Int64, _ b: Int64) -> Int64 {

// Function type for foo.
// CHECK-DAG: ![[FOOTYPE]] = !DISubroutineType(types: ![[PARAMTYPES:[0-9]+]])
// CHECK-DAG: ![[INT64:.*]] = !DICompositeType(tag: DW_TAG_structure_type, name: "Int64", {{.*}}, identifier: "_TtVs5Int64")
// CHECK-DAG: ![[INT64:.*]] = !DICompositeType(tag: DW_TAG_structure_type, name: "Int64", {{.*}}, identifier: "_T0s5Int64VD")
// CHECK-DAG: ![[PARAMTYPES]] = !{![[INT64]], ![[INT64]], ![[INT64]]}
// Import of the main module with the implicit name.
// CHECK-DAG: !DIImportedEntity(tag: DW_TAG_imported_module, scope: ![[MAINFILE]], entity: ![[MAINMODULE:[0-9]+]], line: 1)
Expand Down
2 changes: 1 addition & 1 deletion test/DebugInfo/bool.swift
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
func markUsed<T>(_ t: T) {}

// Int1 uses 1 bit, but is aligned at 8 bits.
// CHECK: !DIBasicType(name: "_TtBi1_", size: 1, encoding: DW_ATE_unsigned)
// CHECK: !DIBasicType(name: "_T0Bi1_D", size: 1, encoding: DW_ATE_unsigned)
func main() {
var t = true
var f = false
Expand Down
2 changes: 1 addition & 1 deletion test/DebugInfo/byref-capture.swift
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ func makeIncrementor(_ inc : Int64) -> () -> Int64
// CHECK-SAME: metadata ![[SUM_CAPTURE:[0-9]+]],
// CHECK-SAME: metadata ![[EMPTY:.*]])
// CHECK: ![[EMPTY]] = !DIExpression()
// CHECK: ![[INOUTTY:[0-9]+]] = !DICompositeType({{.*}}identifier: "_TtRVs5Int64"
// CHECK: ![[INOUTTY:[0-9]+]] = !DICompositeType({{.*}}identifier: "_T0s5Int64VzD"
// ^ inout type.
// CHECK: ![[SUM_CAPTURE]] = !DILocalVariable(name: "sum", arg: 1,
// CHECK-SAME: line: [[@LINE-10]], type: ![[INOUTTY]]
Expand Down
24 changes: 12 additions & 12 deletions test/DebugInfo/enum.swift
Original file line number Diff line number Diff line change
Expand Up @@ -10,34 +10,34 @@ enum Either {
// CHECK-SAME: size: {{328|168}},
}
// CHECK: ![[EMPTY:.*]] = !{}
// DWARF: ![[INT:.*]] = !DICompositeType({{.*}}identifier: "_TtSi"
// DWARF: ![[INT:.*]] = !DICompositeType({{.*}}identifier: "_T0SiD"
let E : Either = .Neither;

// CHECK: !DICompositeType({{.*}}name: "Color",
// CHECK-SAME: line: [[@LINE+3]]
// CHECK-SAME: size: 8, align: 8,
// CHECK-SAME: identifier: "_TtO4enum5Color"
// CHECK-SAME: identifier: "_T04enum5ColorOD"
enum Color : UInt64 {
// This is effectively a 2-bit bitfield:
// DWARF: !DIDerivedType(tag: DW_TAG_member, name: "Red"
// DWARF-SAME: baseType: ![[UINT64:[0-9]+]]
// DWARF-SAME: size: 8, align: 8{{[,)]}}
// DWARF: ![[UINT64]] = !DICompositeType({{.*}}identifier: "_TtVs6UInt64"
// DWARF: ![[UINT64]] = !DICompositeType({{.*}}identifier: "_T0s6UInt64VD"
case Red, Green, Blue
}

// CHECK: !DICompositeType({{.*}}name: "MaybeIntPair",
// CHECK-SAME: line: [[@LINE+3]],
// CHECK-SAME: size: 136, align: 64{{[,)]}}
// CHECK-SAME: identifier: "_TtO4enum12MaybeIntPair"
// CHECK-SAME: identifier: "_T04enum12MaybeIntPairOD"
enum MaybeIntPair {
// DWARF: !DIDerivedType(tag: DW_TAG_member, name: "none"
// DWARF-SAME: baseType: ![[INT]], align: 8{{[,)]}}
case none
// DWARF: !DIDerivedType(tag: DW_TAG_member, name: "just"
// DWARF-SAME: baseType: ![[INTTUP:[0-9]+]]
// DWARF-SAME: size: 128, align: 64{{[,)]}}
// DWARF: ![[INTTUP]] = !DICompositeType({{.*}}identifier: "_TtTVs5Int64S__"
// DWARF: ![[INTTUP]] = !DICompositeType({{.*}}identifier: "_T0s5Int64V_ABtD"
case just(Int64, Int64)
}

Expand All @@ -51,36 +51,36 @@ let c = MaybeIntPair.just(74, 75)
// CHECK: !DICompositeType({{.*}}name: "Maybe",
// CHECK-SAME: line: [[@LINE-8]],
// CHECK-SAME: size: 8, align: 8{{[,)]}}
// CHECK-SAME: identifier: "_TtGO4enum5MaybeOS_5Color_"
// CHECK-SAME: identifier: "_T04enum5MaybeOyAA5ColorOGD"
let movie : Maybe<Color> = .none

public enum Nothing { }
public func foo(_ empty : Nothing) { }
// CHECK: !DICompositeType({{.*}}name: "Nothing", {{.*}}elements: ![[EMPTY]]

// CHECK: !DICompositeType({{.*}}name: "Rose", {{.*}}elements: ![[ELTS:[0-9]+]],
// CHECK-SAME: {{.*}}identifier: "_TtGO4enum4Rosex_")
// CHECK-SAME: {{.*}}identifier: "_T04enum4RoseOyxGD")
enum Rose<A> {
case MkRose(() -> A, () -> [Rose<A>])
// DWARF: !DICompositeType({{.*}}name: "Rose",{{.*}}identifier: "_TtGO4enum4RoseQq_S0__")
// DWARF: !DICompositeType({{.*}}name: "Rose",{{.*}}identifier: "_T04enum4RoseOyAA3fooACyxGAElFQq_GD")
case IORose(() -> Rose<A>)
}

func foo<T>(_ x : Rose<T>) -> Rose<T> { return x }

// CHECK: !DICompositeType({{.*}}name: "Tuple", {{.*}}elements: ![[ELTS:[0-9]+]],
// CHECK-SAME: {{.*}}identifier: "_TtGO4enum5TupleQq_FS_3barurFGS0_x_GS0_x__")
// CHECK-SAME: {{.*}}identifier: "_T04enum5TupleOyAA3barACyxGAElFQq_GD")
// DWARF: !DICompositeType({{.*}}name: "Tuple", {{.*}}elements: ![[ELTS:[0-9]+]],
// DWARF-SAME: {{.*}}identifier: "_TtGO4enum5Tuplex_")
// DWARF-SAME: {{.*}}identifier: "_T04enum5TupleOyxGD")
public enum Tuple<P> {
// DWARF: !DICompositeType({{.*}}name: "Tuple",{{.*}}identifier: "_TtGO4enum5TupleQq_S0__")
// DWARF: !DICompositeType({{.*}}name: "Tuple",{{.*}}identifier: "_T04enum5TupleOyAA3barACyxGAElFQq_GD")
case C(P, () -> Tuple)
}

func bar<T>(_ x : Tuple<T>) -> Tuple<T> { return x }

// CHECK: !DILocalVariable(name: "self", arg: 1, {{.*}} line: [[@LINE+5]], type: ![[LIST:.*]], flags: DIFlagArtificial)
// CHECK: ![[LIST]] = !DICompositeType({{.*}}identifier: "_TtGO4enum4ListQq_S0__"
// CHECK: ![[LIST]] = !DICompositeType({{.*}}identifier: "_T04enum4ListOyACQq_GD"
public enum List<T> {
indirect case Tail(List, T)
case End
Expand Down
14 changes: 7 additions & 7 deletions test/DebugInfo/fnptr.swift
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

// CHECK-DAG: ![[SINODE:.*]] = !DICompositeType(tag: DW_TAG_structure_type, name: "Int64",{{.*}} identifier: [[SI:.*]])
// CHECK-DAG: ![[SFNODE:.*]] = !DICompositeType(tag: DW_TAG_structure_type, name: "Float",{{.*}} identifier: [[SF:.*]])
// CHECK-DAG: ![[VOIDNODE:.*]] = !DICompositeType(tag: DW_TAG_structure_type, name: "_TtT_",{{.*}} identifier: [[VOID:.*]])
// CHECK-DAG: ![[VOIDNODE:.*]] = !DICompositeType(tag: DW_TAG_structure_type, name: "_T0ytD",{{.*}} identifier: [[VOID:.*]])
func bar() {
print("bar()", terminator: "")
}
Expand All @@ -12,34 +12,34 @@ func barz(_ i: Float, _ j: Float) -> Int64 { return 0; }
func main() -> Int64 {
// CHECK-DAG: !DILocalVariable(name: "bar_fnptr",{{.*}} line: [[@LINE+3]],{{.*}} type: ![[BARPT:[0-9]+]]
// AST-DAG: !DILocalVariable(name: "bar_fnptr",{{.*}} line: [[@LINE+2]],{{.*}} type: ![[BAR_T:[0-9]+]]
// AST-DAG: ![[BAR_T]] = !DICompositeType({{.*}}, identifier: "_TtXFo___")
// AST-DAG: ![[BAR_T]] = !DICompositeType({{.*}}, identifier: "_T0Ix_D")
var bar_fnptr = bar
// CHECK-DAG: ![[BARPT]] = !DICompositeType(tag: DW_TAG_structure_type, {{.*}} elements: ![[BARMEMBERS:[0-9]+]]
// CHECK-DAG: ![[BARMEMBERS]] = !{![[BARMEMBER:.*]], {{.*}}}
// CHECK-DAG: ![[BARMEMBER]] = !DIDerivedType(tag: DW_TAG_member,{{.*}} baseType: ![[BARPTR:[0-9]+]]
// CHECK-DAG: ![[BARPTR]] = !DIDerivedType(tag: DW_TAG_pointer_type,{{.*}} baseType: ![[BART:[0-9]+]]
// CHECK-DAG: ![[BART]] = !DISubroutineType(types: ![[BARARGS:[0-9]+]])
// CHECK-DAG: ![[BARARGS]] = !{![[VOID:.*]]}
// CHECK-DAG: ![[VOID]] = {{.*}}identifier: "_TtT_"
// CHECK-DAG: ![[VOID]] = {{.*}}identifier: "_T0ytD"
bar_fnptr();

// CHECK-DAG: !DILocalVariable(name: "baz_fnptr",{{.*}} type: ![[BAZPT:[0-9]+]]
// AST-DAG: !DILocalVariable(name: "baz_fnptr",{{.*}} type: ![[BAZ_T:[0-9]+]]
// AST-DAG: ![[BAZ_T]] = !DICompositeType({{.*}}, identifier: "_TtXFo_dSf_dVs5Int64_")
// AST-DAG: ![[BAZ_T]] = !DICompositeType({{.*}}, identifier: "_T0Sfs5Int64VIxyd_D")
// CHECK-DAG: ![[BAZPT]] = !DICompositeType(tag: DW_TAG_structure_type, {{.*}} elements: ![[BAZMEMBERS:[0-9]+]]
// CHECK-DAG: ![[BAZMEMBERS]] = !{![[BAZMEMBER:.*]], {{.*}}}
// CHECK-DAG: ![[BAZMEMBER]] = !DIDerivedType(tag: DW_TAG_member,{{.*}} baseType: ![[BAZPTR:[0-9]+]]
// CHECK-DAG: ![[BAZPTR]] = !DIDerivedType(tag: DW_TAG_pointer_type,{{.*}} baseType: ![[BAZT:[0-9]+]]
// CHECK-DAG: ![[BAZT]] = !DISubroutineType(types: ![[BAZARGS:.*]])
// CHECK-DAG: ![[BAZARGS]] = !{![[INT:.*]], ![[FLOAT:.*]]}
// CHECK-DAG: ![[INT]] = {{.*}}identifier: "_TtVs5Int64"
// CHECK-DAG: ![[FLOAT]] = {{.*}}identifier: "_TtSf"
// CHECK-DAG: ![[INT]] = {{.*}}identifier: "_T0s5Int64VD"
// CHECK-DAG: ![[FLOAT]] = {{.*}}identifier: "_T0SfD"
var baz_fnptr = baz
baz_fnptr(2.89)

// CHECK-DAG: !DILocalVariable(name: "barz_fnptr",{{.*}} type: ![[BARZPT:[0-9]+]]
// AST_DAG: !DILocalVariable(name: "barz_fnptr",{{.*}} type: ![[BARZ_T:[0-9]+]]
// AST-DAG: ![[BARZ_T:[0-9]+]] = !DICompositeType({{.*}}, identifier: "_TtXFo_dSfdSf_dVs5Int64_")
// AST-DAG: ![[BARZ_T:[0-9]+]] = !DICompositeType({{.*}}, identifier: "_T0S2fs5Int64VIxyyd_D")
// CHECK-DAG: ![[BARZPT]] = !DICompositeType(tag: DW_TAG_structure_type,{{.*}} elements: ![[BARZMEMBERS:[0-9]+]]
// CHECK-DAG: ![[BARZMEMBERS]] = !{![[BARZMEMBER:.*]], {{.*}}}
// CHECK-DAG: ![[BARZMEMBER]] = !DIDerivedType(tag: DW_TAG_member,{{.*}} baseType: ![[BARZPTR:[0-9]+]]
Expand Down
18 changes: 9 additions & 9 deletions test/DebugInfo/inout.swift
Original file line number Diff line number Diff line change
Expand Up @@ -8,24 +8,24 @@
func Close(_ fn: () -> Int64) { fn() }
typealias MyFloat = Float

// CHECK: define hidden {{.*}}void @_TF5inout13modifyFooHeap
// CHECK: define hidden swiftcc void @_T05inout13modifyFooHeap{{[_0-9a-zA-Z]*}}F
// CHECK: %[[ALLOCA:.*]] = alloca %Ts5Int64V*
// CHECK: call void @llvm.dbg.declare(metadata
// CHECK-SAME: %[[ALLOCA]], metadata ![[A:[0-9]+]]

// Closure with promoted capture.
// PROMO-CHECK: define {{.*}}@_TFF5inout13modifyFooHeapFTRVs5Int64Sf_T_U_FT_S0_
// PROMO-CHECK: define {{.*}}@_T05inout13modifyFooHeapys5Int64Vz_SftFADycfU_
// PROMO-CHECK: call void @llvm.dbg.declare(metadata %Ts5Int64V** %
// PROMO-CHECK-SAME: metadata ![[A1:[0-9]+]], metadata ![[EMPTY_EXPR:[0-9]+]])

// PROMO-CHECK-DAG: ![[EMPTY_EXPR]] = !DIExpression()
// PROMO-CHECK-DAG: ![[INT:.*]] = !DICompositeType({{.*}}identifier: "_TtVs5Int64"
// PROMO-CHECK-DAG: ![[INT:.*]] = !DICompositeType({{.*}}identifier: "_TtRVs5Int64"
// PROMO-CHECK-DAG: ![[INT:.*]] = !DICompositeType({{.*}}identifier: "_T0s5Int64VD"
// PROMO-CHECK-DAG: ![[INT:.*]] = !DICompositeType({{.*}}identifier: "_T0s5Int64VzD"
// PROMO-CHECK: ![[A1]] = !DILocalVariable(name: "a", arg: 1
// PROMO-CHECK-SAME: type: ![[INT]]
func modifyFooHeap(_ a: inout Int64,
// CHECK-DAG: ![[A]] = !DILocalVariable(name: "a", arg: 1{{.*}} line: [[@LINE-1]],{{.*}} type: ![[RINT:[0-9]+]]
// CHECK-DAG: ![[RINT]] = !DICompositeType({{.*}}identifier: "_TtRVs5Int64"
// CHECK-DAG: ![[RINT]] = !DICompositeType({{.*}}identifier: "_T0s5Int64VzD"
_ b: MyFloat)
{
let b = b
Expand All @@ -38,17 +38,17 @@ func modifyFooHeap(_ a: inout Int64,
}

// Inout reference type.
// FOO-CHECK: define {{.*}}@_TF5inout9modifyFooFTRVs5Int64Sf_T_
// FOO-CHECK: define {{.*}}@_T05inout9modifyFooys5Int64Vz_SftF
// FOO-CHECK: call void @llvm.dbg.declare(metadata %Ts5Int64V** %
// FOO-CHECK-SAME: metadata ![[U:[0-9]+]], metadata ![[EMPTY_EXPR:.*]])
// FOO-CHECK: ![[EMPTY_EXPR]] = !DIExpression()
func modifyFoo(_ u: inout Int64,
// FOO-CHECK-DAG: !DILocalVariable(name: "v", arg: 2{{.*}} line: [[@LINE+3]],{{.*}} type: ![[MYFLOAT:[0-9]+]]
// FOO-CHECK-DAG: [[U]] = !DILocalVariable(name: "u", arg: 1{{.*}} line: [[@LINE-2]],{{.*}} type: ![[RINT:[0-9]+]]
// FOO-CHECK-DAG: ![[RINT]] = !DICompositeType({{.*}}identifier: "_TtRVs5Int64"
// FOO-CHECK-DAG: ![[RINT]] = !DICompositeType({{.*}}identifier: "_T0s5Int64VzD"
_ v: MyFloat)
// FOO-CHECK-DAG: ![[MYFLOAT]] = !DIDerivedType(tag: DW_TAG_typedef, name: "_Tta5inout7MyFloat",{{.*}} baseType: ![[FLOAT:[0-9]+]]
// FOO-CHECK-DAG: ![[FLOAT]] = !DICompositeType({{.*}}identifier: "_TtSf"
// FOO-CHECK-DAG: ![[MYFLOAT]] = !DIDerivedType(tag: DW_TAG_typedef, name: "_T05inout7MyFloataD",{{.*}} baseType: ![[FLOAT:[0-9]+]]
// FOO-CHECK-DAG: ![[FLOAT]] = !DICompositeType({{.*}}identifier: "_T0SfD"
{
if (v > 2.71) {
u = u - 41
Expand Down
2 changes: 1 addition & 1 deletion test/DebugInfo/mangling-stdlib.swift
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
// RUN: %target-swift-frontend -parse-stdlib %s -emit-ir -g -o - | %FileCheck %s
// CHECK: !DIDerivedType(tag: DW_TAG_typedef, name: "_TtBb",
// CHECK: !DIDerivedType(tag: DW_TAG_typedef, name: "_T0BbD",
var bo : Builtin.BridgeObject
14 changes: 7 additions & 7 deletions test/DebugInfo/mangling.swift
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ func markUsed<T>(_ t: T) {}
// Variable:
// mangling.myDict : Swift.Dictionary<Swift.Int64, Swift.String>
// CHECK: !DIGlobalVariable(name: "myDict",
// CHECK-SAME: linkageName: "_Tv8mangling6myDictGVs10DictionaryVs5Int64SS_",
// CHECK-SAME: linkageName: "_T08mangling6myDicts10DictionaryVys5Int64VSSGv",
// CHECK-SAME: line: [[@LINE+3]]
// CHECK-SAME: type: ![[DT:[0-9]+]]
// CHECK: ![[DT]] = !DICompositeType(tag: DW_TAG_structure_type, name: "Dictionary"
Expand All @@ -17,24 +17,24 @@ myDict[12] = "Hello!"

// mangling.myTuple1 : (Name : Swift.String, Id : Swift.Int64)
// CHECK: !DIGlobalVariable(name: "myTuple1",
// CHECK-SAME: linkageName: "_Tv8mangling8myTuple1T4NameSS2IdVs5Int64_",
// CHECK-SAME: linkageName: "_T08mangling8myTuple1SS4Name_s5Int64V2Idtv",
// CHECK-SAME: line: [[@LINE+3]]
// CHECK-SAME: type: ![[TT1:[0-9]+]]
// CHECK: ![[TT1]] = !DICompositeType(tag: DW_TAG_structure_type, name: "_TtT4NameSS2IdVs5Int64_"
// CHECK: ![[TT1]] = !DICompositeType(tag: DW_TAG_structure_type, name: "_T0SS4Name_s5Int64V2IdtD"
var myTuple1 : (Name: String, Id: Int64) = ("A", 1)
// mangling.myTuple2 : (Swift.String, Id : Swift.Int64)
// CHECK: !DIGlobalVariable(name: "myTuple2",
// CHECK-SAME: linkageName: "_Tv8mangling8myTuple2TSS2IdVs5Int64_",
// CHECK-SAME: linkageName: "_T08mangling8myTuple2SS_s5Int64V2Idtv",
// CHECK-SAME: line: [[@LINE+3]]
// CHECK-SAME: type: ![[TT2:[0-9]+]]
// CHECK: ![[TT2]] = !DICompositeType(tag: DW_TAG_structure_type, name: "_TtTSS2IdVs5Int64_"
// CHECK: ![[TT2]] = !DICompositeType(tag: DW_TAG_structure_type, name: "_T0SS_s5Int64V2IdtD"
var myTuple2 : ( String, Id: Int64) = ("B", 2)
// mangling.myTuple3 : (Swift.String, Swift.Int64)
// CHECK: !DIGlobalVariable(name: "myTuple3",
// CHECK-SAME: linkageName: "_Tv8mangling8myTuple3TSSVs5Int64_",
// CHECK-SAME: linkageName: "_T08mangling8myTuple3SS_s5Int64Vtv",
// CHECK-SAME: line: [[@LINE+3]]
// CHECK-SAME: type: ![[TT3:[0-9]+]]
// CHECK: ![[TT3]] = !DICompositeType(tag: DW_TAG_structure_type, name: "_TtTSSVs5Int64_"
// CHECK: ![[TT3]] = !DICompositeType(tag: DW_TAG_structure_type, name: "_T0SS_s5Int64VtD"
var myTuple3 : ( String, Int64) = ("C", 3)

markUsed(myTuple1.Id)
Expand Down
12 changes: 6 additions & 6 deletions test/DebugInfo/test-foundation.swift
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import Foundation

class MyObject : NSObject {
// Ensure we don't emit linetable entries for ObjC thunks.
// LOC-CHECK: define {{.*}} @_TToFC4main8MyObjectg5MyArrCSo7NSArray
// LOC-CHECK: define {{.*}} @_T04main8MyObjectC0B3ArrSo7NSArrayCfgTo
// LOC-CHECK: ret {{.*}}, !dbg ![[DBG:.*]]
// LOC-CHECK: ret
var MyArr = NSArray()
Expand All @@ -33,7 +33,7 @@ extension MyObject {
}
}

// SANITY-DAG: ![[NSOBJECT:.*]] = !DICompositeType(tag: DW_TAG_structure_type, name: "NSObject",{{.*}} identifier: "_TtCSo8NSObject"
// SANITY-DAG: ![[NSOBJECT:.*]] = !DICompositeType(tag: DW_TAG_structure_type, name: "NSObject",{{.*}} identifier: "_T0So8NSObjectC"
// SANITY-DAG: !DIGlobalVariable(name: "NsObj",{{.*}} line: [[@LINE+1]],{{.*}} type: ![[NSOBJECT]],{{.*}} isDefinition: true
var NsObj: NSObject
NsObj = MyObject()
Expand All @@ -43,7 +43,7 @@ MyObj.blah()

public func err() {
// DWARF-CHECK: DW_AT_name{{.*}}NSError
// DWARF-CHECK: DW_AT_linkage_name{{.*}}_TtCSo7NSError
// DWARF-CHECK: DW_AT_linkage_name{{.*}}_T0So7NSErrorC
let _ = NSError(domain: "myDomain", code: 4,
userInfo: [AnyHashable("a"):1,
AnyHashable("b"):2,
Expand All @@ -52,11 +52,11 @@ public func err() {

// LOC-CHECK: define {{.*}}4date
public func date() {
// LOC-CHECK: call {{.*}} @_TFSSCfT21_builtinStringLiteralBp17utf8CodeUnitCountBw7isASCIIBi1__SS{{.*}}, !dbg ![[L1:.*]]
// LOC-CHECK: call {{.*}} @_T0S2SBp21_builtinStringLiteral_Bw17utf8CodeUnitCountBi1_7isASCIItcfC{{.*}}, !dbg ![[L1:.*]]
let d1 = DateFormatter()
// LOC-CHECK: br{{.*}}, !dbg ![[L2:.*]]
d1.dateFormat = "dd. mm. yyyy" // LOC-CHECK: call{{.*}}objc_msgSend{{.*}}, !dbg ![[L2]]
// LOC-CHECK: call {{.*}} @_TFSSCfT21_builtinStringLiteralBp17utf8CodeUnitCountBw7isASCIIBi1__SS{{.*}}, !dbg ![[L3:.*]]
// LOC-CHECK: call {{.*}} @_T0S2SBp21_builtinStringLiteral_Bw17utf8CodeUnitCountBi1_7isASCIItcfC{{.*}}, !dbg ![[L3:.*]]
let d2 = DateFormatter()
// LOC-CHECK: br{{.*}}, !dbg ![[L4:.*]]
d2.dateFormat = "mm dd yyyy" // LOC-CHECK: call{{.*}}objc_msgSend{{.*}}, !dbg ![[L4]]
Expand All @@ -68,7 +68,7 @@ func useOptions(_ opt: URL.BookmarkCreationOptions)
return [opt, opt]
}

// LOC-CHECK: ![[THUNK:.*]] = distinct !DISubprogram({{.*}}linkageName: "_TToFC4main8MyObjectg5MyArrCSo7NSArray"
// LOC-CHECK: ![[THUNK:.*]] = distinct !DISubprogram({{.*}}linkageName: "_T04main8MyObjectC0B3ArrSo7NSArrayCfgTo"
// LOC-CHECK-NOT: line:
// LOC-CHECK-SAME: isDefinition: true
// LOC-CHECK: ![[DBG]] = !DILocation(line: 0, scope: ![[THUNK]])
Expand Down
4 changes: 2 additions & 2 deletions test/DebugInfo/test_ints.swift
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@ var a : Int64 = 2
// CHECK-SAME: size: 64, align: 64
// CHECK-NOT: offset: 0
// CHECK-NOT: DIFlagFwdDecl
// CHECK-SAME: identifier: "_TtVs5Int64"
// CHECK-SAME: identifier: "_T0s5Int64VD"

// CHECK: !DIGlobalVariable(name: "b",{{.*}} line: [[@LINE+2]]
// CHECK-SAME: type: ![[INT:[0-9]+]]
var b = 2
// CHECK: ![[INT]] = !DICompositeType(tag: DW_TAG_structure_type, name: "Int"
// CHECK-SAME: identifier: "_TtSi"
// CHECK-SAME: identifier: "_T0SiD"

Loading