mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-10-05 22:02:55 +01:00
Model var as a pattern operator (#4720)
Co-authored-by: Richard Smith <richard@metafoo.co.uk>
This commit is contained in:
co-authored by
Richard Smith
parent
6572da7314
commit
13434f0e8a
@@ -49,6 +49,6 @@ fn Main() {
|
||||
// CHECK:STDOUT: !6 = !{}
|
||||
// CHECK:STDOUT: !7 = !DILocation(line: 12, column: 3, scope: !4)
|
||||
// CHECK:STDOUT: !8 = distinct !DISubprogram(name: "Main", linkageName: "_CMain.Main", scope: null, file: !3, line: 15, type: !5, spFlags: DISPFlagDefinition, unit: !2)
|
||||
// CHECK:STDOUT: !9 = !DILocation(line: 16, column: 7, scope: !8)
|
||||
// CHECK:STDOUT: !9 = !DILocation(line: 16, column: 3, scope: !8)
|
||||
// CHECK:STDOUT: !10 = !DILocation(line: 16, column: 15, scope: !8)
|
||||
// CHECK:STDOUT: !11 = !DILocation(line: 15, column: 1, scope: !8)
|
||||
|
||||
@@ -49,6 +49,6 @@ fn Main() {
|
||||
// CHECK:STDOUT: !6 = !{}
|
||||
// CHECK:STDOUT: !7 = !DILocation(line: 12, column: 3, scope: !4)
|
||||
// CHECK:STDOUT: !8 = distinct !DISubprogram(name: "Main", linkageName: "_CMain.Main", scope: null, file: !3, line: 15, type: !5, spFlags: DISPFlagDefinition, unit: !2)
|
||||
// CHECK:STDOUT: !9 = !DILocation(line: 16, column: 7, scope: !8)
|
||||
// CHECK:STDOUT: !9 = !DILocation(line: 16, column: 3, scope: !8)
|
||||
// CHECK:STDOUT: !10 = !DILocation(line: 16, column: 15, scope: !8)
|
||||
// CHECK:STDOUT: !11 = !DILocation(line: 15, column: 1, scope: !8)
|
||||
|
||||
+4
-5
@@ -29,8 +29,8 @@ fn Main() {
|
||||
// CHECK:STDOUT: %b.var = alloca i32, align 4, !dbg !9
|
||||
// CHECK:STDOUT: call void @llvm.lifetime.start.p0(i64 4, ptr %b.var), !dbg !9
|
||||
// CHECK:STDOUT: %Echo.call = call i32 @_CEcho.Main(i32 1), !dbg !10
|
||||
// CHECK:STDOUT: store i32 %Echo.call, ptr %b.var, align 4, !dbg !11
|
||||
// CHECK:STDOUT: ret void, !dbg !12
|
||||
// CHECK:STDOUT: store i32 %Echo.call, ptr %b.var, align 4, !dbg !9
|
||||
// CHECK:STDOUT: ret void, !dbg !11
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: ; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
|
||||
@@ -50,7 +50,6 @@ fn Main() {
|
||||
// CHECK:STDOUT: !6 = !{}
|
||||
// CHECK:STDOUT: !7 = !DILocation(line: 12, column: 3, scope: !4)
|
||||
// CHECK:STDOUT: !8 = distinct !DISubprogram(name: "Main", linkageName: "_CMain.Main", scope: null, file: !3, line: 15, type: !5, spFlags: DISPFlagDefinition, unit: !2)
|
||||
// CHECK:STDOUT: !9 = !DILocation(line: 16, column: 7, scope: !8)
|
||||
// CHECK:STDOUT: !9 = !DILocation(line: 16, column: 3, scope: !8)
|
||||
// CHECK:STDOUT: !10 = !DILocation(line: 16, column: 16, scope: !8)
|
||||
// CHECK:STDOUT: !11 = !DILocation(line: 16, column: 3, scope: !8)
|
||||
// CHECK:STDOUT: !12 = !DILocation(line: 15, column: 1, scope: !8)
|
||||
// CHECK:STDOUT: !11 = !DILocation(line: 15, column: 1, scope: !8)
|
||||
|
||||
@@ -59,7 +59,7 @@ fn Main() {
|
||||
// CHECK:STDOUT: !8 = distinct !DISubprogram(name: "Bar", linkageName: "_CBar.Main", scope: null, file: !3, line: 14, type: !5, spFlags: DISPFlagDefinition, unit: !2)
|
||||
// CHECK:STDOUT: !9 = !DILocation(line: 14, column: 23, scope: !8)
|
||||
// CHECK:STDOUT: !10 = distinct !DISubprogram(name: "Main", linkageName: "_CMain.Main", scope: null, file: !3, line: 16, type: !5, spFlags: DISPFlagDefinition, unit: !2)
|
||||
// CHECK:STDOUT: !11 = !DILocation(line: 17, column: 7, scope: !10)
|
||||
// CHECK:STDOUT: !11 = !DILocation(line: 17, column: 3, scope: !10)
|
||||
// CHECK:STDOUT: !12 = !DILocation(line: 17, column: 19, scope: !10)
|
||||
// CHECK:STDOUT: !13 = !DILocation(line: 17, column: 15, scope: !10)
|
||||
// CHECK:STDOUT: !14 = !DILocation(line: 16, column: 1, scope: !10)
|
||||
|
||||
@@ -49,6 +49,6 @@ fn Main() {
|
||||
// CHECK:STDOUT: !6 = !{}
|
||||
// CHECK:STDOUT: !7 = !DILocation(line: 12, column: 1, scope: !4)
|
||||
// CHECK:STDOUT: !8 = distinct !DISubprogram(name: "Main", linkageName: "_CMain.Main", scope: null, file: !3, line: 15, type: !5, spFlags: DISPFlagDefinition, unit: !2)
|
||||
// CHECK:STDOUT: !9 = !DILocation(line: 16, column: 7, scope: !8)
|
||||
// CHECK:STDOUT: !9 = !DILocation(line: 16, column: 3, scope: !8)
|
||||
// CHECK:STDOUT: !10 = !DILocation(line: 16, column: 15, scope: !8)
|
||||
// CHECK:STDOUT: !11 = !DILocation(line: 15, column: 1, scope: !8)
|
||||
|
||||
+8
-9
@@ -27,10 +27,10 @@ fn Main() {
|
||||
// CHECK:STDOUT: entry:
|
||||
// CHECK:STDOUT: %a.var = alloca i32, align 4, !dbg !9
|
||||
// CHECK:STDOUT: call void @llvm.lifetime.start.p0(i64 4, ptr %a.var), !dbg !9
|
||||
// CHECK:STDOUT: store i32 0, ptr %a.var, align 4, !dbg !10
|
||||
// CHECK:STDOUT: %.loc15 = load i32, ptr %a.var, align 4, !dbg !11
|
||||
// CHECK:STDOUT: call void @_CDoNothing.Main(i32 %.loc15), !dbg !12
|
||||
// CHECK:STDOUT: ret void, !dbg !13
|
||||
// CHECK:STDOUT: store i32 0, ptr %a.var, align 4, !dbg !9
|
||||
// CHECK:STDOUT: %.loc15 = load i32, ptr %a.var, align 4, !dbg !10
|
||||
// CHECK:STDOUT: call void @_CDoNothing.Main(i32 %.loc15), !dbg !11
|
||||
// CHECK:STDOUT: ret void, !dbg !12
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: ; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
|
||||
@@ -50,8 +50,7 @@ fn Main() {
|
||||
// CHECK:STDOUT: !6 = !{}
|
||||
// CHECK:STDOUT: !7 = !DILocation(line: 11, column: 1, scope: !4)
|
||||
// CHECK:STDOUT: !8 = distinct !DISubprogram(name: "Main", linkageName: "_CMain.Main", scope: null, file: !3, line: 13, type: !5, spFlags: DISPFlagDefinition, unit: !2)
|
||||
// CHECK:STDOUT: !9 = !DILocation(line: 14, column: 7, scope: !8)
|
||||
// CHECK:STDOUT: !10 = !DILocation(line: 14, column: 3, scope: !8)
|
||||
// CHECK:STDOUT: !11 = !DILocation(line: 15, column: 13, scope: !8)
|
||||
// CHECK:STDOUT: !12 = !DILocation(line: 15, column: 3, scope: !8)
|
||||
// CHECK:STDOUT: !13 = !DILocation(line: 13, column: 1, scope: !8)
|
||||
// CHECK:STDOUT: !9 = !DILocation(line: 14, column: 3, scope: !8)
|
||||
// CHECK:STDOUT: !10 = !DILocation(line: 15, column: 13, scope: !8)
|
||||
// CHECK:STDOUT: !11 = !DILocation(line: 15, column: 3, scope: !8)
|
||||
// CHECK:STDOUT: !12 = !DILocation(line: 13, column: 1, scope: !8)
|
||||
|
||||
Reference in New Issue
Block a user