Skip to content

Commit e3197e9

Browse files
Merge pull request #72200 from adrian-prantl/124233848
Root the virtual <compiler-generated> file in the root directory.
2 parents 38ca3cc + aab0cb0 commit e3197e9

File tree

3 files changed

+4
-2
lines changed

3 files changed

+4
-2
lines changed

lib/IRGen/IRGenDebugInfo.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -580,6 +580,8 @@ class IRGenDebugInfoImpl : public IRGenDebugInfo {
580580
// Leave <compiler-generated> & friends as is, without directory.
581581
if (!(File.startswith("<") && File.endswith(">")))
582582
Dir = CurDir;
583+
else
584+
Dir = llvm::sys::path::root_directory(CurDir);
583585
}
584586
llvm::DIFile *F =
585587
DBuilder.createFile(DebugPrefixMap.remapPath(File),

test/Backtracing/CrashWithThunk.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ struct CrashWithThunk {
3535
// CHECK: Thread 0 {{(".*" )?}}crashed:
3636

3737
// CHECK: 0 0x{{[0-9a-f]+}} crash() + {{[0-9]+}} in CrashWithThunk at {{.*}}/CrashWithThunk.swift:21:15
38-
// CHECK-NEXT: 1 [ra] [thunk] 0x{{[0-9a-f]+}} thunk for @escaping @callee_guaranteed () -> () + {{[0-9]+}} in CrashWithThunk at {{.*}}/Backtracing/<compiler-generated>
38+
// CHECK-NEXT: 1 [ra] [thunk] 0x{{[0-9a-f]+}} thunk for @escaping @callee_guaranteed () -> () + {{[0-9]+}} in CrashWithThunk at {{.*}}/<compiler-generated>
3939
// CHECK-NEXT: 2 [ra] 0x{{[0-9a-f]+}} static CrashWithThunk.main() + {{[0-9]+}} in CrashWithThunk at {{.*}}/CrashWithThunk.swift:29:9
4040
// CHECK-NEXT: 3 [ra] [system] 0x{{[0-9a-f]+}} static CrashWithThunk.$main() + {{[0-9]+}} in CrashWithThunk at {{.*}}/<compiler-generated>
4141
// CHECK-NEXT: 4 [ra] 0x{{[0-9a-f]+}} main + {{[0-9]+}} in CrashWithThunk at {{.*}}/CrashWithThunk.swift

test/DebugInfo/thunks.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ let i = foo.foo(-, x: y)
1616
// CHECK: define {{.*}}@"$ss5Int64VABIyByd_A2BIegyd_TR"
1717
// CHECK-NOT: ret
1818
// CHECK: call {{.*}}, !dbg ![[LOC:.*]]
19-
// CHECK: ![[FILE:[0-9]+]] = !DIFile(filename: "<compiler-generated>", directory: "")
19+
// CHECK: ![[FILE:[0-9]+]] = !DIFile(filename: "<compiler-generated>", directory: "/")
2020
// CHECK: ![[THUNK:.*]] = distinct !DISubprogram(linkageName: "$ss5Int64VABIyByd_A2BIegyd_TR"
2121
// CHECK-SAME: file: ![[FILE]]
2222
// CHECK-NOT: line:

0 commit comments

Comments
 (0)