Enable SubobjectDestroy.Op to destroy fields defined in a ClassType (#7840)

Base classes will be destroyed in a dedicated change, so we can
trivially confirm that the base is being destroyed.

This is a partial implementation of #7362.

---------

Co-authored-by: Richard Smith <richard@metafoo.co.uk>
This commit is contained in:
Christopher Di Bella
2026-10-01 21:37:17 +00:00
committed by GitHub
co-authored by Richard Smith
parent 5406588107
commit b2d339b581
55 changed files with 723 additions and 31 deletions
@@ -132,6 +132,8 @@ fn DoThing() {
// CHECK:STDOUT: ; Function Attrs: nounwind
// CHECK:STDOUT: define weak_odr void @"_CSubobjectDestroy.b25525d21a9bd472:core.Destroy.Core"(ptr %self) #2 !dbg !76 {
// CHECK:STDOUT: entry:
// CHECK:STDOUT: %.loc22.base = getelementptr inbounds nuw { [16 x i8] }, ptr %self, i32 0, i32 0, !dbg !78
// CHECK:STDOUT: call void @"_CSelfDestruct.352b8f386f44a614:core.Destroy.Core"(ptr %.loc22.base), !dbg !78
// CHECK:STDOUT: ret void, !dbg !78
// CHECK:STDOUT: }
// CHECK:STDOUT: