mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-09-24 22:02:23 +01:00
This change partially implements [PR #7362], which revises how objects are destroyed. It is a partial implementation for two reasons: 1. This change moves `Destroy.Op`'s current behaviour into `Destroy.SubobjectDestroy`, but it doesn't add support for objects with non-trivial destruction. 2. `Destroy.SubobjectDestroy` is a workaround for `require impls SubobjectDestroy`. We aren't able to use the latter until the dependents add their requirements' implementations to their own witness tables. [PR #7362]: https://github.com/carbon-language/carbon-lang/pulls/7362
677 lines
41 KiB
Plaintext
677 lines
41 KiB
Plaintext
// Part of the Carbon Language project, under the Apache License v2.0 with LLVM
|
|
// Exceptions. See /LICENSE for license information.
|
|
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
|
//
|
|
// INCLUDE-FILE: toolchain/testing/testdata/min_prelude/int.carbon
|
|
//
|
|
// AUTOUPDATE
|
|
// TIP: To test this file alone, run:
|
|
// TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/lower/testdata/struct/layout.carbon
|
|
// TIP: To dump output, run:
|
|
// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/lower/testdata/struct/layout.carbon
|
|
|
|
// --- no_padding.carbon
|
|
library "[[@TEST_NAME]]";
|
|
|
|
fn G(p: i32*);
|
|
|
|
fn F() {
|
|
// LLVM {i32, i32, i32} matches the Carbon layout, so we use it.
|
|
var no_padding: {.x: i32, .y: i32, .z: i32};
|
|
G(&no_padding.x);
|
|
G(&no_padding.y);
|
|
G(&no_padding.z);
|
|
}
|
|
|
|
// --- avoid_tail_padding.carbon
|
|
library "[[@TEST_NAME]]";
|
|
|
|
fn G(p: i32*);
|
|
|
|
fn F() {
|
|
// LLVM {ptr, i32} would have a size of 16, so we use a packed struct.
|
|
var avoid_tail_padding: {.x: ()*, .y: i32};
|
|
G(&avoid_tail_padding.y);
|
|
}
|
|
|
|
// --- use_tail_padding.carbon
|
|
library "[[@TEST_NAME]]";
|
|
|
|
fn G(p: i32*);
|
|
|
|
fn F() {
|
|
// LLVM {ptr, i32} would have a size of 16, so we use a packed struct as the
|
|
// type of `.a`. `.b` goes in the tail padding.
|
|
var use_tail_padding: {.a: {.x: ()*, .y: i32}, .b: i32};
|
|
G(&use_tail_padding.a.y);
|
|
G(&use_tail_padding.b);
|
|
}
|
|
|
|
// --- implicit_padding.carbon
|
|
library "[[@TEST_NAME]]";
|
|
|
|
fn G(p: ()**);
|
|
|
|
fn F() {
|
|
// LLVM {<{ptr, i32}>, ptr} inserts the right padding before `.b`, so we use
|
|
// it directly.
|
|
var implicit_padding: {.a: {.x: ()*, .y: i32}, .b: ()*};
|
|
G(&implicit_padding.a.x);
|
|
G(&implicit_padding.b);
|
|
}
|
|
|
|
// --- insert_padding.carbon
|
|
library "[[@TEST_NAME]]";
|
|
|
|
fn G(p: ()**);
|
|
|
|
fn F() {
|
|
// LLVM {<{i32, i32, i32}>, ptr, i32} would have extra tail padding, so we use
|
|
// a packed struct. That requires that we explicitly add padding between `.a`
|
|
// and `.b`.
|
|
var insert_padding: {.a: {.x: i32, .y: i32, .z: i32}, .b: ()*, .c: i32};
|
|
G(&insert_padding.b);
|
|
}
|
|
|
|
// CHECK:STDOUT: ; ---
|
|
// CHECK:STDOUT: ; ModuleID = 'no_padding.carbon'
|
|
// CHECK:STDOUT: source_filename = "no_padding.carbon"
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: declare void @_CG.Main(ptr)
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: ; Function Attrs: nounwind
|
|
// CHECK:STDOUT: define void @_CF.Main() #0 !dbg !28 {
|
|
// CHECK:STDOUT: entry:
|
|
// CHECK:STDOUT: %no_padding.var = alloca { i32, i32, i32 }, align 4, !dbg !29
|
|
// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %no_padding.var), !dbg !29
|
|
// CHECK:STDOUT: %.loc8.x = getelementptr inbounds nuw { i32, i32, i32 }, ptr %no_padding.var, i32 0, i32 0, !dbg !31
|
|
// CHECK:STDOUT: call void @_CG.Main(ptr %.loc8.x), !dbg !33
|
|
// CHECK:STDOUT: %.loc9.y = getelementptr inbounds nuw { i32, i32, i32 }, ptr %no_padding.var, i32 0, i32 1, !dbg !34
|
|
// CHECK:STDOUT: call void @_CG.Main(ptr %.loc9.y), !dbg !36
|
|
// CHECK:STDOUT: %.loc10.z = getelementptr inbounds nuw { i32, i32, i32 }, ptr %no_padding.var, i32 0, i32 2, !dbg !37
|
|
// CHECK:STDOUT: call void @_CG.Main(ptr %.loc10.z), !dbg !39
|
|
// CHECK:STDOUT: call void @"_CSelfDestruct.cc12b768126bed5c:core.Destroy.Core"(ptr %no_padding.var), !dbg !29
|
|
// CHECK:STDOUT: ret void, !dbg !40
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: ; Function Attrs: nounwind
|
|
// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.6dae29ece9a708c4:core.Destroy.Core"(ptr %self) #0 !dbg !41 {
|
|
// CHECK:STDOUT: entry:
|
|
// CHECK:STDOUT: ret void, !dbg !43
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: ; Function Attrs: nounwind
|
|
// CHECK:STDOUT: define weak_odr void @"_CSubobjectDestroy.f58524831c37807e:core.Destroy.Core"(ptr %self) #0 !dbg !45 {
|
|
// CHECK:STDOUT: entry:
|
|
// CHECK:STDOUT: ret void, !dbg !47
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: ; Function Attrs: nounwind
|
|
// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.f58524831c37807e:core.Destroy.Core"(ptr %self) #0 !dbg !49 {
|
|
// CHECK:STDOUT: entry:
|
|
// CHECK:STDOUT: call void @"_CSubobjectDestroy.f58524831c37807e:core.Destroy.Core"(ptr %self), !dbg !51
|
|
// CHECK:STDOUT: ret void, !dbg !51
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: ; Function Attrs: nounwind
|
|
// CHECK:STDOUT: define weak_odr void @"_CSubobjectDestroy.cc12b768126bed5c:core.Destroy.Core"(ptr %self) #0 !dbg !53 {
|
|
// CHECK:STDOUT: entry:
|
|
// CHECK:STDOUT: ret void, !dbg !55
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: ; Function Attrs: nounwind
|
|
// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.cc12b768126bed5c:core.Destroy.Core"(ptr %self) #0 !dbg !57 {
|
|
// CHECK:STDOUT: entry:
|
|
// CHECK:STDOUT: call void @"_CSubobjectDestroy.cc12b768126bed5c:core.Destroy.Core"(ptr %self), !dbg !59
|
|
// CHECK:STDOUT: ret void, !dbg !59
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: ; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
|
|
// CHECK:STDOUT: declare void @llvm.lifetime.start.p0(ptr captures(none)) #1
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: attributes #0 = { nounwind }
|
|
// CHECK:STDOUT: attributes #1 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: !llvm.dbg.cu = !{!19}
|
|
// CHECK:STDOUT: !llvm.module.flags = !{!2, !3}
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: !2 = !{i32 7, !"Dwarf Version", i32 5}
|
|
// CHECK:STDOUT: !3 = !{i32 2, !"Debug Info Version", i32 3}
|
|
// CHECK:STDOUT: !18 = !DIFile(filename: "no_padding.carbon", directory: "")
|
|
// CHECK:STDOUT: !19 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !18, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug)
|
|
// CHECK:STDOUT: !20 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed)
|
|
// CHECK:STDOUT: !21 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: null, size: 64)
|
|
// CHECK:STDOUT: !22 = !{null, !21}
|
|
// CHECK:STDOUT: !23 = !DISubroutineType(types: !22)
|
|
// CHECK:STDOUT: !24 = !{null}
|
|
// CHECK:STDOUT: !25 = !DISubroutineType(types: !24)
|
|
// CHECK:STDOUT: !26 = !{null, !20}
|
|
// CHECK:STDOUT: !27 = !DISubroutineType(types: !26)
|
|
// CHECK:STDOUT: !28 = distinct !DISubprogram(name: "F", linkageName: "_CF.Main", scope: null, file: !18, line: 5, type: !25, spFlags: DISPFlagDefinition, unit: !19)
|
|
// CHECK:STDOUT: !29 = !DILocation(line: 7, column: 3, scope: !28)
|
|
// CHECK:STDOUT: !31 = !DILocation(line: 8, column: 6, scope: !28)
|
|
// CHECK:STDOUT: !33 = !DILocation(line: 8, column: 3, scope: !28)
|
|
// CHECK:STDOUT: !34 = !DILocation(line: 9, column: 6, scope: !28)
|
|
// CHECK:STDOUT: !36 = !DILocation(line: 9, column: 3, scope: !28)
|
|
// CHECK:STDOUT: !37 = !DILocation(line: 10, column: 6, scope: !28)
|
|
// CHECK:STDOUT: !39 = !DILocation(line: 10, column: 3, scope: !28)
|
|
// CHECK:STDOUT: !40 = !DILocation(line: 5, column: 1, scope: !28)
|
|
// CHECK:STDOUT: !41 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.6dae29ece9a708c4:core.Destroy.Core", scope: null, file: !18, line: 7, type: !27, spFlags: DISPFlagDefinition, unit: !19, retainedNodes: !44)
|
|
// CHECK:STDOUT: !42 = !DILocalVariable(arg: 1, scope: !41, type: !20)
|
|
// CHECK:STDOUT: !43 = !DILocation(line: 7, column: 3, scope: !41)
|
|
// CHECK:STDOUT: !44 = !{!42}
|
|
// CHECK:STDOUT: !45 = distinct !DISubprogram(name: "SubobjectDestroy", linkageName: "_CSubobjectDestroy.f58524831c37807e:core.Destroy.Core", scope: null, file: !18, line: 7, type: !27, spFlags: DISPFlagDefinition, unit: !19, retainedNodes: !48)
|
|
// CHECK:STDOUT: !46 = !DILocalVariable(arg: 1, scope: !45, type: !20)
|
|
// CHECK:STDOUT: !47 = !DILocation(line: 7, column: 3, scope: !45)
|
|
// CHECK:STDOUT: !48 = !{!46}
|
|
// CHECK:STDOUT: !49 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.f58524831c37807e:core.Destroy.Core", scope: null, file: !18, line: 7, type: !27, spFlags: DISPFlagDefinition, unit: !19, retainedNodes: !52)
|
|
// CHECK:STDOUT: !50 = !DILocalVariable(arg: 1, scope: !49, type: !20)
|
|
// CHECK:STDOUT: !51 = !DILocation(line: 7, column: 3, scope: !49)
|
|
// CHECK:STDOUT: !52 = !{!50}
|
|
// CHECK:STDOUT: !53 = distinct !DISubprogram(name: "SubobjectDestroy", linkageName: "_CSubobjectDestroy.cc12b768126bed5c:core.Destroy.Core", scope: null, file: !18, line: 7, type: !23, spFlags: DISPFlagDefinition, unit: !19, retainedNodes: !56)
|
|
// CHECK:STDOUT: !54 = !DILocalVariable(arg: 1, scope: !53, type: !21)
|
|
// CHECK:STDOUT: !55 = !DILocation(line: 7, column: 3, scope: !53)
|
|
// CHECK:STDOUT: !56 = !{!54}
|
|
// CHECK:STDOUT: !57 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.cc12b768126bed5c:core.Destroy.Core", scope: null, file: !18, line: 7, type: !23, spFlags: DISPFlagDefinition, unit: !19, retainedNodes: !60)
|
|
// CHECK:STDOUT: !58 = !DILocalVariable(arg: 1, scope: !57, type: !21)
|
|
// CHECK:STDOUT: !59 = !DILocation(line: 7, column: 3, scope: !57)
|
|
// CHECK:STDOUT: !60 = !{!58}
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: ; ---
|
|
// CHECK:STDOUT: ; ModuleID = 'avoid_tail_padding.carbon'
|
|
// CHECK:STDOUT: source_filename = "avoid_tail_padding.carbon"
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: declare void @_CG.Main(ptr)
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: ; Function Attrs: nounwind
|
|
// CHECK:STDOUT: define void @_CF.Main() #0 !dbg !63 {
|
|
// CHECK:STDOUT: entry:
|
|
// CHECK:STDOUT: %avoid_tail_padding.var = alloca <{ ptr, i32 }>, align 8, !dbg !64
|
|
// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %avoid_tail_padding.var), !dbg !64
|
|
// CHECK:STDOUT: %.loc8.y = getelementptr inbounds nuw <{ ptr, i32 }>, ptr %avoid_tail_padding.var, i32 0, i32 1, !dbg !66
|
|
// CHECK:STDOUT: call void @_CG.Main(ptr %.loc8.y), !dbg !68
|
|
// CHECK:STDOUT: call void @"_CSelfDestruct.90798694d9a177e6:core.Destroy.Core"(ptr %avoid_tail_padding.var), !dbg !64
|
|
// CHECK:STDOUT: ret void, !dbg !69
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: ; Function Attrs: nounwind
|
|
// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.8436f795915f0543:core.Destroy.Core"(ptr %self) #0 !dbg !70 {
|
|
// CHECK:STDOUT: entry:
|
|
// CHECK:STDOUT: ret void, !dbg !72
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: ; Function Attrs: nounwind
|
|
// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.6dae29ece9a708c4:core.Destroy.Core"(ptr %self) #0 !dbg !74 {
|
|
// CHECK:STDOUT: entry:
|
|
// CHECK:STDOUT: ret void, !dbg !76
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: ; Function Attrs: nounwind
|
|
// CHECK:STDOUT: define weak_odr void @"_CSubobjectDestroy.f58524831c37807e:core.Destroy.Core"(ptr %self) #0 !dbg !78 {
|
|
// CHECK:STDOUT: entry:
|
|
// CHECK:STDOUT: ret void, !dbg !80
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: ; Function Attrs: nounwind
|
|
// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.f58524831c37807e:core.Destroy.Core"(ptr %self) #0 !dbg !82 {
|
|
// CHECK:STDOUT: entry:
|
|
// CHECK:STDOUT: call void @"_CSubobjectDestroy.f58524831c37807e:core.Destroy.Core"(ptr %self), !dbg !84
|
|
// CHECK:STDOUT: ret void, !dbg !84
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: ; Function Attrs: nounwind
|
|
// CHECK:STDOUT: define weak_odr void @"_CSubobjectDestroy.90798694d9a177e6:core.Destroy.Core"(ptr %self) #0 !dbg !86 {
|
|
// CHECK:STDOUT: entry:
|
|
// CHECK:STDOUT: ret void, !dbg !88
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: ; Function Attrs: nounwind
|
|
// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.90798694d9a177e6:core.Destroy.Core"(ptr %self) #0 !dbg !90 {
|
|
// CHECK:STDOUT: entry:
|
|
// CHECK:STDOUT: call void @"_CSubobjectDestroy.90798694d9a177e6:core.Destroy.Core"(ptr %self), !dbg !92
|
|
// CHECK:STDOUT: ret void, !dbg !92
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: ; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
|
|
// CHECK:STDOUT: declare void @llvm.lifetime.start.p0(ptr captures(none)) #1
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: attributes #0 = { nounwind }
|
|
// CHECK:STDOUT: attributes #1 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: !llvm.dbg.cu = !{!62}
|
|
// CHECK:STDOUT: !llvm.module.flags = !{!2, !3}
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: !2 = !{i32 7, !"Dwarf Version", i32 5}
|
|
// CHECK:STDOUT: !3 = !{i32 2, !"Debug Info Version", i32 3}
|
|
// CHECK:STDOUT: !20 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed)
|
|
// CHECK:STDOUT: !21 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: null, size: 64)
|
|
// CHECK:STDOUT: !22 = !{null, !21}
|
|
// CHECK:STDOUT: !23 = !DISubroutineType(types: !22)
|
|
// CHECK:STDOUT: !24 = !{null}
|
|
// CHECK:STDOUT: !25 = !DISubroutineType(types: !24)
|
|
// CHECK:STDOUT: !26 = !{null, !20}
|
|
// CHECK:STDOUT: !27 = !DISubroutineType(types: !26)
|
|
// CHECK:STDOUT: !61 = !DIFile(filename: "avoid_tail_padding.carbon", directory: "")
|
|
// CHECK:STDOUT: !62 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !61, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug)
|
|
// CHECK:STDOUT: !63 = distinct !DISubprogram(name: "F", linkageName: "_CF.Main", scope: null, file: !61, line: 5, type: !25, spFlags: DISPFlagDefinition, unit: !62)
|
|
// CHECK:STDOUT: !64 = !DILocation(line: 7, column: 3, scope: !63)
|
|
// CHECK:STDOUT: !66 = !DILocation(line: 8, column: 6, scope: !63)
|
|
// CHECK:STDOUT: !68 = !DILocation(line: 8, column: 3, scope: !63)
|
|
// CHECK:STDOUT: !69 = !DILocation(line: 5, column: 1, scope: !63)
|
|
// CHECK:STDOUT: !70 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.8436f795915f0543:core.Destroy.Core", scope: null, file: !61, line: 7, type: !23, spFlags: DISPFlagDefinition, unit: !62, retainedNodes: !73)
|
|
// CHECK:STDOUT: !71 = !DILocalVariable(arg: 1, scope: !70, type: !21)
|
|
// CHECK:STDOUT: !72 = !DILocation(line: 7, column: 3, scope: !70)
|
|
// CHECK:STDOUT: !73 = !{!71}
|
|
// CHECK:STDOUT: !74 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.6dae29ece9a708c4:core.Destroy.Core", scope: null, file: !61, line: 7, type: !27, spFlags: DISPFlagDefinition, unit: !62, retainedNodes: !77)
|
|
// CHECK:STDOUT: !75 = !DILocalVariable(arg: 1, scope: !74, type: !20)
|
|
// CHECK:STDOUT: !76 = !DILocation(line: 7, column: 3, scope: !74)
|
|
// CHECK:STDOUT: !77 = !{!75}
|
|
// CHECK:STDOUT: !78 = distinct !DISubprogram(name: "SubobjectDestroy", linkageName: "_CSubobjectDestroy.f58524831c37807e:core.Destroy.Core", scope: null, file: !61, line: 7, type: !27, spFlags: DISPFlagDefinition, unit: !62, retainedNodes: !81)
|
|
// CHECK:STDOUT: !79 = !DILocalVariable(arg: 1, scope: !78, type: !20)
|
|
// CHECK:STDOUT: !80 = !DILocation(line: 7, column: 3, scope: !78)
|
|
// CHECK:STDOUT: !81 = !{!79}
|
|
// CHECK:STDOUT: !82 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.f58524831c37807e:core.Destroy.Core", scope: null, file: !61, line: 7, type: !27, spFlags: DISPFlagDefinition, unit: !62, retainedNodes: !85)
|
|
// CHECK:STDOUT: !83 = !DILocalVariable(arg: 1, scope: !82, type: !20)
|
|
// CHECK:STDOUT: !84 = !DILocation(line: 7, column: 3, scope: !82)
|
|
// CHECK:STDOUT: !85 = !{!83}
|
|
// CHECK:STDOUT: !86 = distinct !DISubprogram(name: "SubobjectDestroy", linkageName: "_CSubobjectDestroy.90798694d9a177e6:core.Destroy.Core", scope: null, file: !61, line: 7, type: !23, spFlags: DISPFlagDefinition, unit: !62, retainedNodes: !89)
|
|
// CHECK:STDOUT: !87 = !DILocalVariable(arg: 1, scope: !86, type: !21)
|
|
// CHECK:STDOUT: !88 = !DILocation(line: 7, column: 3, scope: !86)
|
|
// CHECK:STDOUT: !89 = !{!87}
|
|
// CHECK:STDOUT: !90 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.90798694d9a177e6:core.Destroy.Core", scope: null, file: !61, line: 7, type: !23, spFlags: DISPFlagDefinition, unit: !62, retainedNodes: !93)
|
|
// CHECK:STDOUT: !91 = !DILocalVariable(arg: 1, scope: !90, type: !21)
|
|
// CHECK:STDOUT: !92 = !DILocation(line: 7, column: 3, scope: !90)
|
|
// CHECK:STDOUT: !93 = !{!91}
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: ; ---
|
|
// CHECK:STDOUT: ; ModuleID = 'use_tail_padding.carbon'
|
|
// CHECK:STDOUT: source_filename = "use_tail_padding.carbon"
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: declare void @_CG.Main(ptr)
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: ; Function Attrs: nounwind
|
|
// CHECK:STDOUT: define void @_CF.Main() #0 !dbg !96 {
|
|
// CHECK:STDOUT: entry:
|
|
// CHECK:STDOUT: %use_tail_padding.var = alloca { <{ ptr, i32 }>, i32 }, align 8, !dbg !97
|
|
// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %use_tail_padding.var), !dbg !97
|
|
// CHECK:STDOUT: %.loc9_22.a = getelementptr inbounds nuw { <{ ptr, i32 }>, i32 }, ptr %use_tail_padding.var, i32 0, i32 0, !dbg !99
|
|
// CHECK:STDOUT: %.loc9_24.y = getelementptr inbounds nuw <{ ptr, i32 }>, ptr %.loc9_22.a, i32 0, i32 1, !dbg !99
|
|
// CHECK:STDOUT: call void @_CG.Main(ptr %.loc9_24.y), !dbg !101
|
|
// CHECK:STDOUT: %.loc10.b = getelementptr inbounds nuw { <{ ptr, i32 }>, i32 }, ptr %use_tail_padding.var, i32 0, i32 1, !dbg !102
|
|
// CHECK:STDOUT: call void @_CG.Main(ptr %.loc10.b), !dbg !104
|
|
// CHECK:STDOUT: call void @"_CSelfDestruct.3862e4ac11efcf1c:core.Destroy.Core"(ptr %use_tail_padding.var), !dbg !97
|
|
// CHECK:STDOUT: ret void, !dbg !105
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: ; Function Attrs: nounwind
|
|
// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.8436f795915f0543:core.Destroy.Core"(ptr %self) #0 !dbg !106 {
|
|
// CHECK:STDOUT: entry:
|
|
// CHECK:STDOUT: ret void, !dbg !108
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: ; Function Attrs: nounwind
|
|
// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.6dae29ece9a708c4:core.Destroy.Core"(ptr %self) #0 !dbg !110 {
|
|
// CHECK:STDOUT: entry:
|
|
// CHECK:STDOUT: ret void, !dbg !112
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: ; Function Attrs: nounwind
|
|
// CHECK:STDOUT: define weak_odr void @"_CSubobjectDestroy.f58524831c37807e:core.Destroy.Core"(ptr %self) #0 !dbg !114 {
|
|
// CHECK:STDOUT: entry:
|
|
// CHECK:STDOUT: ret void, !dbg !116
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: ; Function Attrs: nounwind
|
|
// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.f58524831c37807e:core.Destroy.Core"(ptr %self) #0 !dbg !118 {
|
|
// CHECK:STDOUT: entry:
|
|
// CHECK:STDOUT: call void @"_CSubobjectDestroy.f58524831c37807e:core.Destroy.Core"(ptr %self), !dbg !120
|
|
// CHECK:STDOUT: ret void, !dbg !120
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: ; Function Attrs: nounwind
|
|
// CHECK:STDOUT: define weak_odr void @"_CSubobjectDestroy.90798694d9a177e6:core.Destroy.Core"(ptr %self) #0 !dbg !122 {
|
|
// CHECK:STDOUT: entry:
|
|
// CHECK:STDOUT: ret void, !dbg !124
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: ; Function Attrs: nounwind
|
|
// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.90798694d9a177e6:core.Destroy.Core"(ptr %self) #0 !dbg !126 {
|
|
// CHECK:STDOUT: entry:
|
|
// CHECK:STDOUT: call void @"_CSubobjectDestroy.90798694d9a177e6:core.Destroy.Core"(ptr %self), !dbg !128
|
|
// CHECK:STDOUT: ret void, !dbg !128
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: ; Function Attrs: nounwind
|
|
// CHECK:STDOUT: define weak_odr void @"_CSubobjectDestroy.3862e4ac11efcf1c:core.Destroy.Core"(ptr %self) #0 !dbg !130 {
|
|
// CHECK:STDOUT: entry:
|
|
// CHECK:STDOUT: ret void, !dbg !132
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: ; Function Attrs: nounwind
|
|
// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.3862e4ac11efcf1c:core.Destroy.Core"(ptr %self) #0 !dbg !134 {
|
|
// CHECK:STDOUT: entry:
|
|
// CHECK:STDOUT: call void @"_CSubobjectDestroy.3862e4ac11efcf1c:core.Destroy.Core"(ptr %self), !dbg !136
|
|
// CHECK:STDOUT: ret void, !dbg !136
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: ; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
|
|
// CHECK:STDOUT: declare void @llvm.lifetime.start.p0(ptr captures(none)) #1
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: attributes #0 = { nounwind }
|
|
// CHECK:STDOUT: attributes #1 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: !llvm.dbg.cu = !{!95}
|
|
// CHECK:STDOUT: !llvm.module.flags = !{!2, !3}
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: !2 = !{i32 7, !"Dwarf Version", i32 5}
|
|
// CHECK:STDOUT: !3 = !{i32 2, !"Debug Info Version", i32 3}
|
|
// CHECK:STDOUT: !20 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed)
|
|
// CHECK:STDOUT: !21 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: null, size: 64)
|
|
// CHECK:STDOUT: !22 = !{null, !21}
|
|
// CHECK:STDOUT: !23 = !DISubroutineType(types: !22)
|
|
// CHECK:STDOUT: !24 = !{null}
|
|
// CHECK:STDOUT: !25 = !DISubroutineType(types: !24)
|
|
// CHECK:STDOUT: !26 = !{null, !20}
|
|
// CHECK:STDOUT: !27 = !DISubroutineType(types: !26)
|
|
// CHECK:STDOUT: !94 = !DIFile(filename: "use_tail_padding.carbon", directory: "")
|
|
// CHECK:STDOUT: !95 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !94, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug)
|
|
// CHECK:STDOUT: !96 = distinct !DISubprogram(name: "F", linkageName: "_CF.Main", scope: null, file: !94, line: 5, type: !25, spFlags: DISPFlagDefinition, unit: !95)
|
|
// CHECK:STDOUT: !97 = !DILocation(line: 8, column: 3, scope: !96)
|
|
// CHECK:STDOUT: !99 = !DILocation(line: 9, column: 6, scope: !96)
|
|
// CHECK:STDOUT: !101 = !DILocation(line: 9, column: 3, scope: !96)
|
|
// CHECK:STDOUT: !102 = !DILocation(line: 10, column: 6, scope: !96)
|
|
// CHECK:STDOUT: !104 = !DILocation(line: 10, column: 3, scope: !96)
|
|
// CHECK:STDOUT: !105 = !DILocation(line: 5, column: 1, scope: !96)
|
|
// CHECK:STDOUT: !106 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.8436f795915f0543:core.Destroy.Core", scope: null, file: !94, line: 8, type: !23, spFlags: DISPFlagDefinition, unit: !95, retainedNodes: !109)
|
|
// CHECK:STDOUT: !107 = !DILocalVariable(arg: 1, scope: !106, type: !21)
|
|
// CHECK:STDOUT: !108 = !DILocation(line: 8, column: 3, scope: !106)
|
|
// CHECK:STDOUT: !109 = !{!107}
|
|
// CHECK:STDOUT: !110 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.6dae29ece9a708c4:core.Destroy.Core", scope: null, file: !94, line: 8, type: !27, spFlags: DISPFlagDefinition, unit: !95, retainedNodes: !113)
|
|
// CHECK:STDOUT: !111 = !DILocalVariable(arg: 1, scope: !110, type: !20)
|
|
// CHECK:STDOUT: !112 = !DILocation(line: 8, column: 3, scope: !110)
|
|
// CHECK:STDOUT: !113 = !{!111}
|
|
// CHECK:STDOUT: !114 = distinct !DISubprogram(name: "SubobjectDestroy", linkageName: "_CSubobjectDestroy.f58524831c37807e:core.Destroy.Core", scope: null, file: !94, line: 8, type: !27, spFlags: DISPFlagDefinition, unit: !95, retainedNodes: !117)
|
|
// CHECK:STDOUT: !115 = !DILocalVariable(arg: 1, scope: !114, type: !20)
|
|
// CHECK:STDOUT: !116 = !DILocation(line: 8, column: 3, scope: !114)
|
|
// CHECK:STDOUT: !117 = !{!115}
|
|
// CHECK:STDOUT: !118 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.f58524831c37807e:core.Destroy.Core", scope: null, file: !94, line: 8, type: !27, spFlags: DISPFlagDefinition, unit: !95, retainedNodes: !121)
|
|
// CHECK:STDOUT: !119 = !DILocalVariable(arg: 1, scope: !118, type: !20)
|
|
// CHECK:STDOUT: !120 = !DILocation(line: 8, column: 3, scope: !118)
|
|
// CHECK:STDOUT: !121 = !{!119}
|
|
// CHECK:STDOUT: !122 = distinct !DISubprogram(name: "SubobjectDestroy", linkageName: "_CSubobjectDestroy.90798694d9a177e6:core.Destroy.Core", scope: null, file: !94, line: 8, type: !23, spFlags: DISPFlagDefinition, unit: !95, retainedNodes: !125)
|
|
// CHECK:STDOUT: !123 = !DILocalVariable(arg: 1, scope: !122, type: !21)
|
|
// CHECK:STDOUT: !124 = !DILocation(line: 8, column: 3, scope: !122)
|
|
// CHECK:STDOUT: !125 = !{!123}
|
|
// CHECK:STDOUT: !126 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.90798694d9a177e6:core.Destroy.Core", scope: null, file: !94, line: 8, type: !23, spFlags: DISPFlagDefinition, unit: !95, retainedNodes: !129)
|
|
// CHECK:STDOUT: !127 = !DILocalVariable(arg: 1, scope: !126, type: !21)
|
|
// CHECK:STDOUT: !128 = !DILocation(line: 8, column: 3, scope: !126)
|
|
// CHECK:STDOUT: !129 = !{!127}
|
|
// CHECK:STDOUT: !130 = distinct !DISubprogram(name: "SubobjectDestroy", linkageName: "_CSubobjectDestroy.3862e4ac11efcf1c:core.Destroy.Core", scope: null, file: !94, line: 8, type: !23, spFlags: DISPFlagDefinition, unit: !95, retainedNodes: !133)
|
|
// CHECK:STDOUT: !131 = !DILocalVariable(arg: 1, scope: !130, type: !21)
|
|
// CHECK:STDOUT: !132 = !DILocation(line: 8, column: 3, scope: !130)
|
|
// CHECK:STDOUT: !133 = !{!131}
|
|
// CHECK:STDOUT: !134 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.3862e4ac11efcf1c:core.Destroy.Core", scope: null, file: !94, line: 8, type: !23, spFlags: DISPFlagDefinition, unit: !95, retainedNodes: !137)
|
|
// CHECK:STDOUT: !135 = !DILocalVariable(arg: 1, scope: !134, type: !21)
|
|
// CHECK:STDOUT: !136 = !DILocation(line: 8, column: 3, scope: !134)
|
|
// CHECK:STDOUT: !137 = !{!135}
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: ; ---
|
|
// CHECK:STDOUT: ; ModuleID = 'implicit_padding.carbon'
|
|
// CHECK:STDOUT: source_filename = "implicit_padding.carbon"
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: declare void @_CG.Main(ptr)
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: ; Function Attrs: nounwind
|
|
// CHECK:STDOUT: define void @_CF.Main() #0 !dbg !140 {
|
|
// CHECK:STDOUT: entry:
|
|
// CHECK:STDOUT: %implicit_padding.var = alloca { <{ ptr, i32 }>, ptr }, align 8, !dbg !141
|
|
// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %implicit_padding.var), !dbg !141
|
|
// CHECK:STDOUT: %.loc9_22.a = getelementptr inbounds nuw { <{ ptr, i32 }>, ptr }, ptr %implicit_padding.var, i32 0, i32 0, !dbg !143
|
|
// CHECK:STDOUT: %.loc9_24.x = getelementptr inbounds nuw <{ ptr, i32 }>, ptr %.loc9_22.a, i32 0, i32 0, !dbg !143
|
|
// CHECK:STDOUT: call void @_CG.Main(ptr %.loc9_24.x), !dbg !145
|
|
// CHECK:STDOUT: %.loc10.b = getelementptr inbounds nuw { <{ ptr, i32 }>, ptr }, ptr %implicit_padding.var, i32 0, i32 1, !dbg !146
|
|
// CHECK:STDOUT: call void @_CG.Main(ptr %.loc10.b), !dbg !148
|
|
// CHECK:STDOUT: call void @"_CSelfDestruct.fb4d9eb13d71ce13:core.Destroy.Core"(ptr %implicit_padding.var), !dbg !141
|
|
// CHECK:STDOUT: ret void, !dbg !149
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: ; Function Attrs: nounwind
|
|
// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.8436f795915f0543:core.Destroy.Core"(ptr %self) #0 !dbg !150 {
|
|
// CHECK:STDOUT: entry:
|
|
// CHECK:STDOUT: ret void, !dbg !152
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: ; Function Attrs: nounwind
|
|
// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.6dae29ece9a708c4:core.Destroy.Core"(ptr %self) #0 !dbg !154 {
|
|
// CHECK:STDOUT: entry:
|
|
// CHECK:STDOUT: ret void, !dbg !156
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: ; Function Attrs: nounwind
|
|
// CHECK:STDOUT: define weak_odr void @"_CSubobjectDestroy.f58524831c37807e:core.Destroy.Core"(ptr %self) #0 !dbg !158 {
|
|
// CHECK:STDOUT: entry:
|
|
// CHECK:STDOUT: ret void, !dbg !160
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: ; Function Attrs: nounwind
|
|
// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.f58524831c37807e:core.Destroy.Core"(ptr %self) #0 !dbg !162 {
|
|
// CHECK:STDOUT: entry:
|
|
// CHECK:STDOUT: call void @"_CSubobjectDestroy.f58524831c37807e:core.Destroy.Core"(ptr %self), !dbg !164
|
|
// CHECK:STDOUT: ret void, !dbg !164
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: ; Function Attrs: nounwind
|
|
// CHECK:STDOUT: define weak_odr void @"_CSubobjectDestroy.90798694d9a177e6:core.Destroy.Core"(ptr %self) #0 !dbg !166 {
|
|
// CHECK:STDOUT: entry:
|
|
// CHECK:STDOUT: ret void, !dbg !168
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: ; Function Attrs: nounwind
|
|
// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.90798694d9a177e6:core.Destroy.Core"(ptr %self) #0 !dbg !170 {
|
|
// CHECK:STDOUT: entry:
|
|
// CHECK:STDOUT: call void @"_CSubobjectDestroy.90798694d9a177e6:core.Destroy.Core"(ptr %self), !dbg !172
|
|
// CHECK:STDOUT: ret void, !dbg !172
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: ; Function Attrs: nounwind
|
|
// CHECK:STDOUT: define weak_odr void @"_CSubobjectDestroy.fb4d9eb13d71ce13:core.Destroy.Core"(ptr %self) #0 !dbg !174 {
|
|
// CHECK:STDOUT: entry:
|
|
// CHECK:STDOUT: ret void, !dbg !176
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: ; Function Attrs: nounwind
|
|
// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.fb4d9eb13d71ce13:core.Destroy.Core"(ptr %self) #0 !dbg !178 {
|
|
// CHECK:STDOUT: entry:
|
|
// CHECK:STDOUT: call void @"_CSubobjectDestroy.fb4d9eb13d71ce13:core.Destroy.Core"(ptr %self), !dbg !180
|
|
// CHECK:STDOUT: ret void, !dbg !180
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: ; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
|
|
// CHECK:STDOUT: declare void @llvm.lifetime.start.p0(ptr captures(none)) #1
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: attributes #0 = { nounwind }
|
|
// CHECK:STDOUT: attributes #1 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: !llvm.dbg.cu = !{!139}
|
|
// CHECK:STDOUT: !llvm.module.flags = !{!2, !3}
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: !2 = !{i32 7, !"Dwarf Version", i32 5}
|
|
// CHECK:STDOUT: !3 = !{i32 2, !"Debug Info Version", i32 3}
|
|
// CHECK:STDOUT: !20 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed)
|
|
// CHECK:STDOUT: !21 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: null, size: 64)
|
|
// CHECK:STDOUT: !22 = !{null, !21}
|
|
// CHECK:STDOUT: !23 = !DISubroutineType(types: !22)
|
|
// CHECK:STDOUT: !24 = !{null}
|
|
// CHECK:STDOUT: !25 = !DISubroutineType(types: !24)
|
|
// CHECK:STDOUT: !26 = !{null, !20}
|
|
// CHECK:STDOUT: !27 = !DISubroutineType(types: !26)
|
|
// CHECK:STDOUT: !138 = !DIFile(filename: "implicit_padding.carbon", directory: "")
|
|
// CHECK:STDOUT: !139 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !138, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug)
|
|
// CHECK:STDOUT: !140 = distinct !DISubprogram(name: "F", linkageName: "_CF.Main", scope: null, file: !138, line: 5, type: !25, spFlags: DISPFlagDefinition, unit: !139)
|
|
// CHECK:STDOUT: !141 = !DILocation(line: 8, column: 3, scope: !140)
|
|
// CHECK:STDOUT: !143 = !DILocation(line: 9, column: 6, scope: !140)
|
|
// CHECK:STDOUT: !145 = !DILocation(line: 9, column: 3, scope: !140)
|
|
// CHECK:STDOUT: !146 = !DILocation(line: 10, column: 6, scope: !140)
|
|
// CHECK:STDOUT: !148 = !DILocation(line: 10, column: 3, scope: !140)
|
|
// CHECK:STDOUT: !149 = !DILocation(line: 5, column: 1, scope: !140)
|
|
// CHECK:STDOUT: !150 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.8436f795915f0543:core.Destroy.Core", scope: null, file: !138, line: 8, type: !23, spFlags: DISPFlagDefinition, unit: !139, retainedNodes: !153)
|
|
// CHECK:STDOUT: !151 = !DILocalVariable(arg: 1, scope: !150, type: !21)
|
|
// CHECK:STDOUT: !152 = !DILocation(line: 8, column: 3, scope: !150)
|
|
// CHECK:STDOUT: !153 = !{!151}
|
|
// CHECK:STDOUT: !154 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.6dae29ece9a708c4:core.Destroy.Core", scope: null, file: !138, line: 8, type: !27, spFlags: DISPFlagDefinition, unit: !139, retainedNodes: !157)
|
|
// CHECK:STDOUT: !155 = !DILocalVariable(arg: 1, scope: !154, type: !20)
|
|
// CHECK:STDOUT: !156 = !DILocation(line: 8, column: 3, scope: !154)
|
|
// CHECK:STDOUT: !157 = !{!155}
|
|
// CHECK:STDOUT: !158 = distinct !DISubprogram(name: "SubobjectDestroy", linkageName: "_CSubobjectDestroy.f58524831c37807e:core.Destroy.Core", scope: null, file: !138, line: 8, type: !27, spFlags: DISPFlagDefinition, unit: !139, retainedNodes: !161)
|
|
// CHECK:STDOUT: !159 = !DILocalVariable(arg: 1, scope: !158, type: !20)
|
|
// CHECK:STDOUT: !160 = !DILocation(line: 8, column: 3, scope: !158)
|
|
// CHECK:STDOUT: !161 = !{!159}
|
|
// CHECK:STDOUT: !162 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.f58524831c37807e:core.Destroy.Core", scope: null, file: !138, line: 8, type: !27, spFlags: DISPFlagDefinition, unit: !139, retainedNodes: !165)
|
|
// CHECK:STDOUT: !163 = !DILocalVariable(arg: 1, scope: !162, type: !20)
|
|
// CHECK:STDOUT: !164 = !DILocation(line: 8, column: 3, scope: !162)
|
|
// CHECK:STDOUT: !165 = !{!163}
|
|
// CHECK:STDOUT: !166 = distinct !DISubprogram(name: "SubobjectDestroy", linkageName: "_CSubobjectDestroy.90798694d9a177e6:core.Destroy.Core", scope: null, file: !138, line: 8, type: !23, spFlags: DISPFlagDefinition, unit: !139, retainedNodes: !169)
|
|
// CHECK:STDOUT: !167 = !DILocalVariable(arg: 1, scope: !166, type: !21)
|
|
// CHECK:STDOUT: !168 = !DILocation(line: 8, column: 3, scope: !166)
|
|
// CHECK:STDOUT: !169 = !{!167}
|
|
// CHECK:STDOUT: !170 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.90798694d9a177e6:core.Destroy.Core", scope: null, file: !138, line: 8, type: !23, spFlags: DISPFlagDefinition, unit: !139, retainedNodes: !173)
|
|
// CHECK:STDOUT: !171 = !DILocalVariable(arg: 1, scope: !170, type: !21)
|
|
// CHECK:STDOUT: !172 = !DILocation(line: 8, column: 3, scope: !170)
|
|
// CHECK:STDOUT: !173 = !{!171}
|
|
// CHECK:STDOUT: !174 = distinct !DISubprogram(name: "SubobjectDestroy", linkageName: "_CSubobjectDestroy.fb4d9eb13d71ce13:core.Destroy.Core", scope: null, file: !138, line: 8, type: !23, spFlags: DISPFlagDefinition, unit: !139, retainedNodes: !177)
|
|
// CHECK:STDOUT: !175 = !DILocalVariable(arg: 1, scope: !174, type: !21)
|
|
// CHECK:STDOUT: !176 = !DILocation(line: 8, column: 3, scope: !174)
|
|
// CHECK:STDOUT: !177 = !{!175}
|
|
// CHECK:STDOUT: !178 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.fb4d9eb13d71ce13:core.Destroy.Core", scope: null, file: !138, line: 8, type: !23, spFlags: DISPFlagDefinition, unit: !139, retainedNodes: !181)
|
|
// CHECK:STDOUT: !179 = !DILocalVariable(arg: 1, scope: !178, type: !21)
|
|
// CHECK:STDOUT: !180 = !DILocation(line: 8, column: 3, scope: !178)
|
|
// CHECK:STDOUT: !181 = !{!179}
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: ; ---
|
|
// CHECK:STDOUT: ; ModuleID = 'insert_padding.carbon'
|
|
// CHECK:STDOUT: source_filename = "insert_padding.carbon"
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: declare void @_CG.Main(ptr)
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: ; Function Attrs: nounwind
|
|
// CHECK:STDOUT: define void @_CF.Main() #0 !dbg !184 {
|
|
// CHECK:STDOUT: entry:
|
|
// CHECK:STDOUT: %insert_padding.var = alloca <{ <{ { i32, i32, i32 }, [4 x i8] }>, ptr, i32 }>, align 8, !dbg !185
|
|
// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %insert_padding.var), !dbg !185
|
|
// CHECK:STDOUT: %.loc10.b = getelementptr inbounds nuw <{ <{ { i32, i32, i32 }, [4 x i8] }>, ptr, i32 }>, ptr %insert_padding.var, i32 0, i32 1, !dbg !187
|
|
// CHECK:STDOUT: call void @_CG.Main(ptr %.loc10.b), !dbg !189
|
|
// CHECK:STDOUT: call void @"_CSelfDestruct.b496992173693e26:core.Destroy.Core"(ptr %insert_padding.var), !dbg !185
|
|
// CHECK:STDOUT: ret void, !dbg !190
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: ; Function Attrs: nounwind
|
|
// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.6dae29ece9a708c4:core.Destroy.Core"(ptr %self) #0 !dbg !191 {
|
|
// CHECK:STDOUT: entry:
|
|
// CHECK:STDOUT: ret void, !dbg !193
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: ; Function Attrs: nounwind
|
|
// CHECK:STDOUT: define weak_odr void @"_CSubobjectDestroy.f58524831c37807e:core.Destroy.Core"(ptr %self) #0 !dbg !195 {
|
|
// CHECK:STDOUT: entry:
|
|
// CHECK:STDOUT: ret void, !dbg !197
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: ; Function Attrs: nounwind
|
|
// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.f58524831c37807e:core.Destroy.Core"(ptr %self) #0 !dbg !199 {
|
|
// CHECK:STDOUT: entry:
|
|
// CHECK:STDOUT: call void @"_CSubobjectDestroy.f58524831c37807e:core.Destroy.Core"(ptr %self), !dbg !201
|
|
// CHECK:STDOUT: ret void, !dbg !201
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: ; Function Attrs: nounwind
|
|
// CHECK:STDOUT: define weak_odr void @"_CSubobjectDestroy.cc12b768126bed5c:core.Destroy.Core"(ptr %self) #0 !dbg !203 {
|
|
// CHECK:STDOUT: entry:
|
|
// CHECK:STDOUT: ret void, !dbg !205
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: ; Function Attrs: nounwind
|
|
// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.cc12b768126bed5c:core.Destroy.Core"(ptr %self) #0 !dbg !207 {
|
|
// CHECK:STDOUT: entry:
|
|
// CHECK:STDOUT: call void @"_CSubobjectDestroy.cc12b768126bed5c:core.Destroy.Core"(ptr %self), !dbg !209
|
|
// CHECK:STDOUT: ret void, !dbg !209
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: ; Function Attrs: nounwind
|
|
// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.8436f795915f0543:core.Destroy.Core"(ptr %self) #0 !dbg !211 {
|
|
// CHECK:STDOUT: entry:
|
|
// CHECK:STDOUT: ret void, !dbg !213
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: ; Function Attrs: nounwind
|
|
// CHECK:STDOUT: define weak_odr void @"_CSubobjectDestroy.b496992173693e26:core.Destroy.Core"(ptr %self) #0 !dbg !215 {
|
|
// CHECK:STDOUT: entry:
|
|
// CHECK:STDOUT: ret void, !dbg !217
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: ; Function Attrs: nounwind
|
|
// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.b496992173693e26:core.Destroy.Core"(ptr %self) #0 !dbg !219 {
|
|
// CHECK:STDOUT: entry:
|
|
// CHECK:STDOUT: call void @"_CSubobjectDestroy.b496992173693e26:core.Destroy.Core"(ptr %self), !dbg !221
|
|
// CHECK:STDOUT: ret void, !dbg !221
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: ; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
|
|
// CHECK:STDOUT: declare void @llvm.lifetime.start.p0(ptr captures(none)) #1
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: attributes #0 = { nounwind }
|
|
// CHECK:STDOUT: attributes #1 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: !llvm.dbg.cu = !{!183}
|
|
// CHECK:STDOUT: !llvm.module.flags = !{!2, !3}
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: !2 = !{i32 7, !"Dwarf Version", i32 5}
|
|
// CHECK:STDOUT: !3 = !{i32 2, !"Debug Info Version", i32 3}
|
|
// CHECK:STDOUT: !20 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed)
|
|
// CHECK:STDOUT: !21 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: null, size: 64)
|
|
// CHECK:STDOUT: !22 = !{null, !21}
|
|
// CHECK:STDOUT: !23 = !DISubroutineType(types: !22)
|
|
// CHECK:STDOUT: !24 = !{null}
|
|
// CHECK:STDOUT: !25 = !DISubroutineType(types: !24)
|
|
// CHECK:STDOUT: !26 = !{null, !20}
|
|
// CHECK:STDOUT: !27 = !DISubroutineType(types: !26)
|
|
// CHECK:STDOUT: !182 = !DIFile(filename: "insert_padding.carbon", directory: "")
|
|
// CHECK:STDOUT: !183 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !182, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug)
|
|
// CHECK:STDOUT: !184 = distinct !DISubprogram(name: "F", linkageName: "_CF.Main", scope: null, file: !182, line: 5, type: !25, spFlags: DISPFlagDefinition, unit: !183)
|
|
// CHECK:STDOUT: !185 = !DILocation(line: 9, column: 3, scope: !184)
|
|
// CHECK:STDOUT: !187 = !DILocation(line: 10, column: 6, scope: !184)
|
|
// CHECK:STDOUT: !189 = !DILocation(line: 10, column: 3, scope: !184)
|
|
// CHECK:STDOUT: !190 = !DILocation(line: 5, column: 1, scope: !184)
|
|
// CHECK:STDOUT: !191 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.6dae29ece9a708c4:core.Destroy.Core", scope: null, file: !182, line: 9, type: !27, spFlags: DISPFlagDefinition, unit: !183, retainedNodes: !194)
|
|
// CHECK:STDOUT: !192 = !DILocalVariable(arg: 1, scope: !191, type: !20)
|
|
// CHECK:STDOUT: !193 = !DILocation(line: 9, column: 3, scope: !191)
|
|
// CHECK:STDOUT: !194 = !{!192}
|
|
// CHECK:STDOUT: !195 = distinct !DISubprogram(name: "SubobjectDestroy", linkageName: "_CSubobjectDestroy.f58524831c37807e:core.Destroy.Core", scope: null, file: !182, line: 9, type: !27, spFlags: DISPFlagDefinition, unit: !183, retainedNodes: !198)
|
|
// CHECK:STDOUT: !196 = !DILocalVariable(arg: 1, scope: !195, type: !20)
|
|
// CHECK:STDOUT: !197 = !DILocation(line: 9, column: 3, scope: !195)
|
|
// CHECK:STDOUT: !198 = !{!196}
|
|
// CHECK:STDOUT: !199 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.f58524831c37807e:core.Destroy.Core", scope: null, file: !182, line: 9, type: !27, spFlags: DISPFlagDefinition, unit: !183, retainedNodes: !202)
|
|
// CHECK:STDOUT: !200 = !DILocalVariable(arg: 1, scope: !199, type: !20)
|
|
// CHECK:STDOUT: !201 = !DILocation(line: 9, column: 3, scope: !199)
|
|
// CHECK:STDOUT: !202 = !{!200}
|
|
// CHECK:STDOUT: !203 = distinct !DISubprogram(name: "SubobjectDestroy", linkageName: "_CSubobjectDestroy.cc12b768126bed5c:core.Destroy.Core", scope: null, file: !182, line: 9, type: !23, spFlags: DISPFlagDefinition, unit: !183, retainedNodes: !206)
|
|
// CHECK:STDOUT: !204 = !DILocalVariable(arg: 1, scope: !203, type: !21)
|
|
// CHECK:STDOUT: !205 = !DILocation(line: 9, column: 3, scope: !203)
|
|
// CHECK:STDOUT: !206 = !{!204}
|
|
// CHECK:STDOUT: !207 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.cc12b768126bed5c:core.Destroy.Core", scope: null, file: !182, line: 9, type: !23, spFlags: DISPFlagDefinition, unit: !183, retainedNodes: !210)
|
|
// CHECK:STDOUT: !208 = !DILocalVariable(arg: 1, scope: !207, type: !21)
|
|
// CHECK:STDOUT: !209 = !DILocation(line: 9, column: 3, scope: !207)
|
|
// CHECK:STDOUT: !210 = !{!208}
|
|
// CHECK:STDOUT: !211 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.8436f795915f0543:core.Destroy.Core", scope: null, file: !182, line: 9, type: !23, spFlags: DISPFlagDefinition, unit: !183, retainedNodes: !214)
|
|
// CHECK:STDOUT: !212 = !DILocalVariable(arg: 1, scope: !211, type: !21)
|
|
// CHECK:STDOUT: !213 = !DILocation(line: 9, column: 3, scope: !211)
|
|
// CHECK:STDOUT: !214 = !{!212}
|
|
// CHECK:STDOUT: !215 = distinct !DISubprogram(name: "SubobjectDestroy", linkageName: "_CSubobjectDestroy.b496992173693e26:core.Destroy.Core", scope: null, file: !182, line: 9, type: !23, spFlags: DISPFlagDefinition, unit: !183, retainedNodes: !218)
|
|
// CHECK:STDOUT: !216 = !DILocalVariable(arg: 1, scope: !215, type: !21)
|
|
// CHECK:STDOUT: !217 = !DILocation(line: 9, column: 3, scope: !215)
|
|
// CHECK:STDOUT: !218 = !{!216}
|
|
// CHECK:STDOUT: !219 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.b496992173693e26:core.Destroy.Core", scope: null, file: !182, line: 9, type: !23, spFlags: DISPFlagDefinition, unit: !183, retainedNodes: !222)
|
|
// CHECK:STDOUT: !220 = !DILocalVariable(arg: 1, scope: !219, type: !21)
|
|
// CHECK:STDOUT: !221 = !DILocation(line: 9, column: 3, scope: !219)
|
|
// CHECK:STDOUT: !222 = !{!220}
|
|
// CHECK:STDOUT:
|