mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-10-04 18:51:09 +01:00
Implement unused pattern bindings, continued (#6518)
Implementation of unused pattern bindings #2022, continued. Whereas previous PR #6460 took care of parsing, and PR #6479 prepared the stage by using _ in some test cases, this PR has the the actual implementation, using a simple dataflow analysis. --------- Co-authored-by: Burak Emir <bqe@google.com> Co-authored-by: jonmeow <jperkins@google.com>
This commit is contained in:
co-authored by
Burak Emir
jonmeow
parent
bea24a8bee
commit
fdb188ccfd
@@ -12,7 +12,7 @@
|
||||
|
||||
class C {
|
||||
impl as Core.Copy {
|
||||
fn Op[self: Self]() -> Self { return {}; }
|
||||
fn Op[unused self: Self]() -> Self { return {}; }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -60,12 +60,12 @@ fn M() {
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: %type = type {}
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: @C.val.loc15_44 = internal constant {} zeroinitializer
|
||||
// CHECK:STDOUT: @C.val.loc15_51 = internal constant {} zeroinitializer
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: ; Function Attrs: nounwind
|
||||
// CHECK:STDOUT: define void @"_COp.C.Main:Copy.Core"(ptr sret({}) %return, ptr %self) #0 !dbg !4 {
|
||||
// CHECK:STDOUT: entry:
|
||||
// CHECK:STDOUT: call void @llvm.memcpy.p0.p0.i64(ptr align 1 %return, ptr align 1 @C.val.loc15_44, i64 0, i1 false), !dbg !10
|
||||
// CHECK:STDOUT: call void @llvm.memcpy.p0.p0.i64(ptr align 1 %return, ptr align 1 @C.val.loc15_51, i64 0, i1 false), !dbg !10
|
||||
// CHECK:STDOUT: ret void, !dbg !10
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
@@ -245,7 +245,7 @@ fn M() {
|
||||
// CHECK:STDOUT: !7 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: null, size: 8)
|
||||
// CHECK:STDOUT: !8 = !{!9}
|
||||
// CHECK:STDOUT: !9 = !DILocalVariable(arg: 1, scope: !4, type: !7)
|
||||
// CHECK:STDOUT: !10 = !DILocation(line: 15, column: 35, scope: !4)
|
||||
// CHECK:STDOUT: !10 = !DILocation(line: 15, column: 42, scope: !4)
|
||||
// CHECK:STDOUT: !11 = distinct !DISubprogram(name: "M", linkageName: "_CM.Main", scope: null, file: !3, line: 48, type: !12, spFlags: DISPFlagDefinition, unit: !2)
|
||||
// CHECK:STDOUT: !12 = !DISubroutineType(types: !13)
|
||||
// CHECK:STDOUT: !13 = !{null}
|
||||
|
||||
Reference in New Issue
Block a user