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 @@ fn G() {
var _: array((i32, i32, i32), 2) = (F(), F());
}
// CHECK:STDOUT: ; ---
// CHECK:STDOUT: ; ModuleID = 'array_in_place.carbon'
// CHECK:STDOUT: source_filename = "array_in_place.carbon"
// CHECK:STDOUT:
@@ -91,3 +92,4 @@ fn G() {
// CHECK:STDOUT: !27 = !{!28}
// CHECK:STDOUT: !28 = !DILocalVariable(arg: 1, scope: !26, type: !22)
// CHECK:STDOUT: !29 = !DILocation(line: 16, column: 3, scope: !26)
// CHECK:STDOUT:
@@ -16,6 +16,7 @@ fn Run() {
var _: array(i32, 2) = F();
}
// CHECK:STDOUT: ; ---
// CHECK:STDOUT: ; ModuleID = 'assign_return_value.carbon'
// CHECK:STDOUT: source_filename = "assign_return_value.carbon"
// CHECK:STDOUT:
@@ -117,3 +118,4 @@ fn Run() {
// CHECK:STDOUT: !30 = !{!31}
// CHECK:STDOUT: !31 = !DILocalVariable(arg: 1, scope: !29, type: !7)
// CHECK:STDOUT: !32 = !DILocation(line: 16, column: 3, scope: !29)
// CHECK:STDOUT:
+2
View File
@@ -18,6 +18,7 @@ fn Run() {
var _: array(i32, 3) = d;
}
// CHECK:STDOUT: ; ---
// CHECK:STDOUT: ; ModuleID = 'base.carbon'
// CHECK:STDOUT: source_filename = "base.carbon"
// CHECK:STDOUT:
@@ -184,3 +185,4 @@ fn Run() {
// CHECK:STDOUT: !49 = !{!50}
// CHECK:STDOUT: !50 = !DILocalVariable(arg: 1, scope: !48, type: !28)
// CHECK:STDOUT: !51 = !DILocation(line: 14, column: 3, scope: !48)
// CHECK:STDOUT:
+2
View File
@@ -25,6 +25,7 @@ class A {
}
}
// CHECK:STDOUT: ; ---
// CHECK:STDOUT: ; ModuleID = 'field.carbon'
// CHECK:STDOUT: source_filename = "field.carbon"
// CHECK:STDOUT:
@@ -95,3 +96,4 @@ class A {
// CHECK:STDOUT: !22 = !DILocation(line: 23, column: 5, scope: !19)
// CHECK:STDOUT: !23 = !DILocation(line: 24, column: 12, scope: !19)
// CHECK:STDOUT: !24 = !DILocation(line: 24, column: 5, scope: !19)
// CHECK:STDOUT:
+2
View File
@@ -18,6 +18,7 @@ fn G() -> i32 {
return F((1, 2, 3), 1);
}
// CHECK:STDOUT: ; ---
// CHECK:STDOUT: ; ModuleID = 'function_param.carbon'
// CHECK:STDOUT: source_filename = "function_param.carbon"
// CHECK:STDOUT:
@@ -98,3 +99,4 @@ fn G() -> i32 {
// CHECK:STDOUT: !29 = !{!30}
// CHECK:STDOUT: !30 = !DILocalVariable(arg: 1, scope: !26, type: !8)
// CHECK:STDOUT: !31 = !DILocation(line: 18, column: 12, scope: !26)
// CHECK:STDOUT:
+2
View File
@@ -19,6 +19,7 @@ fn Get() -> ref array(i32, 4) {
return a;
}
// CHECK:STDOUT: ; ---
// CHECK:STDOUT: ; ModuleID = 'global_array_reference.carbon'
// CHECK:STDOUT: source_filename = "global_array_reference.carbon"
// CHECK:STDOUT:
@@ -62,3 +63,4 @@ fn Get() -> ref array(i32, 4) {
// CHECK:STDOUT: !11 = !{null}
// CHECK:STDOUT: !12 = !DILocation(line: 3, column: 1, scope: !9)
// CHECK:STDOUT: !13 = !DILocation(line: 0, scope: !9)
// CHECK:STDOUT:
+2
View File
@@ -19,6 +19,7 @@ fn F() {
}
}
// CHECK:STDOUT: ; ---
// CHECK:STDOUT: ; ModuleID = 'iterate.carbon'
// CHECK:STDOUT: source_filename = "iterate.carbon"
// CHECK:STDOUT:
@@ -363,3 +364,4 @@ fn F() {
// CHECK:STDOUT: !134 = !{!135}
// CHECK:STDOUT: !135 = !DILocalVariable(arg: 1, scope: !133, type: !15)
// CHECK:STDOUT: !136 = !DILocation(line: 59, column: 28, scope: !133)
// CHECK:STDOUT:
+4
View File
@@ -30,6 +30,7 @@ library "[[@TEST_NAME]]";
var c: array(Core.Int(257), 5) = (1, 2, 3, 4, 5);
// CHECK:STDOUT: ; ---
// CHECK:STDOUT: ; ModuleID = 'element_tail_padding.carbon'
// CHECK:STDOUT: source_filename = "element_tail_padding.carbon"
// CHECK:STDOUT:
@@ -113,6 +114,8 @@ var c: array(Core.Int(257), 5) = (1, 2, 3, 4, 5);
// CHECK:STDOUT: !30 = !{!31}
// CHECK:STDOUT: !31 = !DILocalVariable(arg: 1, scope: !29, type: !25)
// CHECK:STDOUT: !32 = !DILocation(line: 9, column: 3, scope: !29)
// CHECK:STDOUT:
// CHECK:STDOUT: ; ---
// CHECK:STDOUT: ; ModuleID = 'constant_with_padding.carbon'
// CHECK:STDOUT: source_filename = "constant_with_padding.carbon"
// CHECK:STDOUT:
@@ -145,3 +148,4 @@ var c: array(Core.Int(257), 5) = (1, 2, 3, 4, 5);
// CHECK:STDOUT: !6 = !{null}
// CHECK:STDOUT: !7 = !DILocation(line: 3, column: 1, scope: !4)
// CHECK:STDOUT: !8 = !DILocation(line: 0, scope: !4)
// CHECK:STDOUT: