Skip to content

Commit 248ba62

Browse files
committed
Don't emit debug line numbers for Swift type forward declarations
These line numbers are consumed by LLDB and stored in the Declaration object, but as far as I can tell no user-facing feature relies on this. Removing the line number can reduce the churn for incremental builds significantly, since whitespace changes in one file may trigger a recompilation of any file that uses a type declared below the whitespace change. <rdar://problem/63156560>
1 parent 4bc72ae commit 248ba62

File tree

8 files changed

+77
-55
lines changed

8 files changed

+77
-55
lines changed

lib/IRGen/IRGenDebugInfo.cpp

Lines changed: 66 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -564,7 +564,8 @@ class IRGenDebugInfoImpl : public IRGenDebugInfo {
564564
// Create a Forward-declared type.
565565
auto Loc = getDebugLoc(*this, NTD);
566566
auto File = getOrCreateFile(Loc.Filename);
567-
auto Line = Loc.Line;
567+
// No line numbers are attached to type forward declarations.
568+
auto Line = 0;
568569
auto FwdDecl = DBuilder.createReplaceableCompositeType(
569570
llvm::dwarf::DW_TAG_structure_type, NTD->getName().str(),
570571
getOrCreateContext(DC->getParent()), File, Line,
@@ -1301,14 +1302,19 @@ class IRGenDebugInfoImpl : public IRGenDebugInfo {
13011302
auto *Decl = StructTy->getDecl();
13021303
auto L = getDebugLoc(*this, Decl);
13031304
auto *File = getOrCreateFile(L.Filename);
1305+
unsigned FwdDeclLine = 0;
13041306
if (Opts.DebugInfoLevel > IRGenDebugInfoLevel::ASTTypes)
13051307
return createStructType(DbgTy, Decl, StructTy, Scope, File, L.Line,
1306-
SizeInBits, AlignInBits, Flags,
1307-
nullptr, // DerivedFrom
1308+
SizeInBits, AlignInBits, Flags, nullptr,
13081309
llvm::dwarf::DW_LANG_Swift, MangledName);
13091310
else
1310-
return createOpaqueStruct(Scope, Decl->getName().str(), File, L.Line,
1311-
SizeInBits, AlignInBits, Flags, MangledName);
1311+
// No line numbers are attached to type forward declarations. This is
1312+
// intentional: It interfers with the efficacy of incremental builds. We
1313+
// don't want a whitespace change to an secondary file trigger a
1314+
// recompilation of the debug info of a primary source file.
1315+
return createOpaqueStruct(Scope, Decl->getName().str(), File,
1316+
FwdDeclLine, SizeInBits, AlignInBits, Flags,
1317+
MangledName);
13121318
}
13131319

13141320
case TypeKind::Class: {
@@ -1318,68 +1324,76 @@ class IRGenDebugInfoImpl : public IRGenDebugInfo {
13181324
auto *ClassTy = BaseTy->castTo<ClassType>();
13191325
auto *Decl = ClassTy->getDecl();
13201326
auto L = getDebugLoc(*this, Decl);
1327+
auto *File = getOrCreateFile(L.Filename);
1328+
unsigned FwdDeclLine = 0;
13211329
assert(SizeInBits == CI.getTargetInfo().getPointerWidth(0));
1322-
return createPointerSizedStruct(Scope, Decl->getNameStr(),
1323-
getOrCreateFile(L.Filename), L.Line,
1324-
Flags, MangledName);
1330+
return createPointerSizedStruct(Scope, Decl->getNameStr(), File,
1331+
FwdDeclLine, Flags, MangledName);
13251332
}
13261333

13271334
case TypeKind::Protocol: {
13281335
auto *ProtocolTy = BaseTy->castTo<ProtocolType>();
13291336
auto *Decl = ProtocolTy->getDecl();
13301337
// FIXME: (LLVM branch) This should probably be a DW_TAG_interface_type.
13311338
auto L = getDebugLoc(*this, Decl);
1332-
auto File = getOrCreateFile(L.Filename);
1339+
auto *File = getOrCreateFile(L.Filename);
1340+
unsigned FwdDeclLine = 0;
13331341
return createOpaqueStruct(Scope, Decl ? Decl->getNameStr() : MangledName,
1334-
File, L.Line, SizeInBits, AlignInBits, Flags,
1335-
MangledName);
1342+
File, FwdDeclLine, SizeInBits, AlignInBits,
1343+
Flags, MangledName);
13361344
}
13371345

13381346
case TypeKind::ProtocolComposition: {
13391347
auto *Decl = DbgTy.getDecl();
13401348
auto L = getDebugLoc(*this, Decl);
1341-
auto File = getOrCreateFile(L.Filename);
1342-
1343-
// FIXME: emit types
1344-
// auto ProtocolCompositionTy = BaseTy->castTo<ProtocolCompositionType>();
1349+
auto *File = getOrCreateFile(L.Filename);
1350+
unsigned FwdDeclLine = 0;
13451351
return createOpaqueStruct(Scope, Decl ? Decl->getNameStr() : MangledName,
1346-
File, L.Line, SizeInBits, AlignInBits, Flags,
1347-
MangledName);
1352+
File, FwdDeclLine, SizeInBits, AlignInBits,
1353+
Flags, MangledName);
13481354
}
13491355

13501356
case TypeKind::UnboundGeneric: {
13511357
auto *UnboundTy = BaseTy->castTo<UnboundGenericType>();
13521358
auto *Decl = UnboundTy->getDecl();
13531359
auto L = getDebugLoc(*this, Decl);
1360+
auto *File = getOrCreateFile(L.Filename);
1361+
unsigned FwdDeclLine = 0;
13541362
assert(SizeInBits == CI.getTargetInfo().getPointerWidth(0));
13551363
return createPointerSizedStruct(Scope,
13561364
Decl ? Decl->getNameStr() : MangledName,
1357-
File, L.Line, Flags, MangledName);
1365+
File, FwdDeclLine, Flags, MangledName);
13581366
}
13591367

13601368
case TypeKind::BoundGenericStruct: {
13611369
auto *StructTy = BaseTy->castTo<BoundGenericStructType>();
13621370
auto *Decl = StructTy->getDecl();
13631371
auto L = getDebugLoc(*this, Decl);
1372+
auto *File = getOrCreateFile(L.Filename);
1373+
unsigned FwdDeclLine = 0;
13641374
return createOpaqueStructWithSizedContainer(
1365-
Scope, Decl ? Decl->getNameStr() : "", File, L.Line, SizeInBits,
1375+
Scope, Decl ? Decl->getNameStr() : "", File, FwdDeclLine, SizeInBits,
13661376
AlignInBits, Flags, MangledName, collectGenericParams(StructTy));
13671377
}
13681378

13691379
case TypeKind::BoundGenericClass: {
13701380
auto *ClassTy = BaseTy->castTo<BoundGenericClassType>();
13711381
auto *Decl = ClassTy->getDecl();
13721382
auto L = getDebugLoc(*this, Decl);
1383+
auto *File = getOrCreateFile(L.Filename);
1384+
unsigned FwdDeclLine = 0;
1385+
13731386
// TODO: We may want to peek at Decl->isObjC() and set this
13741387
// attribute accordingly.
13751388
assert(SizeInBits == CI.getTargetInfo().getPointerWidth(0));
13761389
return createPointerSizedStruct(Scope,
13771390
Decl ? Decl->getNameStr() : MangledName,
1378-
File, L.Line, Flags, MangledName);
1391+
File, FwdDeclLine, Flags, MangledName);
13791392
}
13801393

13811394
case TypeKind::Tuple: {
1382-
// Tuples are also represented as structs.
1395+
// Tuples are also represented as structs. Since tuples are ephemeral
1396+
// (not nominal) they don't have a source location.
13831397
if (Opts.DebugInfoLevel > IRGenDebugInfoLevel::ASTTypes)
13841398
return createTuple(DbgTy, Scope, SizeInBits, AlignInBits, Flags,
13851399
MangledName);
@@ -1400,14 +1414,16 @@ class IRGenDebugInfoImpl : public IRGenDebugInfo {
14001414
if (auto nested = dyn_cast<NestedArchetypeType>(Archetype))
14011415
assocType = nested->getAssocType();
14021416
auto L = getDebugLoc(*this, assocType);
1417+
auto *File = getOrCreateFile(L.Filename);
1418+
unsigned FwdDeclLine = 0;
14031419
auto Superclass = Archetype->getSuperclass();
14041420
auto DerivedFrom = Superclass.isNull()
14051421
? nullptr
14061422
: getOrCreateDesugaredType(Superclass, DbgTy);
14071423
auto FwdDecl = llvm::TempDIType(DBuilder.createReplaceableCompositeType(
1408-
llvm::dwarf::DW_TAG_structure_type, MangledName, Scope, File, L.Line,
1409-
llvm::dwarf::DW_LANG_Swift, SizeInBits, AlignInBits, Flags,
1410-
MangledName));
1424+
llvm::dwarf::DW_TAG_structure_type, MangledName, Scope, File,
1425+
FwdDeclLine, llvm::dwarf::DW_LANG_Swift, SizeInBits, AlignInBits,
1426+
Flags, MangledName));
14111427

14121428
// Emit the protocols the archetypes conform to.
14131429
SmallVector<llvm::Metadata *, 4> Protocols;
@@ -1421,7 +1437,7 @@ class IRGenDebugInfoImpl : public IRGenDebugInfo {
14211437
DBuilder.createInheritance(FwdDecl.get(), PDITy, 0, 0, Flags));
14221438
}
14231439
auto DITy = DBuilder.createStructType(
1424-
Scope, MangledName, File, L.Line, SizeInBits, AlignInBits, Flags,
1440+
Scope, MangledName, File, FwdDeclLine, SizeInBits, AlignInBits, Flags,
14251441
DerivedFrom, DBuilder.getOrCreateArray(Protocols),
14261442
llvm::dwarf::DW_LANG_Swift, nullptr, MangledName);
14271443

@@ -1435,9 +1451,11 @@ class IRGenDebugInfoImpl : public IRGenDebugInfo {
14351451
// storage.
14361452
Flags |= llvm::DINode::FlagArtificial;
14371453
auto L = getDebugLoc(*this, DbgTy.getDecl());
1438-
auto File = getOrCreateFile(L.Filename);
1454+
auto *File = getOrCreateFile(L.Filename);
1455+
unsigned FwdDeclLine = 0;
1456+
14391457
return DBuilder.createStructType(
1440-
Scope, MangledName, File, L.Line, SizeInBits, AlignInBits, Flags,
1458+
Scope, MangledName, File, FwdDeclLine, SizeInBits, AlignInBits, Flags,
14411459
nullptr, nullptr, llvm::dwarf::DW_LANG_Swift, nullptr, MangledName);
14421460
}
14431461

@@ -1457,34 +1475,40 @@ class IRGenDebugInfoImpl : public IRGenDebugInfo {
14571475
auto *Decl = EnumTy->getDecl();
14581476
auto L = getDebugLoc(*this, Decl);
14591477
auto *File = getOrCreateFile(L.Filename);
1478+
unsigned FwdDeclLine = 0;
1479+
14601480
if (Opts.DebugInfoLevel > IRGenDebugInfoLevel::ASTTypes)
14611481
return createEnumType(DbgTy, Decl, MangledName, Scope, File, L.Line,
14621482
Flags);
14631483
else
1464-
return createOpaqueStruct(Scope, Decl->getName().str(), File, L.Line,
1465-
SizeInBits, AlignInBits, Flags, MangledName);
1484+
return createOpaqueStruct(Scope, Decl->getName().str(), File,
1485+
FwdDeclLine, SizeInBits, AlignInBits, Flags,
1486+
MangledName);
14661487
}
14671488

14681489
case TypeKind::BoundGenericEnum: {
14691490
auto *EnumTy = BaseTy->castTo<BoundGenericEnumType>();
14701491
auto *Decl = EnumTy->getDecl();
14711492
auto L = getDebugLoc(*this, Decl);
14721493
auto *File = getOrCreateFile(L.Filename);
1494+
unsigned FwdDeclLine = 0;
1495+
14731496
return createOpaqueStructWithSizedContainer(
1474-
Scope, Decl->getName().str(), File, L.Line, SizeInBits, AlignInBits,
1475-
Flags, MangledName, collectGenericParams(EnumTy));
1497+
Scope, Decl->getName().str(), File, FwdDeclLine, SizeInBits,
1498+
AlignInBits, Flags, MangledName, collectGenericParams(EnumTy));
14761499
}
14771500

14781501
case TypeKind::BuiltinVector: {
1479-
(void)MangledName; // FIXME emit the name somewhere.
1502+
// FIXME: Emit the name somewhere.
1503+
(void)MangledName;
14801504
auto *BuiltinVectorTy = BaseTy->castTo<BuiltinVectorType>();
14811505
auto ElemTy = BuiltinVectorTy->getElementType();
14821506
auto ElemDbgTy = DebugTypeInfo::getFromTypeInfo(
14831507
ElemTy, IGM.getTypeInfoForUnlowered(ElemTy));
14841508
unsigned Count = BuiltinVectorTy->getNumElements();
14851509
auto Subscript = DBuilder.getOrCreateSubrange(0, Count ? Count : -1);
1486-
return DBuilder.createVectorType(SizeInBits,
1487-
AlignInBits, getOrCreateType(ElemDbgTy),
1510+
return DBuilder.createVectorType(SizeInBits, AlignInBits,
1511+
getOrCreateType(ElemDbgTy),
14881512
DBuilder.getOrCreateArray(Subscript));
14891513
}
14901514

@@ -1496,9 +1520,12 @@ class IRGenDebugInfoImpl : public IRGenDebugInfo {
14961520
auto *ReferenceTy = cast<ReferenceStorageType>(BaseTy);
14971521
auto CanTy = ReferenceTy->getReferentType();
14981522
auto L = getDebugLoc(*this, DbgTy.getDecl());
1499-
auto File = getOrCreateFile(L.Filename);
1523+
auto *File = getOrCreateFile(L.Filename);
1524+
unsigned CompilerGeneratedLine = 0;
1525+
15001526
return DBuilder.createTypedef(getOrCreateDesugaredType(CanTy, DbgTy),
1501-
MangledName, File, L.Line, File);
1527+
MangledName, File, CompilerGeneratedLine,
1528+
File);
15021529
}
15031530

15041531
// Sugared types.
@@ -1508,14 +1535,15 @@ class IRGenDebugInfoImpl : public IRGenDebugInfo {
15081535
auto *Decl = TypeAliasTy->getDecl();
15091536
auto L = getDebugLoc(*this, Decl);
15101537
auto AliasedTy = TypeAliasTy->getSinglyDesugaredType();
1511-
auto File = getOrCreateFile(L.Filename);
1538+
auto *File = getOrCreateFile(L.Filename);
1539+
15121540
// For TypeAlias types, the DeclContext for the aliased type is
15131541
// in the decl of the alias type.
15141542
DebugTypeInfo AliasedDbgTy(AliasedTy, DbgTy.getStorageType(),
15151543
DbgTy.getSize(), DbgTy.getAlignment(),
15161544
DbgTy.hasDefaultAlignment(), false);
15171545
return DBuilder.createTypedef(getOrCreateType(AliasedDbgTy), MangledName,
1518-
File, L.Line, Scope);
1546+
File, 0, Scope);
15191547
}
15201548

15211549
case TypeKind::Paren: {

test/ClangImporter/objc_ir.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -361,12 +361,12 @@ func testBlocksWithGenerics(hba: HasBlockArray) -> Any {
361361

362362
// CHECK: ![[SWIFT_NAME_ALIAS_VAR]] = !DILocalVariable(name: "obj", arg: 1, scope: !{{[0-9]+}}, file: !{{[0-9]+}}, line: {{[0-9]+}}, type: ![[SWIFT_NAME_ALIAS_TYPE:[0-9]+]])
363363
// CHECK: ![[LET_SWIFT_NAME_ALIAS_TYPE:[0-9]+]] = !DIDerivedType(tag: DW_TAG_const_type, baseType: ![[SWIFT_NAME_ALIAS_TYPE:[0-9]+]])
364-
// CHECK: ![[SWIFT_NAME_ALIAS_TYPE]] = !DIDerivedType(tag: DW_TAG_typedef, name: "$sSo14SwiftNameAliasaD", scope: !{{[0-9]+}}, file: !{{[0-9]+}}, line: {{[0-9]+}}, baseType: !{{[0-9]+}})
364+
// CHECK: ![[SWIFT_NAME_ALIAS_TYPE]] = !DIDerivedType(tag: DW_TAG_typedef, name: "$sSo14SwiftNameAliasaD", scope: !{{[0-9]+}}, file: !{{[0-9]+}}, baseType: !{{[0-9]+}})
365365

366366
// CHECK: ![[SWIFT_GENERIC_NAME_ALIAS_VAR]] = !DILocalVariable(name: "generic_obj", arg: 1, scope: !{{[0-9]+}}, file: !{{[0-9]+}}, line: {{[0-9]+}}, type: ![[LET_SWIFT_GENERIC_NAME_ALIAS_TYPE:[0-9]+]])
367367
// CHECK: ![[LET_SWIFT_GENERIC_NAME_ALIAS_TYPE:[0-9]+]] = !DIDerivedType(tag: DW_TAG_const_type, baseType: ![[SWIFT_GENERIC_NAME_ALIAS_TYPE:[0-9]+]])
368-
// CHECK: ![[SWIFT_GENERIC_NAME_ALIAS_TYPE]] = !DIDerivedType(tag: DW_TAG_typedef, name: "$sSo21SwiftGenericNameAliasaySo8NSNumberCGD", scope: !{{[0-9]+}}, file: !{{[0-9]+}}, line: {{[0-9]+}}, baseType: !{{[0-9]+}})
368+
// CHECK: ![[SWIFT_GENERIC_NAME_ALIAS_TYPE]] = !DIDerivedType(tag: DW_TAG_typedef, name: "$sSo21SwiftGenericNameAliasaySo8NSNumberCGD", scope: !{{[0-9]+}}, file: !{{[0-9]+}}, baseType: !{{[0-9]+}})
369369

370370
// CHECK: ![[SWIFT_CONSTR_GENERIC_NAME_ALIAS_VAR]] = !DILocalVariable(name: "constr_generic_obj", arg: 1, scope: !{{[0-9]+}}, file: !{{[0-9]+}}, line: {{[0-9]+}}, type: ![[LET_SWIFT_CONSTR_GENERIC_NAME_ALIAS_TYPE:[0-9]+]])
371371
// CHECK: ![[LET_SWIFT_CONSTR_GENERIC_NAME_ALIAS_TYPE:[0-9]+]] = !DIDerivedType(tag: DW_TAG_const_type, baseType: ![[SWIFT_CONSTR_GENERIC_NAME_ALIAS_TYPE:[0-9]+]])
372-
// CHECK: ![[SWIFT_CONSTR_GENERIC_NAME_ALIAS_TYPE]] = !DIDerivedType(tag: DW_TAG_typedef, name: "$sSo27SwiftConstrGenericNameAliasaySo8NSNumberCGD", scope: !{{[0-9]+}}, file: !{{[0-9]+}}, line: {{[0-9]+}}, baseType: !{{[0-9]+}})
372+
// CHECK: ![[SWIFT_CONSTR_GENERIC_NAME_ALIAS_TYPE]] = !DIDerivedType(tag: DW_TAG_typedef, name: "$sSo27SwiftConstrGenericNameAliasaySo8NSNumberCGD", scope: !{{[0-9]+}}, file: !{{[0-9]+}}, baseType: !{{[0-9]+}})

test/DebugInfo/BoundGenericEnum.swift

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -59,14 +59,13 @@ y.g()
5959
// CASE_0-DAG: !DISubprogram(name: "map", {{.*}}line: 11, type: ![[SBTY:[0-9]+]]
6060
// CASE_0-DAG: ![[SBTY]] = !DISubroutineType(types: ![[SBTYS:[0-9]+]])
6161
// CASE_0-DAG: ![[SBTYS]] = !{!{{[0-9]+}}, !{{[0-9]+}}, ![[SELFTY:[0-9]+]]}
62-
// CASE_0-DAG: ![[SELFTY]] = !DICompositeType(tag: DW_TAG_structure_type, {{.*}}line: 5, {{.*}}elements: ![[UNSIZED_ELTS:[0-9]+]]
62+
// CASE_0-DAG: ![[SELFTY]] = !DICompositeType(tag: DW_TAG_structure_type, {{.*}}elements: ![[UNSIZED_ELTS:[0-9]+]]
6363
// CASE_0-DAG: ![[UNSIZED_ELTS]] = !{![[UNSIZED_MEM:[0-9]+]]}
6464
// CASE_0-DAG: ![[UNSIZED_MEM]] = !DIDerivedType(tag: DW_TAG_member, {{.*}} baseType: ![[UNIQ:[0-9]+]]
6565

6666
// The unique unsized type.
6767
// CASE_0: ![[UNIQ]] = !DICompositeType(
6868
// CASE_0-SAME: tag: DW_TAG_structure_type, name: "Result",
69-
// CASE_0-SAME: line: 5,
7069
// CASE_0-NOT: size:
7170
// CASE_0-SAME: runtimeLang: DW_LANG_Swift,
7271
// CASE_0-SAME: identifier: "$s1a6ResultOyxGD")
@@ -75,10 +74,10 @@ y.g()
7574
// CASE_1-DAG: ![[F:[0-9]+]] = distinct !DISubprogram(name: "f",
7675
// CASE_1-DAG: !DILocalVariable(name: "self", arg: 1, scope: ![[F]],{{.*}} line: 31,{{.*}} type: ![[C_CLASS:[0-9]+]]
7776
// CASE_1-DAG: ![[C_CLASS]] = !DIDerivedType(tag: DW_TAG_const_type,{{.*}} baseType: ![[CLASS:[0-9]+]])
78-
// CASE_1-DAG: ![[CLASS]] = !DICompositeType(tag: DW_TAG_structure_type,{{.*}} line: 5, size: {{40|72}}
77+
// CASE_1-DAG: ![[CLASS]] = !DICompositeType(tag: DW_TAG_structure_type,{{.*}} size: {{40|72}}
7978

8079
// (2)
8180
// CASE_2-DAG: ![[G:[0-9]+]] = distinct !DISubprogram(name: "g",
8281
// CASE_2-DAG: !DILocalVariable(name: "self", arg: 1, scope: ![[G]],{{.*}} line: 38,{{.*}} type: ![[C_TUP:[0-9]+]]
8382
// CASE_2-DAG: ![[C_TUP]] = !DIDerivedType(tag: DW_TAG_const_type,{{.*}} baseType: ![[TUP:[0-9]+]])
84-
// CASE_2-DAG: ![[TUP]] = !DICompositeType(tag: DW_TAG_structure_type,{{.*}} line: 5, size: {{264|512}},
83+
// CASE_2-DAG: ![[TUP]] = !DICompositeType(tag: DW_TAG_structure_type,{{.*}} size: {{264|512}},

test/DebugInfo/apple-types-accel.swift

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@
2020

2121
// Verify the IR interface:
2222
// CHECK: !DICompositeType(tag: DW_TAG_structure_type, name: "foo"
23-
// CHECK-SAME: line: [[@LINE+2]]
2423
// CHECK-SAME: identifier: "$s4main3fooCD"
2524
class foo {
2625
var x : Int64 = 1

test/DebugInfo/attributes.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,12 @@
22

33
// REQUIRES: objc_interop
44

5-
// CHECK-DAG: ![[TY0:.*]] = !DICompositeType(tag: DW_TAG_structure_type, name: "ObjCClass",{{.*}} line: [[@LINE+1]],{{.*}} runtimeLang: DW_LANG_Swift,
5+
// CHECK-DAG: ![[TY0:.*]] = !DICompositeType(tag: DW_TAG_structure_type, name: "ObjCClass",{{.*}} runtimeLang: DW_LANG_Swift,
66
@objc class ObjCClass {
77
@IBAction func click(_: AnyObject?) -> () {}
88
}
99

10-
// CHECK-DAG: ![[TY1:[0-9]+]] = !DICompositeType(tag: DW_TAG_structure_type, name: "SwiftClass",{{.*}} line: [[@LINE+1]],{{.*}} runtimeLang: DW_LANG_Swift
10+
// CHECK-DAG: ![[TY1:[0-9]+]] = !DICompositeType(tag: DW_TAG_structure_type, name: "SwiftClass",{{.*}} runtimeLang: DW_LANG_Swift
1111
class SwiftClass {
1212
@objc func objcmethod() -> () {}
1313
func swiftmethod() -> () {}

test/DebugInfo/enum.swift

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,13 @@ protocol P {}
88
enum Either {
99
case First(Int64), Second(P), Neither
1010
// CHECK: !DICompositeType({{.*}}name: "Either",
11-
// CHECK-SAME: line: [[@LINE-3]],
1211
// CHECK-SAME: size: {{328|168}},
1312
}
1413
// CHECK: ![[EMPTY:.*]] = !{}
1514
// DWARF: ![[INT:.*]] = !DICompositeType({{.*}}identifier: "$sSiD"
1615
let E : Either = .Neither;
1716

1817
// CHECK: !DICompositeType({{.*}}name: "Color",
19-
// CHECK-SAME: line: [[@LINE+3]]
2018
// CHECK-SAME: size: 8,
2119
// CHECK-SAME: identifier: "$s4enum5ColorOD"
2220
enum Color : UInt64 {
@@ -29,7 +27,6 @@ enum Color : UInt64 {
2927
}
3028

3129
// CHECK: !DICompositeType({{.*}}name: "MaybeIntPair",
32-
// CHECK-SAME: line: [[@LINE+3]],
3330
// CHECK-SAME: size: 136{{[,)]}}
3431
// CHECK-SAME: identifier: "$s4enum12MaybeIntPairOD"
3532
enum MaybeIntPair {
@@ -51,7 +48,6 @@ enum Maybe<T> {
5148
let r = Color.Red
5249
let c = MaybeIntPair.just(74, 75)
5350
// CHECK: !DICompositeType({{.*}}name: "Maybe",
54-
// CHECK-SAME: line: [[@LINE-8]],
5551
// CHECK-SAME: identifier: "$s4enum5MaybeOyAA5ColorOGD"
5652
let movie : Maybe<Color> = .none
5753

test/DebugInfo/parent-scope.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ public struct Generic<T : P> {
1919
// But only one concrete type is expected.
2020
// CHECK: !DISubprogram({{.*}}linkageName: "$s4main8ConcreteV3getSiSgyF",
2121
// CHECK-SAME: scope: ![[CONC:[0-9]+]],
22-
// CHECK: ![[CONC]] = !DICompositeType(tag: DW_TAG_structure_type, name: "Concrete", scope: !{{[0-9]+}}, file: !{{[0-9]+}}, line: {{[0-9]+}}, elements: !{{[0-9]+}}, runtimeLang: DW_LANG_Swift, identifier: "$s4main8ConcreteVD")
22+
// CHECK: ![[CONC]] = !DICompositeType(tag: DW_TAG_structure_type, name: "Concrete", scope: !{{[0-9]+}}, file: !{{[0-9]+}}, elements: !{{[0-9]+}}, runtimeLang: DW_LANG_Swift, identifier: "$s4main8ConcreteVD")
2323
public struct Concrete {
2424
public func get() -> Int? {
2525
return nil

0 commit comments

Comments
 (0)