Skip to content

Instantly share code, notes, and snippets.

@andrewrk
Created June 8, 2019 22:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save andrewrk/878747405f7e4d8dcd709087622512c9 to your computer and use it in GitHub Desktop.
Save andrewrk/878747405f7e4d8dcd709087622512c9 to your computer and use it in GitHub Desktop.
result location demo
export fn entry() void {
const static = Foo{
.x = 9,
.bar = Bar{ .y = 10 },
};
const runtime = foo(true);
}
fn foo(c: bool) Foo {
return Foo{
.x = 12,
.bar = if (c) bar1() else bar2(),
};
}
fn bar1() Bar {
return Bar{ .y = 34 };
}
fn bar2() Bar {
return Bar{ .y = 56 };
}
const Foo = struct {
x: i32,
bar: Bar,
};
const Bar = struct {
y: i32,
};
const builtin = @import("builtin");
pub fn panic(msg: []const u8, error_return_trace: ?*builtin.StackTrace) noreturn {
while (true) {}
}
; This is the output on master branch.
; ./zig0 build-obj test.zig --verbose-llvm-ir --disable-valgrind
; ModuleID = 'test'
source_filename = "test"
target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"
%Foo = type { i32, %Bar }
%Bar = type { i32 }
%"[]u8" = type { i8*, i64 }
%builtin.StackTrace = type { i64, %"[]usize" }
%"[]usize" = type { i64*, i64 }
@0 = internal unnamed_addr constant %Foo { i32 9, %Bar { i32 10 } }, align 4
@1 = internal unnamed_addr constant %Bar { i32 34 }, align 4
@2 = internal unnamed_addr constant %Bar { i32 56 }, align 4
; Function Attrs: nobuiltin noreturn nounwind
define internal fastcc void @panic(%"[]u8"* nonnull readonly align 8, %builtin.StackTrace* align 8) unnamed_addr #0 !dbg !4 {
Entry:
%error_return_trace = alloca %builtin.StackTrace*, align 8
call void @llvm.dbg.declare(metadata %"[]u8"* %0, metadata !29, metadata !DIExpression()), !dbg !31
store %builtin.StackTrace* %1, %builtin.StackTrace** %error_return_trace, align 8
call void @llvm.dbg.declare(metadata %builtin.StackTrace** %error_return_trace, metadata !30, metadata !DIExpression()), !dbg !32
br label %WhileCond, !dbg !33
WhileCond: ; preds = %WhileCond, %Entry
br label %WhileCond, !dbg !33
}
; Function Attrs: nounwind readnone speculatable
declare void @llvm.dbg.declare(metadata, metadata, metadata) #1
; Function Attrs: nobuiltin nounwind
define void @entry() #2 !dbg !35 {
Entry:
%0 = alloca %Foo, align 4
%static = alloca %Foo, align 4
%runtime = alloca %Foo, align 4
%1 = bitcast %Foo* %static to i8*, !dbg !50
call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 4 %1, i8* align 4 bitcast (%Foo* @0 to i8*), i64 8, i1 false), !dbg !50
call void @llvm.dbg.declare(metadata %Foo* %static, metadata !39, metadata !DIExpression()), !dbg !50
call fastcc void @foo(%Foo* sret %0, i1 true), !dbg !51
%2 = bitcast %Foo* %0 to i8*, !dbg !52
%3 = bitcast %Foo* %runtime to i8*, !dbg !52
call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 4 %3, i8* align 4 %2, i64 8, i1 false), !dbg !52
call void @llvm.dbg.declare(metadata %Foo* %runtime, metadata !49, metadata !DIExpression()), !dbg !52
ret void, !dbg !53
}
; Function Attrs: argmemonly nounwind
declare void @llvm.memcpy.p0i8.p0i8.i64(i8* nocapture writeonly, i8* nocapture readonly, i64, i1) #3
; Function Attrs: nobuiltin nounwind
define internal fastcc void @foo(%Foo* nonnull sret, i1) unnamed_addr #2 !dbg !54 {
Entry:
%2 = alloca %Bar, align 4
%3 = alloca %Bar, align 4
%4 = alloca %Foo, align 4
%c = alloca i1, align 1
store i1 %1, i1* %c, align 1
call void @llvm.dbg.declare(metadata i1* %c, metadata !60, metadata !DIExpression()), !dbg !61
%5 = load i1, i1* %c, align 1, !dbg !62
br i1 %5, label %Then, label %Else, !dbg !62
Then: ; preds = %Entry
call fastcc void @bar1(%Bar* sret %2), !dbg !64
br label %EndIf, !dbg !65
Else: ; preds = %Entry
call fastcc void @bar2(%Bar* sret %3), !dbg !66
br label %EndIf, !dbg !65
EndIf: ; preds = %Else, %Then
%6 = phi %Bar* [ %2, %Then ], [ %3, %Else ], !dbg !65
%7 = getelementptr inbounds %Foo, %Foo* %4, i32 0, i32 0, !dbg !67
store i32 12, i32* %7, align 4, !dbg !67
%8 = getelementptr inbounds %Foo, %Foo* %4, i32 0, i32 1, !dbg !67
%9 = bitcast %Bar* %6 to i8*, !dbg !67
%10 = bitcast %Bar* %8 to i8*, !dbg !67
call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 4 %10, i8* align 4 %9, i64 4, i1 false), !dbg !67
%11 = bitcast %Foo* %4 to i8*, !dbg !68
%12 = bitcast %Foo* %0 to i8*, !dbg !68
call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 4 %12, i8* align 4 %11, i64 8, i1 false), !dbg !68
ret void, !dbg !68
}
; Function Attrs: nobuiltin nounwind
define internal fastcc void @bar1(%Bar* nonnull sret) unnamed_addr #2 !dbg !69 {
Entry:
%1 = bitcast %Bar* %0 to i8*, !dbg !73
call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 4 %1, i8* align 4 bitcast (%Bar* @1 to i8*), i64 4, i1 false), !dbg !73
ret void, !dbg !73
}
; Function Attrs: nobuiltin nounwind
define internal fastcc void @bar2(%Bar* nonnull sret) unnamed_addr #2 !dbg !75 {
Entry:
%1 = bitcast %Bar* %0 to i8*, !dbg !76
call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 4 %1, i8* align 4 bitcast (%Bar* @2 to i8*), i64 4, i1 false), !dbg !76
ret void, !dbg !76
}
attributes #0 = { nobuiltin noreturn nounwind "no-frame-pointer-elim"="true" "no-frame-pointer-elim-non-leaf" "probe-stack"="__zig_probe_stack" }
attributes #1 = { nounwind readnone speculatable }
attributes #2 = { nobuiltin nounwind "no-frame-pointer-elim"="true" "no-frame-pointer-elim-non-leaf" "probe-stack"="__zig_probe_stack" }
attributes #3 = { argmemonly nounwind }
!llvm.module.flags = !{!0}
!llvm.dbg.cu = !{!1}
!0 = !{i32 2, !"Debug Info Version", i32 3}
!1 = distinct !DICompileUnit(language: DW_LANG_C99, file: !2, producer: "zig 0.4.0", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug, enums: !3)
!2 = !DIFile(filename: "test", directory: ".")
!3 = !{}
!4 = distinct !DISubprogram(name: "panic", scope: !5, file: !5, line: 34, type: !6, scopeLine: 34, flags: DIFlagStaticMember, spFlags: DISPFlagLocalToUnit | DISPFlagDefinition, unit: !1, retainedNodes: !28)
!5 = !DIFile(filename: "test.zig", directory: "/home/andy/downloads/zig/build")
!6 = !DISubroutineType(types: !7)
!7 = !{!8, !9, !17}
!8 = !DIBasicType(name: "void", encoding: DW_ATE_signed)
!9 = !DIDerivedType(tag: DW_TAG_pointer_type, name: "*[]const u8", baseType: !10, size: 64, align: 64)
!10 = !DICompositeType(tag: DW_TAG_structure_type, name: "[]u8", size: 128, align: 64, elements: !11)
!11 = !{!12, !15}
!12 = !DIDerivedType(tag: DW_TAG_member, name: "ptr", scope: !10, baseType: !13, size: 64, align: 64)
!13 = !DIDerivedType(tag: DW_TAG_pointer_type, name: "*u8", baseType: !14, size: 64, align: 64)
!14 = !DIBasicType(name: "u8", size: 8, encoding: DW_ATE_unsigned_char)
!15 = !DIDerivedType(tag: DW_TAG_member, name: "len", scope: !10, baseType: !16, size: 64, align: 64, offset: 64)
!16 = !DIBasicType(name: "usize", size: 64, encoding: DW_ATE_unsigned)
!17 = !DIDerivedType(tag: DW_TAG_pointer_type, name: "*builtin.StackTrace", baseType: !18, size: 64, align: 64)
!18 = !DICompositeType(tag: DW_TAG_structure_type, name: "builtin.StackTrace", scope: !19, file: !19, line: 1, size: 192, align: 64, elements: !20)
!19 = !DIFile(filename: "builtin.zig", directory: "/home/andy/.local/share/zig/stage1/builtin/BuKmd4zycQGYJsqXLK0fw2xZrEx-0A-7EvAxymAZ7BAEsn4S_k-ac9aQYG4KdNh4")
!20 = !{!21, !22}
!21 = !DIDerivedType(tag: DW_TAG_member, name: "index", scope: !18, file: !19, line: 2, baseType: !16, size: 64, align: 64)
!22 = !DIDerivedType(tag: DW_TAG_member, name: "instruction_addresses", scope: !18, file: !19, line: 3, baseType: !23, size: 128, align: 64, offset: 64)
!23 = !DICompositeType(tag: DW_TAG_structure_type, name: "[]usize", size: 128, align: 64, elements: !24)
!24 = !{!25, !27}
!25 = !DIDerivedType(tag: DW_TAG_member, name: "ptr", scope: !23, baseType: !26, size: 64, align: 64)
!26 = !DIDerivedType(tag: DW_TAG_pointer_type, name: "*usize", baseType: !16, size: 64, align: 64)
!27 = !DIDerivedType(tag: DW_TAG_member, name: "len", scope: !23, baseType: !16, size: 64, align: 64, offset: 64)
!28 = !{!29, !30}
!29 = !DILocalVariable(name: "msg", arg: 1, scope: !4, file: !5, line: 34, type: !10)
!30 = !DILocalVariable(name: "error_return_trace", arg: 2, scope: !4, file: !5, line: 34, type: !17)
!31 = !DILocation(line: 34, column: 14, scope: !4)
!32 = !DILocation(line: 34, column: 31, scope: !4)
!33 = !DILocation(line: 35, column: 5, scope: !34)
!34 = distinct !DILexicalBlock(scope: !4, file: !5, line: 34, column: 82)
!35 = distinct !DISubprogram(name: "entry", scope: !5, file: !5, type: !36, flags: DIFlagStaticMember, spFlags: DISPFlagDefinition, unit: !1, retainedNodes: !38)
!36 = !DISubroutineType(types: !37)
!37 = !{!8}
!38 = !{!39, !49}
!39 = !DILocalVariable(name: "static", scope: !40, file: !5, line: 2, type: !41)
!40 = distinct !DILexicalBlock(scope: !35, file: !5, line: 1, column: 24)
!41 = !DICompositeType(tag: DW_TAG_structure_type, name: "Foo", scope: !5, file: !5, line: 24, size: 64, align: 32, elements: !42)
!42 = !{!43, !45}
!43 = !DIDerivedType(tag: DW_TAG_member, name: "x", scope: !41, file: !5, line: 25, baseType: !44, size: 32, align: 32)
!44 = !DIBasicType(name: "i32", size: 32, encoding: DW_ATE_signed)
!45 = !DIDerivedType(tag: DW_TAG_member, name: "bar", scope: !41, file: !5, line: 26, baseType: !46, size: 32, align: 32, offset: 32)
!46 = !DICompositeType(tag: DW_TAG_structure_type, name: "Bar", scope: !5, file: !5, line: 29, size: 32, align: 32, elements: !47)
!47 = !{!48}
!48 = !DIDerivedType(tag: DW_TAG_member, name: "y", scope: !46, file: !5, line: 30, baseType: !44, size: 32, align: 32)
!49 = !DILocalVariable(name: "runtime", scope: !40, file: !5, line: 6, type: !41)
!50 = !DILocation(line: 2, column: 5, scope: !40)
!51 = !DILocation(line: 6, column: 24, scope: !40)
!52 = !DILocation(line: 6, column: 5, scope: !40)
!53 = !DILocation(line: 1, column: 24, scope: !35)
!54 = distinct !DISubprogram(name: "foo", scope: !5, file: !5, line: 9, type: !55, scopeLine: 9, flags: DIFlagStaticMember, spFlags: DISPFlagLocalToUnit | DISPFlagDefinition, unit: !1, retainedNodes: !59)
!55 = !DISubroutineType(types: !56)
!56 = !{!41, !57, !58}
!57 = !DIDerivedType(tag: DW_TAG_pointer_type, name: "*Foo", baseType: !41, size: 64, align: 64)
!58 = !DIBasicType(name: "bool", size: 1, encoding: DW_ATE_boolean)
!59 = !{!60}
!60 = !DILocalVariable(name: "c", arg: 2, scope: !54, file: !5, line: 9, type: !58)
!61 = !DILocation(line: 9, column: 8, scope: !54)
!62 = !DILocation(line: 12, column: 20, scope: !63)
!63 = distinct !DILexicalBlock(scope: !54, file: !5, line: 9, column: 21)
!64 = !DILocation(line: 12, column: 27, scope: !63)
!65 = !DILocation(line: 12, column: 16, scope: !63)
!66 = !DILocation(line: 12, column: 39, scope: !63)
!67 = !DILocation(line: 10, column: 15, scope: !63)
!68 = !DILocation(line: 10, column: 5, scope: !63)
!69 = distinct !DISubprogram(name: "bar1", scope: !5, file: !5, line: 16, type: !70, scopeLine: 16, flags: DIFlagStaticMember, spFlags: DISPFlagLocalToUnit | DISPFlagDefinition, unit: !1, retainedNodes: !3)
!70 = !DISubroutineType(types: !71)
!71 = !{!46, !72}
!72 = !DIDerivedType(tag: DW_TAG_pointer_type, name: "*Bar", baseType: !46, size: 64, align: 64)
!73 = !DILocation(line: 17, column: 5, scope: !74)
!74 = distinct !DILexicalBlock(scope: !69, file: !5, line: 16, column: 15)
!75 = distinct !DISubprogram(name: "bar2", scope: !5, file: !5, line: 20, type: !70, scopeLine: 20, flags: DIFlagStaticMember, spFlags: DISPFlagLocalToUnit | DISPFlagDefinition, unit: !1, retainedNodes: !3)
!76 = !DILocation(line: 21, column: 5, scope: !77)
!77 = distinct !DILexicalBlock(scope: !75, file: !5, line: 20, column: 15)
; This is the output on copy-elision-3 branch.
; ./zig0 build-obj test.zig --verbose-llvm-ir --disable-valgrind
; ModuleID = 'test'
source_filename = "test"
target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"
%Foo = type { i32, %Bar }
%Bar = type { i32 }
%"[]u8" = type { i8*, i64 }
%builtin.StackTrace = type { i64, %"[]usize" }
%"[]usize" = type { i64*, i64 }
@0 = internal unnamed_addr constant %Foo { i32 9, %Bar { i32 10 } }, align 4
@1 = internal unnamed_addr constant %Bar { i32 34 }, align 4
@2 = internal unnamed_addr constant %Bar { i32 56 }, align 4
; Function Attrs: nobuiltin noreturn nounwind
define internal fastcc void @panic(%"[]u8"* nonnull readonly align 8, %builtin.StackTrace* align 8) unnamed_addr #0 !dbg !4 {
Entry:
%error_return_trace = alloca %builtin.StackTrace*, align 8
call void @llvm.dbg.declare(metadata %"[]u8"* %0, metadata !29, metadata !DIExpression()), !dbg !31
store %builtin.StackTrace* %1, %builtin.StackTrace** %error_return_trace, align 8
call void @llvm.dbg.declare(metadata %builtin.StackTrace** %error_return_trace, metadata !30, metadata !DIExpression()), !dbg !32
br label %WhileCond, !dbg !33
WhileCond: ; preds = %WhileCond, %Entry
br label %WhileCond, !dbg !33
}
; Function Attrs: nounwind readnone speculatable
declare void @llvm.dbg.declare(metadata, metadata, metadata) #1
; Function Attrs: nobuiltin nounwind
define void @entry() #2 !dbg !35 {
Entry:
%runtime = alloca %Foo, align 4
call void @llvm.dbg.declare(metadata %Foo* @0, metadata !39, metadata !DIExpression()), !dbg !50
call fastcc void @foo(%Foo* sret %runtime, i1 true), !dbg !51
call void @llvm.dbg.declare(metadata %Foo* %runtime, metadata !49, metadata !DIExpression()), !dbg !52
ret void, !dbg !53
}
; Function Attrs: nobuiltin nounwind
define internal fastcc void @foo(%Foo* nonnull sret, i1) unnamed_addr #2 !dbg !54 {
Entry:
%c = alloca i1, align 1
store i1 %1, i1* %c, align 1
call void @llvm.dbg.declare(metadata i1* %c, metadata !60, metadata !DIExpression()), !dbg !61
%2 = getelementptr inbounds %Foo, %Foo* %0, i32 0, i32 0, !dbg !62
store i32 12, i32* %2, align 4, !dbg !62
%3 = getelementptr inbounds %Foo, %Foo* %0, i32 0, i32 1, !dbg !64
%4 = load i1, i1* %c, align 1, !dbg !65
br i1 %4, label %Then, label %Else, !dbg !65
Then: ; preds = %Entry
call fastcc void @bar1(%Bar* sret %3), !dbg !66
br label %EndIf, !dbg !64
Else: ; preds = %Entry
call fastcc void @bar2(%Bar* sret %3), !dbg !67
br label %EndIf, !dbg !64
EndIf: ; preds = %Else, %Then
ret void, !dbg !68
}
; Function Attrs: nobuiltin nounwind
define internal fastcc void @bar1(%Bar* nonnull sret) unnamed_addr #2 !dbg !69 {
Entry:
%1 = bitcast %Bar* %0 to i8*, !dbg !73
call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 4 %1, i8* align 4 bitcast (%Bar* @1 to i8*), i64 4, i1 false), !dbg !73
ret void, !dbg !73
}
; Function Attrs: nobuiltin nounwind
define internal fastcc void @bar2(%Bar* nonnull sret) unnamed_addr #2 !dbg !75 {
Entry:
%1 = bitcast %Bar* %0 to i8*, !dbg !76
call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 4 %1, i8* align 4 bitcast (%Bar* @2 to i8*), i64 4, i1 false), !dbg !76
ret void, !dbg !76
}
; Function Attrs: argmemonly nounwind
declare void @llvm.memcpy.p0i8.p0i8.i64(i8* nocapture writeonly, i8* nocapture readonly, i64, i1) #3
attributes #0 = { nobuiltin noreturn nounwind "no-frame-pointer-elim"="true" "no-frame-pointer-elim-non-leaf" "probe-stack"="__zig_probe_stack" }
attributes #1 = { nounwind readnone speculatable }
attributes #2 = { nobuiltin nounwind "no-frame-pointer-elim"="true" "no-frame-pointer-elim-non-leaf" "probe-stack"="__zig_probe_stack" }
attributes #3 = { argmemonly nounwind }
!llvm.module.flags = !{!0}
!llvm.dbg.cu = !{!1}
!0 = !{i32 2, !"Debug Info Version", i32 3}
!1 = distinct !DICompileUnit(language: DW_LANG_C99, file: !2, producer: "zig 0.4.0", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug, enums: !3)
!2 = !DIFile(filename: "test", directory: ".")
!3 = !{}
!4 = distinct !DISubprogram(name: "panic", scope: !5, file: !5, line: 34, type: !6, scopeLine: 34, flags: DIFlagStaticMember, spFlags: DISPFlagLocalToUnit | DISPFlagDefinition, unit: !1, retainedNodes: !28)
!5 = !DIFile(filename: "test.zig", directory: "/home/andy/dev/zig/build")
!6 = !DISubroutineType(types: !7)
!7 = !{!8, !9, !17}
!8 = !DIBasicType(name: "void", encoding: DW_ATE_unsigned)
!9 = !DIDerivedType(tag: DW_TAG_pointer_type, name: "*[]const u8", baseType: !10, size: 64, align: 64)
!10 = !DICompositeType(tag: DW_TAG_structure_type, name: "[]u8", size: 128, align: 64, elements: !11)
!11 = !{!12, !15}
!12 = !DIDerivedType(tag: DW_TAG_member, name: "ptr", scope: !10, baseType: !13, size: 64, align: 64)
!13 = !DIDerivedType(tag: DW_TAG_pointer_type, name: "*u8", baseType: !14, size: 64, align: 64)
!14 = !DIBasicType(name: "u8", size: 8, encoding: DW_ATE_unsigned_char)
!15 = !DIDerivedType(tag: DW_TAG_member, name: "len", scope: !10, baseType: !16, size: 64, align: 64, offset: 64)
!16 = !DIBasicType(name: "usize", size: 64, encoding: DW_ATE_unsigned)
!17 = !DIDerivedType(tag: DW_TAG_pointer_type, name: "*builtin.StackTrace", baseType: !18, size: 64, align: 64)
!18 = !DICompositeType(tag: DW_TAG_structure_type, name: "builtin.StackTrace", scope: !19, file: !19, line: 1, size: 192, align: 64, elements: !20)
!19 = !DIFile(filename: "builtin.zig", directory: "/home/andy/.local/share/zig/stage1/builtin/lWNItpKK_kea-aRvcnhDFL8u22WtWoSVkxyFaaKNcFPQVqxLyOUpzimFU27UFwTV")
!20 = !{!21, !22}
!21 = !DIDerivedType(tag: DW_TAG_member, name: "index", scope: !18, file: !19, line: 2, baseType: !16, size: 64, align: 64)
!22 = !DIDerivedType(tag: DW_TAG_member, name: "instruction_addresses", scope: !18, file: !19, line: 3, baseType: !23, size: 128, align: 64, offset: 64)
!23 = !DICompositeType(tag: DW_TAG_structure_type, name: "[]usize", size: 128, align: 64, elements: !24)
!24 = !{!25, !27}
!25 = !DIDerivedType(tag: DW_TAG_member, name: "ptr", scope: !23, baseType: !26, size: 64, align: 64)
!26 = !DIDerivedType(tag: DW_TAG_pointer_type, name: "*usize", baseType: !16, size: 64, align: 64)
!27 = !DIDerivedType(tag: DW_TAG_member, name: "len", scope: !23, baseType: !16, size: 64, align: 64, offset: 64)
!28 = !{!29, !30}
!29 = !DILocalVariable(name: "msg", arg: 1, scope: !4, file: !5, line: 34, type: !10)
!30 = !DILocalVariable(name: "error_return_trace", arg: 2, scope: !4, file: !5, line: 34, type: !17)
!31 = !DILocation(line: 34, column: 14, scope: !4)
!32 = !DILocation(line: 34, column: 31, scope: !4)
!33 = !DILocation(line: 35, column: 5, scope: !34)
!34 = distinct !DILexicalBlock(scope: !4, file: !5, line: 34, column: 82)
!35 = distinct !DISubprogram(name: "entry", scope: !5, file: !5, type: !36, flags: DIFlagStaticMember, spFlags: DISPFlagDefinition, unit: !1, retainedNodes: !38)
!36 = !DISubroutineType(types: !37)
!37 = !{!8}
!38 = !{!39, !49}
!39 = !DILocalVariable(name: "static", scope: !40, file: !5, line: 2, type: !41)
!40 = distinct !DILexicalBlock(scope: !35, file: !5, line: 1, column: 24)
!41 = !DICompositeType(tag: DW_TAG_structure_type, name: "Foo", scope: !5, file: !5, line: 24, size: 64, align: 32, elements: !42)
!42 = !{!43, !45}
!43 = !DIDerivedType(tag: DW_TAG_member, name: "x", scope: !41, file: !5, line: 25, baseType: !44, size: 32, align: 32)
!44 = !DIBasicType(name: "i32", size: 32, encoding: DW_ATE_signed)
!45 = !DIDerivedType(tag: DW_TAG_member, name: "bar", scope: !41, file: !5, line: 26, baseType: !46, size: 32, align: 32, offset: 32)
!46 = !DICompositeType(tag: DW_TAG_structure_type, name: "Bar", scope: !5, file: !5, line: 29, size: 32, align: 32, elements: !47)
!47 = !{!48}
!48 = !DIDerivedType(tag: DW_TAG_member, name: "y", scope: !46, file: !5, line: 30, baseType: !44, size: 32, align: 32)
!49 = !DILocalVariable(name: "runtime", scope: !40, file: !5, line: 6, type: !41)
!50 = !DILocation(line: 2, column: 5, scope: !40)
!51 = !DILocation(line: 6, column: 24, scope: !40)
!52 = !DILocation(line: 6, column: 5, scope: !40)
!53 = !DILocation(line: 1, column: 24, scope: !35)
!54 = distinct !DISubprogram(name: "foo", scope: !5, file: !5, line: 9, type: !55, scopeLine: 9, flags: DIFlagStaticMember, spFlags: DISPFlagLocalToUnit | DISPFlagDefinition, unit: !1, retainedNodes: !59)
!55 = !DISubroutineType(types: !56)
!56 = !{!41, !57, !58}
!57 = !DIDerivedType(tag: DW_TAG_pointer_type, name: "*Foo", baseType: !41, size: 64, align: 64)
!58 = !DIBasicType(name: "bool", size: 1, encoding: DW_ATE_boolean)
!59 = !{!60}
!60 = !DILocalVariable(name: "c", arg: 2, scope: !54, file: !5, line: 9, type: !58)
!61 = !DILocation(line: 9, column: 8, scope: !54)
!62 = !DILocation(line: 11, column: 14, scope: !63)
!63 = distinct !DILexicalBlock(scope: !54, file: !5, line: 9, column: 21)
!64 = !DILocation(line: 12, column: 16, scope: !63)
!65 = !DILocation(line: 12, column: 20, scope: !63)
!66 = !DILocation(line: 12, column: 27, scope: !63)
!67 = !DILocation(line: 12, column: 39, scope: !63)
!68 = !DILocation(line: 10, column: 5, scope: !63)
!69 = distinct !DISubprogram(name: "bar1", scope: !5, file: !5, line: 16, type: !70, scopeLine: 16, flags: DIFlagStaticMember, spFlags: DISPFlagLocalToUnit | DISPFlagDefinition, unit: !1, retainedNodes: !3)
!70 = !DISubroutineType(types: !71)
!71 = !{!46, !72}
!72 = !DIDerivedType(tag: DW_TAG_pointer_type, name: "*Bar", baseType: !46, size: 64, align: 64)
!73 = !DILocation(line: 17, column: 5, scope: !74)
!74 = distinct !DILexicalBlock(scope: !69, file: !5, line: 16, column: 15)
!75 = distinct !DISubprogram(name: "bar2", scope: !5, file: !5, line: 20, type: !70, scopeLine: 20, flags: DIFlagStaticMember, spFlags: DISPFlagLocalToUnit | DISPFlagDefinition, unit: !1, retainedNodes: !3)
!76 = !DILocation(line: 21, column: 5, scope: !77)
!77 = distinct !DILexicalBlock(scope: !75, file: !5, line: 20, column: 15)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment