Add separators between files in LLVM IR dumps (#7463)

Each file dump now starts with a `; ---` comment and ends with a blank
line. This makes it easier to visually scan the dump for a file of
interest. The comment format is somewhat arbitrary; I chose `---` to
align with the `--- filename.carbon` separator in SemIR dumps, but
without the filename, because that appears on each of the next two lines
already.
This commit is contained in:
Geoff Romer
2026-07-07 16:31:24 +00:00
committed by GitHub
parent e1cf833c45
commit ae3c4266d4
240 changed files with 778 additions and 0 deletions
+2
View File
@@ -16,6 +16,7 @@ interface I {
fn F() { I.Assoc; }
// CHECK:STDOUT: ; ---
// CHECK:STDOUT: ; ModuleID = 'assoc.carbon'
// CHECK:STDOUT: source_filename = "assoc.carbon"
// CHECK:STDOUT:
@@ -38,3 +39,4 @@ fn F() { I.Assoc; }
// CHECK:STDOUT: !5 = !DISubroutineType(types: !6)
// CHECK:STDOUT: !6 = !{null}
// CHECK:STDOUT: !7 = !DILocation(line: 17, column: 1, scope: !4)
// CHECK:STDOUT:
+2
View File
@@ -22,6 +22,7 @@ fn G() -> I;
fn H() -> I { return G(); }
// CHECK:STDOUT: ; ---
// CHECK:STDOUT: ; ModuleID = 'basic.carbon'
// CHECK:STDOUT: source_filename = "basic.carbon"
// CHECK:STDOUT:
@@ -61,3 +62,4 @@ fn H() -> I { return G(); }
// CHECK:STDOUT: !13 = !{!7}
// CHECK:STDOUT: !14 = !DILocation(line: 23, column: 22, scope: !11)
// CHECK:STDOUT: !15 = !DILocation(line: 23, column: 15, scope: !11)
// CHECK:STDOUT:
@@ -26,6 +26,7 @@ impl D as N {
fn F() {}
}
// CHECK:STDOUT: ; ---
// CHECK:STDOUT: ; ModuleID = 'mangle_declared_class.carbon'
// CHECK:STDOUT: source_filename = "mangle_declared_class.carbon"
// CHECK:STDOUT:
@@ -56,3 +57,4 @@ impl D as N {
// CHECK:STDOUT: !7 = !DILocation(line: 18, column: 3, scope: !4)
// CHECK:STDOUT: !8 = distinct !DISubprogram(name: "F", linkageName: "_CF.D.Main:I.Main", scope: null, file: !1, line: 26, type: !5, spFlags: DISPFlagDefinition, unit: !0)
// CHECK:STDOUT: !9 = !DILocation(line: 26, column: 3, scope: !8)
// CHECK:STDOUT:
+4
View File
@@ -55,6 +55,7 @@ fn G() {
let unused t: type = type where D impls J(.Self);
}
// CHECK:STDOUT: ; ---
// CHECK:STDOUT: ; ModuleID = 'basic.carbon'
// CHECK:STDOUT: source_filename = "basic.carbon"
// CHECK:STDOUT:
@@ -77,6 +78,8 @@ fn G() {
// CHECK:STDOUT: !5 = !DISubroutineType(types: !6)
// CHECK:STDOUT: !6 = !{null}
// CHECK:STDOUT: !7 = !DILocation(line: 12, column: 3, scope: !4)
// CHECK:STDOUT:
// CHECK:STDOUT: ; ---
// CHECK:STDOUT: ; ModuleID = 'no_period_self_dependence.carbon'
// CHECK:STDOUT: source_filename = "no_period_self_dependence.carbon"
// CHECK:STDOUT:
@@ -124,3 +127,4 @@ fn G() {
// CHECK:STDOUT: !17 = !{!18}
// CHECK:STDOUT: !18 = !DILocalVariable(arg: 1, scope: !16, type: !7)
// CHECK:STDOUT: !19 = !DILocation(line: 16, column: 3, scope: !16)
// CHECK:STDOUT: