// #target: macos-x64 // #debuginfo: yes module test; import foo; import attach; import std::io; fn void foo(int x) { int! a = x; while (try a) { a = 2; } } fn int main(String[] args) { // Case 1: Jump to create_foo Foo* asdf = create_foo(attach::to_scope(), {.flag1 = true}); // Case 2: Ternary jump test(args.len != 0 ? foo::BLACK : foo::WHITE); test2(); return 0; } struct Foo { void* asdf; } fn Foo* create_foo(Attach_Arg attach, Box_Flags flags, String name = {}) { return mem::new(Foo); } bitstruct Box_Flags : ulong { bool flag1; } fn Foo* test(Color color) { io::printn(color); return null; } fn void* test2() { // Case 3: Trailing macro body exit jump @scratch(; Arena* scratch) { void* asdf; return asdf; }; } module foo; import std::io; enum ID_Type : char { NONE, UNIQUE, } struct Id { ulong value; ID_Type type; } macro Id make(type, value) { return Id {.type = type, .value = value}; } macro Id unique() { static char x; return make(ID_Type.UNIQUE, (ulong)&x); } distinct Color = float[<4>]; const Color BLACK = {0, 0, 0, 1}; const Color WHITE = {1, 1, 1, 1}; struct Arena @export { usz cursor; } struct Arena_Cursor @export { Arena* arena; usz cursor; } fn void rewind(Arena* arena, usz pos) @export("arena_rewind") { arena.cursor = pos; } fn Arena_Cursor get_cursor(Arena* arena) @inline => Arena_Cursor {arena, arena.cursor}; fn void restore_cursor(Arena_Cursor cursor) @inline => rewind(cursor.arena, cursor.cursor); fn Arena_Cursor scratch_begin(Arena*[] conflicts) @export("arena_scratch_begin") { static Arena scratch_arena; Arena* arena = &scratch_arena; return arena ? get_cursor(arena) : Arena_Cursor {}; } fn void scratch_end(Arena_Cursor cursor) @inline @export("arena_scratch_end") => restore_cursor(cursor); macro void @scratch(Arena*... conflicts; @body(Arena* arena)) @builtin { Arena_Cursor scratch = scratch_begin(conflicts); defer scratch_end(scratch); @body(scratch.arena); } module attach; enum Attach_Arg_Kind { TOP, } struct Attach_Arg { Attach_Arg_Kind kind; void* box; } fn Attach_Arg to_scope() @inline { return { TOP, null }; } /* #expect: test.ll define void @test.foo(i32 %0) #0 !dbg !16 { entry: %x = alloca i32, align 4 %a = alloca i32, align 4 %a.f = alloca i64, align 8 store i32 %0, ptr %x, align 4 !21 !23 %1 = load i32, ptr %x, align 4, !dbg !24 store i32 %1, ptr %a, align 4, !dbg !24 store i64 0, ptr %a.f, align 8, !dbg !24 br label %loop.cond, !dbg !25 loop.cond: ; preds = %loop.body, %entry %load.err = load i64, ptr %a.f, align 8, !dbg !26 %result = icmp eq i64 %load.err, 0, !dbg !26 br i1 %result, label %loop.body, label %loop.exit, !dbg !26 loop.body: ; preds = %loop.cond store i32 2, ptr %a, align 4, !dbg !28 store i64 0, ptr %a.f, align 8, !dbg !28 br label %loop.cond, !dbg !28 loop.exit: ; preds = %loop.cond ret void, !dbg !28 } ; Function Attrs: nounwind uwtable define i32 @test.main(ptr %0, i64 %1) #0 !dbg !30 { entry: %args = alloca %"char[][]", align 8 %asdf = alloca ptr, align 8 %result = alloca %Attach_Arg, align 8 store ptr %0, ptr %args, align 8 %ptradd = getelementptr inbounds i8, ptr %args, i64 8 store i64 %1, ptr %ptradd, align 8 !47 !53 %2 = call { i32, ptr } @attach.to_scope() store { i32, ptr } %2, ptr %result, align 8 %lo = load i32, ptr %result, align 8, !dbg !55 %ptradd1 = getelementptr inbounds i8, ptr %result, i64 8, !dbg !55 %hi = load ptr, ptr %ptradd1, align 8, !dbg !55 %3 = call ptr @test.create_foo(i32 %lo, ptr %hi, i64 1, ptr null, i64 0), !dbg !57 store ptr %3, ptr %asdf, align 8, !dbg !57 %ptradd2 = getelementptr inbounds i8, ptr %args, i64 8, !dbg !58 %4 = load i64, ptr %ptradd2, align 8, !dbg !58 %neq = icmp ne i64 0, %4, !dbg !58 %ternary = select i1 %neq, <4 x float> , <4 x float> , !dbg !59 %5 = call ptr @test.test(<4 x float> %ternary), !dbg !60 %6 = call ptr @test.test2(), !dbg !61 ret i32 0, !dbg !62 } define ptr @test.create_foo(i32 %0, ptr %1, i64 %2, ptr %3, i64 %4) #0 !dbg !63 { entry: %attach = alloca %Attach_Arg, align 8 %flags = alloca i64, align 8 %name = alloca %"char[]", align 8 store i32 %0, ptr %attach, align 8 %ptradd = getelementptr inbounds i8, ptr %attach, i64 8 store ptr %1, ptr %ptradd, align 8 !67 store i64 %2, ptr %flags, align 8 !69 store ptr %3, ptr %name, align 8 %ptradd1 = getelementptr inbounds i8, ptr %name, i64 8 store i64 %4, ptr %ptradd1, align 8 !71 %5 = call ptr @std.core.mem.calloc(i64 8) ret ptr %5, !dbg !72 } define ptr @test.test(<4 x float> %0) #0 !dbg !76 { entry: %color = alloca <4 x float>, align 16 %x = alloca <4 x float>, align 16 %out = alloca ptr, align 8 %x1 = alloca <4 x float>, align 16 %len = alloca i64, align 8 %error_var = alloca i64, align 8 %out2 = alloca ptr, align 8 %x3 = alloca <4 x float>, align 16 %varargslots = alloca [1 x %any], align 16 %retparam = alloca i64, align 8 %taddr = alloca %any, align 8 %indirectarg = alloca %"any[]", align 8 %error_var5 = alloca i64, align 8 %error_var11 = alloca i64, align 8 store <4 x float> %0, ptr %color, align 16 !85 %1 = load <4 x float>, ptr %color, align 16 store <4 x float> %1, ptr %x, align 16 %2 = call ptr @std.io.stdout(), !dbg !86 store ptr %2, ptr %out, align 8 %3 = load <4 x float>, ptr %x, align 16 store <4 x float> %3, ptr %x1, align 16 !92 %4 = load ptr, ptr %out, align 8 store ptr %4, ptr %out2, align 8 %5 = load <4 x float>, ptr %x1, align 16 store <4 x float> %5, ptr %x3, align 16 %6 = load ptr, ptr %out2, align 8, !dbg !94 %7 = insertvalue %any undef, ptr %6, 0, !dbg !94 %8 = insertvalue %any %7, i64 ptrtoint (ptr @"$ct.std.io.File" to i64), 1, !dbg !94 %9 = insertvalue %any undef, ptr %x3, 0, !dbg !97 %10 = insertvalue %any %9, i64 ptrtoint (ptr @"$ct.foo.Color" to i64), 1, !dbg !97 store %any %10, ptr %varargslots, align 16, !dbg !97 %11 = insertvalue %"any[]" undef, ptr %varargslots, 0, !dbg !97 %"$$temp" = insertvalue %"any[]" %11, i64 1, 1, !dbg !97 store %any %8, ptr %taddr, align 8 %lo = load i64, ptr %taddr, align 8 %ptradd = getelementptr inbounds i8, ptr %taddr, i64 8 %hi = load ptr, ptr %ptradd, align 8 store %"any[]" %"$$temp", ptr %indirectarg, align 8 %12 = call i64 @std.io.fprintf(ptr %retparam, i64 %lo, ptr %hi, ptr @.str, i64 2, ptr byval(%"any[]") align 8 %indirectarg), !dbg !98 %not_err = icmp eq i64 %12, 0, !dbg !98 %13 = call i1 @llvm.expect.i1(i1 %not_err, i1 true), !dbg !98 br i1 %13, label %after_check, label %assign_optional, !dbg !98 assign_optional: ; preds = %entry store i64 %12, ptr %error_var, align 8, !dbg !98 br label %guard_block, !dbg !98 after_check: ; preds = %entry br label %noerr_block, !dbg !98 guard_block: ; preds = %assign_optional br label %voiderr, !dbg !98 noerr_block: ; preds = %after_check %14 = load i64, ptr %retparam, align 8, !dbg !98 store i64 %14, ptr %len, align 8, !dbg !98 %15 = load ptr, ptr %out, align 8, !dbg !99 %16 = call i64 @std.io.File.write_byte(ptr %15, i8 zeroext 10), !dbg !100 %not_err6 = icmp eq i64 %16, 0, !dbg !100 %17 = call i1 @llvm.expect.i1(i1 %not_err6, i1 true), !dbg !100 br i1 %17, label %after_check8, label %assign_optional7, !dbg !100 assign_optional7: ; preds = %noerr_block store i64 %16, ptr %error_var5, align 8, !dbg !100 br label %guard_block9, !dbg !100 after_check8: ; preds = %noerr_block br label %noerr_block10, !dbg !100 guard_block9: ; preds = %assign_optional7 br label %voiderr, !dbg !100 noerr_block10: ; preds = %after_check8 %18 = load ptr, ptr %out, align 8, !dbg !101 %19 = call i64 @std.io.File.flush(ptr %18), !dbg !101 %not_err12 = icmp eq i64 %19, 0, !dbg !101 %20 = call i1 @llvm.expect.i1(i1 %not_err12, i1 true), !dbg !101 br i1 %20, label %after_check14, label %assign_optional13, !dbg !101 assign_optional13: ; preds = %noerr_block10 store i64 %19, ptr %error_var11, align 8, !dbg !101 br label %guard_block15, !dbg !101 after_check14: ; preds = %noerr_block10 br label %noerr_block16, !dbg !101 guard_block15: ; preds = %assign_optional13 br label %voiderr, !dbg !101 noerr_block16: ; preds = %after_check14 %21 = load i64, ptr %len, align 8, !dbg !102 %add = add i64 %21, 1, !dbg !102 br label %voiderr, !dbg !93 voiderr: ; preds = %noerr_block16, %guard_block15, %guard_block9, %guard_block ret ptr null, !dbg !103 } define ptr @test.test2() #0 !dbg !104 { entry: %conflicts = alloca %"Arena*[]", align 8 %scratch = alloca %Arena_Cursor, align 8 %result = alloca %Arena_Cursor, align 8 %scratch1 = alloca ptr, align 8 %asdf = alloca ptr, align 8 store %"Arena*[]" zeroinitializer, ptr %conflicts, align 8 !117 %lo = load ptr, ptr %conflicts, align 8, !dbg !119 %ptradd = getelementptr inbounds i8, ptr %conflicts, i64 8, !dbg !119 %hi = load i64, ptr %ptradd, align 8, !dbg !119 %0 = call { ptr, i64 } @arena_scratch_begin(ptr %lo, i64 %hi), !dbg !120 store { ptr, i64 } %0, ptr %result, align 8 call void @llvm.memcpy.p0.p0.i32(ptr align 8 %scratch, ptr align 8 %result, i32 16, i1 false) !122 %1 = load ptr, ptr %scratch, align 8, !dbg !123 store ptr %1, ptr %scratch1, align 8, !dbg !123 !127 store ptr null, ptr %asdf, align 8, !dbg !127 %2 = load ptr, ptr %asdf, align 8, !dbg !128 %lo2 = load ptr, ptr %scratch, align 8, !dbg !129 %ptradd3 = getelementptr inbounds i8, ptr %scratch, i64 8, !dbg !129 %hi4 = load i64, ptr %ptradd3, align 8, !dbg !129 call void @arena_scratch_end(ptr %lo2, i64 %hi4) ret ptr %2, !dbg !131 } define i32 @main(i32 %0, ptr %1) #0 !dbg !132 { entry: %.anon = alloca i32, align 4 %.anon1 = alloca ptr, align 8 %argc = alloca i32, align 4 %argv = alloca ptr, align 8 %blockret = alloca i32, align 4 %list = alloca %"char[][]", align 8 %argc2 = alloca i32, align 4 %argv3 = alloca ptr, align 8 %list5 = alloca %"char[][]", align 8 %elements = alloca i64, align 8 %allocator = alloca %any, align 8 %elements6 = alloca i64, align 8 %error_var = alloca i64, align 8 %allocator7 = alloca %any, align 8 %elements8 = alloca i64, align 8 %allocator10 = alloca %any, align 8 %size = alloca i64, align 8 %blockret11 = alloca ptr, align 8 %.inlinecache = alloca ptr, align 8 %.cachedtype = alloca ptr, align 8 %retparam = alloca ptr, align 8 %taddr = alloca ptr, align 8 %varargslots = alloca [1 x %any], align 16 %indirectarg = alloca %"any[]", align 8 %i = alloca i32, align 4 %arg = alloca ptr, align 8 %len = alloca i64, align 8 %ptr = alloca ptr, align 8 %len18 = alloca i64, align 8 store ptr null, ptr %.cachedtype, align 8 store i32 %0, ptr %.anon, align 4 !137 store ptr %1, ptr %.anon1, align 8 !137 %2 = load i32, ptr %.anon, align 4 store i32 %2, ptr %argc, align 4 %3 = load ptr, ptr %.anon1, align 8 store ptr %3, ptr %argv, align 8 !142 %4 = load i32, ptr %argc, align 4 store i32 %4, ptr %argc2, align 4 %5 = load ptr, ptr %argv, align 8 store ptr %5, ptr %argv3, align 8 !145 %6 = load i32, ptr %argc2, align 4, !dbg !147 %sext = sext i32 %6 to i64, !dbg !147 store i64 %sext, ptr %elements, align 8 call void @llvm.memcpy.p0.p0.i32(ptr align 8 %allocator, ptr align 8 @std.core.mem.allocator.thread_allocator, i32 16, i1 false) %7 = load i64, ptr %elements, align 8 store i64 %7, ptr %elements6, align 8 call void @llvm.memcpy.p0.p0.i32(ptr align 8 %allocator7, ptr align 8 %allocator, i32 16, i1 false) %8 = load i64, ptr %elements6, align 8 store i64 %8, ptr %elements8, align 8 call void @llvm.memcpy.p0.p0.i32(ptr align 8 %allocator10, ptr align 8 %allocator7, i32 16, i1 false) %9 = load i64, ptr %elements8, align 8, !dbg !148 %mul = mul i64 16, %9, !dbg !156 store i64 %mul, ptr %size, align 8 %10 = load i64, ptr %size, align 8, !dbg !157 %not = icmp eq i64 %10, 0, !dbg !157 br i1 %not, label %if.then, label %if.exit, !dbg !157 if.then: ; preds = %entry store ptr null, ptr %blockret11, align 8, !dbg !160 br label %expr_block.exit, !dbg !160 if.exit: ; preds = %entry %ptradd = getelementptr inbounds i8, ptr %allocator10, i64 8, !dbg !161 %11 = load i64, ptr %ptradd, align 8, !dbg !161 %12 = inttoptr i64 %11 to ptr, !dbg !161 %type = load ptr, ptr %.cachedtype, align 8 %13 = icmp eq ptr %12, %type br i1 %13, label %cache_hit, label %cache_miss cache_miss: ; preds = %if.exit %ptradd12 = getelementptr inbounds i8, ptr %12, i64 16 %14 = load ptr, ptr %ptradd12, align 8 %15 = call ptr @.dyn_search(ptr %14, ptr @"$sel.acquire") store ptr %15, ptr %.inlinecache, align 8 store ptr %12, ptr %.cachedtype, align 8 br label %16 cache_hit: ; preds = %if.exit %cache_hit_fn = load ptr, ptr %.inlinecache, align 8 br label %16 16: ; preds = %cache_hit, %cache_miss %fn_phi = phi ptr [ %cache_hit_fn, %cache_hit ], [ %15, %cache_miss ] %17 = icmp eq ptr %fn_phi, null br i1 %17, label %missing_function, label %match missing_function: ; preds = %16 %18 = load ptr, ptr @std.core.builtin.panic, align 8, !dbg !163 call void %18(ptr @.panic_msg, i64 44, ptr @.file, i64 16, ptr @.func, i64 6, i32 68), !dbg !163 unreachable, !dbg !163 match: ; preds = %16 %19 = load ptr, ptr %allocator10, align 8 %20 = load i64, ptr %size, align 8 %21 = call i64 %fn_phi(ptr %retparam, ptr %19, i64 %20, i32 0, i64 0), !dbg !163 %not_err = icmp eq i64 %21, 0, !dbg !163 %22 = call i1 @llvm.expect.i1(i1 %not_err, i1 true), !dbg !163 br i1 %22, label %after_check, label %assign_optional, !dbg !163 assign_optional: ; preds = %match store i64 %21, ptr %error_var, align 8, !dbg !163 br label %panic_block, !dbg !163 after_check: ; preds = %match %23 = load ptr, ptr %retparam, align 8, !dbg !163 store ptr %23, ptr %blockret11, align 8, !dbg !163 br label %expr_block.exit, !dbg !163 expr_block.exit: ; preds = %after_check, %if.then %24 = load ptr, ptr %blockret11, align 8, !dbg !163 store ptr %24, ptr %taddr, align 8 %25 = load ptr, ptr %taddr, align 8 %26 = load i64, ptr %elements8, align 8, !dbg !164 %add = add i64 0, %26, !dbg !164 %size13 = sub i64 %add, 0, !dbg !164 %27 = insertvalue %"char[][]" undef, ptr %25, 0, !dbg !164 %28 = insertvalue %"char[][]" %27, i64 %size13, 1, !dbg !164 br label %noerr_block, !dbg !164 panic_block: ; preds = %assign_optional %29 = insertvalue %any undef, ptr %error_var, 0, !dbg !164 %30 = insertvalue %any %29, i64 ptrtoint (ptr @"$ct.anyfault" to i64), 1, !dbg !164 store %any %30, ptr %varargslots, align 16 %31 = insertvalue %"any[]" undef, ptr %varargslots, 0 %"$$temp" = insertvalue %"any[]" %31, i64 1, 1 store %"any[]" %"$$temp", ptr %indirectarg, align 8 call void @std.core.builtin.panicf(ptr @.panic_msg.1 unreachable, !dbg !151 noerr_block: ; preds = %expr_block.exit store %"char[][]" %28, ptr %list5, align 8, !dbg !151 !167 store i32 0, ptr %i, align 4, !dbg !168 br label %loop.cond, !dbg !168 loop.cond: ; preds = %loop.exit, %noerr_block %32 = load i32, ptr %i, align 4, !dbg !169 %33 = load i32, ptr %argc2, align 4, !dbg !170 %lt = icmp slt i32 %32, %33, !dbg !169 br i1 %lt, label %loop.body, label %loop.exit26, !dbg !169 loop.body: ; preds = %loop.cond !173 %34 = load ptr, ptr %argv3, align 8, !dbg !174 %35 = load i32, ptr %i, align 4, !dbg !175 %sext14 = sext i32 %35 to i64, !dbg !175 %ptroffset = getelementptr inbounds [8 x i8], ptr %34, i64 %sext14, !dbg !175 %36 = load ptr, ptr %ptroffset, align 8, !dbg !175 store ptr %36, ptr %arg, align 8, !dbg !175 !177 store i64 0, ptr %len, align 8, !dbg !178 %37 = load ptr, ptr %list5, align 8, !dbg !179 %38 = load i32, ptr %i, align 4, !dbg !180 %sext15 = sext i32 %38 to i64, !dbg !180 %ptroffset16 = getelementptr inbounds [16 x i8], ptr %37, i64 %sext15, !dbg !180 %39 = load ptr, ptr %arg, align 8, !dbg !181 %40 = load ptr, ptr %arg, align 8 store ptr %40, ptr %ptr, align 8 !184 store i64 0, ptr %len18, align 8, !dbg !186 br label %loop.cond19, !dbg !187 loop.cond19: ; preds = %loop.body21, %loop.body %41 = load ptr, ptr %ptr, align 8, !dbg !188 %42 = load i64, ptr %len18, align 8, !dbg !190 %ptradd20 = getelementptr inbounds i8, ptr %41, i64 %42, !dbg !190 %43 = load i8, ptr %ptradd20, align 1, !dbg !190 %intbool = icmp ne i8 %43, 0, !dbg !190 br i1 %intbool, label %loop.body21, label %loop.exit, !dbg !190 loop.body21: ; preds = %loop.cond19 %44 = load i64, ptr %len18, align 8, !dbg !191 %add22 = add i64 %44, 1, !dbg !191 store i64 %add22, ptr %len18, align 8, !dbg !191 br label %loop.cond19, !dbg !191 loop.exit: ; preds = %loop.cond19 %45 = load i64, ptr %len18, align 8, !dbg !192 %add23 = add i64 0, %45, !dbg !192 %size24 = sub i64 %add23, 0, !dbg !192 %46 = insertvalue %"char[]" undef, ptr %39, 0, !dbg !192 %47 = insertvalue %"char[]" %46, i64 %size24, 1, !dbg !192 store %"char[]" %47, ptr %ptroffset16, align 8, !dbg !192 %48 = load i32, ptr %i, align 4, !dbg !193 %add25 = add i32 %48, 1, !dbg !193 store i32 %add25, ptr %i, align 4, !dbg !193 br label %loop.cond, !dbg !193 loop.exit26: ; preds = %loop.cond call void @llvm.memcpy.p0.p0.i32(ptr align 8 %list, ptr align 8 %list5, i32 16, i1 false), !dbg !194 %lo = load ptr, ptr %list, align 8, !dbg !195 %ptradd27 = getelementptr inbounds i8, ptr %list, i64 8, !dbg !195 %hi = load i64, ptr %ptradd27, align 8, !dbg !195 %49 = call i32 @test.main(ptr %lo, i64 %hi), !dbg !196 store i32 %49, ptr %blockret, align 4, !dbg !196 %50 = load ptr, ptr %list, align 8, !dbg !197 call void @std.core.mem.free(ptr %50) br label %expr_block.exit28, !dbg !199 expr_block.exit28: ; preds = %loop.exit26 %51 = load i32, ptr %blockret, align 4, !dbg !199 ret i32 %51, !dbg !199 } declare { i32, ptr } @attach.to_scope() #0 declare ptr @std.core.mem.calloc(i64) #0 declare ptr @std.io.stdout() #0 declare i64 @std.io.fprintf(ptr, i64, ptr, ptr, i64, ptr byval(%"any[]") align 8) #0 declare i1 @llvm.expect.i1(i1, i1) declare i64 @std.io.File.write_byte(ptr, i8 zeroext) #0 declare i64 @std.io.File.flush(ptr) #0 declare { ptr, i64 } @arena_scratch_begin(ptr, i64) #0 declare void @llvm.memcpy.p0.p0.i32(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i32, i1 immarg) declare void @arena_scratch_end(ptr, i64) #0 define weak_odr ptr @.dyn_search(ptr %0, ptr %1) unnamed_addr { entry: br label %check check: ; preds = %no_match, %entry %2 = phi ptr [ %0, %entry ], [ %9, %no_match ] %3 = icmp eq ptr %2, null br i1 %3, label %missing_function, label %compare missing_function: ; preds = %check ret ptr null compare: ; preds = %check %4 = getelementptr inbounds { ptr, ptr, ptr }, ptr %2, i32 0, i32 1 %5 = load ptr, ptr %4, align 8 %6 = icmp eq ptr %5, %1 br i1 %6, label %match, label %no_match match: ; preds = %compare %7 = load ptr, ptr %2, align 8 ret ptr %7 no_match: ; preds = %compare %8 = getelementptr inbounds { ptr, ptr, ptr }, ptr %2, i32 0, i32 2 %9 = load ptr, ptr %8, align 8 br label %check } !llvm.dbg.cu = !{!4} !0 = !{i32 2, !"Dwarf Version", i32 4} !1 = !{i32 2, !"Debug Info Version", i32 3} !2 = !{i32 2, !"frame-pointer", i32 2} !3 = !{i32 1, !"uwtable", i32 2} !6 = !{!7} !7 = !DICompositeType(tag: DW_TAG_enumeration_type, name: "Attach_Arg_Kind", scope: !8, file: !5, line: 116, baseType: !13, size: 32, align: 32, elements: !14) !8 = !DICompositeType(tag: DW_TAG_structure_type, name: "Attach_Arg", scope: !5, file: !5, line: 120, size: 128, align: 64, elements: !9, identifier: "attach.Attach_Arg") !9 = !{!10, !11} !10 = !DIDerivedType(tag: DW_TAG_member, name: "kind", scope: !8, file: !5, line: 121, baseType: !7, size: 32, align: 32) !11 = !DIDerivedType(tag: DW_TAG_member, name: "box", scope: !8, file: !5, line: 122, baseType: !12, size: 64, align: 64, offset: 64) !12 = !DIDerivedType(tag: DW_TAG_pointer_type, name: "void*", baseType: null, size: 64, align: 64, dwarfAddressSpace: 0) !13 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed) !14 = !{!15} !15 = !DIEnumerator(name: "TOP", value: 0) !16 = distinct !DISubprogram(name: "foo", linkageName: "test.foo", scope: !5, file: !5, line: 6, type: !17, scopeLine: 6, flags: DIFlagPrototyped, spFlags: DISPFlagDefinition !17 = !DISubroutineType(types: !18) !18 = !{null, !13} !19 = !{} !20 = !DILocalVariable(name: "x", arg: 1, scope: !16, file: !5, line: 6, type: !13) !21 = !DILocation(line: 6, column: 17, scope: !16) !22 = !DILocalVariable(name: "a", scope: !16, file: !5, line: 8, type: !13, align: 4) !23 = !DILocation(line: 8, column: 7, scope: !16) !24 = !DILocation(line: 8, column: 11, scope: !16) !25 = !DILocation(line: 9, column: 2, scope: !16) !26 = !DILocation(line: 9, column: 9, scope: !27) !27 = distinct !DILexicalBlock(scope: !16, file: !5, line: 9, column: 2) !28 = !DILocation(line: 11, column: 7, scope: !29) !29 = distinct !DILexicalBlock(scope: !27, file: !5, line: 10, column: 2) !30 = distinct !DISubprogram(name: "main", linkageName: "test.main", scope: !5, file: !5, line: 15, type: !31, scopeLine: 15, flags: DIFlagPrototyped, spFlags: DISPFlagDefinition !31 = !DISubroutineType(types: !32) !32 = !{!13, !33} !33 = !DICompositeType(tag: DW_TAG_structure_type, name: "String[]", size: 128, align: 64, elements: !34, identifier: "String[]") !34 = !{!35, !45} !35 = !DIDerivedType(tag: DW_TAG_member, name: "ptr", scope: !33, baseType: !36, size: 64, align: 64) !36 = !DIDerivedType(tag: DW_TAG_pointer_type, name: "String*", baseType: !37, size: 64, align: 64, dwarfAddressSpace: 0) !37 = !DIDerivedType(tag: DW_TAG_typedef, name: "String", scope: !5, file: !5, line: 1, baseType: !38, align: 8) !38 = !DICompositeType(tag: DW_TAG_structure_type, name: "char[]", size: 128, align: 64, elements: !39, identifier: "char[]") !39 = !{!40, !43} !40 = !DIDerivedType(tag: DW_TAG_member, name: "ptr", scope: !38, baseType: !41, size: 64, align: 64) !41 = !DIDerivedType(tag: DW_TAG_pointer_type, name: "char*", baseType: !42, size: 64, align: 64, dwarfAddressSpace: 0) !42 = !DIBasicType(name: "char", size: 8, encoding: DW_ATE_unsigned_char) !43 = !DIDerivedType(tag: DW_TAG_member, name: "len", scope: !38, baseType: !44, size: 64, align: 64, offset: 64) !44 = !DIBasicType(name: "ulong", size: 64, encoding: DW_ATE_unsigned) !45 = !DIDerivedType(tag: DW_TAG_member, name: "len", scope: !33, baseType: !44, size: 64, align: 64, offset: 64) !46 = !DILocalVariable(name: "args", arg: 1, scope: !30, file: !5, line: 15, type: !33) !47 = !DILocation(line: 15, column: 22, scope: !30) !48 = !DILocalVariable(name: "asdf", scope: !30, file: !5, line: 18, type: !49, align: 8) !49 = !DIDerivedType(tag: DW_TAG_pointer_type, name: "Foo*", baseType: !50, size: 64, align: 64, dwarfAddressSpace: 0) !50 = !DICompositeType(tag: DW_TAG_structure_type, name: "Foo", scope: !5, file: !5, line: 27, size: 64, align: 64, elements: !51, identifier: "test.Foo") !51 = !{!52} !52 = !DIDerivedType(tag: DW_TAG_member, name: "asdf", scope: !50, file: !5, line: 28, baseType: !12, size: 64, align: 64) !53 = !DILocation(line: 18, column: 8, scope: !30) !54 = !DILocation(line: 18, column: 34, scope: !30) !55 = !DILocation(line: 33, column: 70, scope: !56, inlinedAt: !57) !56 = distinct !DISubprogram(name: "[DEFAULT INIT]", linkageName: "[DEFAULT INIT]", scope: !5, file: !5, line: 33, scopeLine: 33, spFlags: DISPFlagLocalToUnit | DISPFlagDefinition !57 = !DILocation(line: 18, column: 15, scope: !30) !58 = !DILocation(line: 21, column: 8, scope: !30) !59 = !DILocation(line: 21, column: 42, scope: !30) !60 = !DILocation(line: 21, column: 3, scope: !30) !61 = !DILocation(line: 23, column: 3, scope: !30) !62 = !DILocation(line: 24, column: 10, scope: !30) !63 = distinct !DISubprogram(name: "create_foo", linkageName: "test.create_foo", scope: !5, file: !5, line: 33, type: !64, scopeLine: 33, flags: DIFlagPrototyped, spFlags: DISPFlagDefinition !64 = !DISubroutineType(types: !65) !65 = !{!49, !8, !44, !37} !66 = !DILocalVariable(name: "attach", arg: 1, scope: !63, file: !5, line: 33, type: !8) !67 = !DILocation(line: 33, column: 31, scope: !63) !68 = !DILocalVariable(name: "flags", arg: 2, scope: !63, file: !5, line: 33, type: !44) !69 = !DILocation(line: 33, column: 49, scope: !63) !70 = !DILocalVariable(name: "name", arg: 3, scope: !63, file: !5, line: 33, type: !37) !71 = !DILocation(line: 33, column: 63, scope: !63) !72 = !DILocation(line: !73 = distinct !DISubprogram(name: "new", linkageName: "new", scope: !74, file: !74 !75 = !DILocation(line: 34, column: 15, scope: !63) !76 = distinct !DISubprogram(name: "test", linkageName: "test.test", scope: !5, file: !5, line: 41, type: !77, scopeLine: 41, flags: DIFlagPrototyped, spFlags: DISPFlagDefinition !77 = !DISubroutineType(types: !78) !78 = !{!49, !79} !79 = !DIDerivedType(tag: DW_TAG_typedef, name: "Color", scope: !5, file: !5, line: 79, baseType: !80, align: 16) !80 = !DICompositeType(tag: DW_TAG_array_type, baseType: !81, size: 128, align: 32, flags: DIFlagVector, elements: !82) !81 = !DIBasicType(name: "float", size: 32, encoding: DW_ATE_float) !82 = !{!83} !83 = !DISubrange(count: 4, lowerBound: 0) !84 = !DILocalVariable(name: "color", arg: 1, scope: !76, file: !5, line: 41, type: !79) !85 = !DILocation(line: 41, column: 20, scope: !76) !86 = !DILocation(line: 151, column: 20, scope: !87, inlinedAt: !89) !87 = distinct !DISubprogram(name: "printn", linkageName: "printn", scope: !88, file: !88, line: 149, scopeLine: 149, spFlags: DISPFlagLocalToUnit | DISPFlagDefinition !88 = !DIFile(filename: !89 = !DILocation(line: 42, column: 7, scope: !76) !90 = !DILocalVariable(name: "len", scope: !91, file: !5, line: 133, type: !44, align: 8) !91 = distinct !DISubprogram(name: "fprintn", linkageName: "fprintn", scope: !88, file: !88, line: 131, scopeLine: 131, spFlags: DISPFlagLocalToUnit | DISPFlagDefinition, !92 = !DILocation(line: 133, column: 6, scope: !91, inlinedAt: !93) !93 = !DILocation(line: 151, column: 2, scope: !87, inlinedAt: !89) !94 = !DILocation(line: 106, column: 19, scope: !95, inlinedAt: !96) !95 = distinct !DISubprogram(name: "fprint", linkageName: "fprint", scope: !88, file: !88, line: 92, scopeLine: 92, spFlags: DISPFlagLocalToUnit | DISPFlagDefinition !96 = !DILocation(line: 133, column: 12, scope: !91, inlinedAt: !93) !97 = !DILocation(line: 106, column: 30, scope: !95, inlinedAt: !96) !98 = !DILocation(line: 106, column: 11, scope: !95, inlinedAt: !96) !99 = !DILocation(line: 134, column: 17, scope: !91, inlinedAt: !93) !100 = !DILocation(line: 134, column: 2, scope: !91, inlinedAt: !93) !101 = !DILocation(line: 139, column: 4, scope: !91, inlinedAt: !93) !102 = !DILocation(line: 141, column: 9, scope: !91, inlinedAt: !93) !103 = !DILocation(line: 45, column: 10, scope: !76) !104 = distinct !DISubprogram(name: "test2", linkageName: "test.test2", scope: !5, file: !5, line: 48, type: !105, scopeLine: 48, flags: DIFlagPrototyped, spFlags: DISPFlagDefinition !105 = !DISubroutineType(types: !106) !106 = !{!12} !107 = !DILocalVariable(name: "scratch", scope: !108, file: !5, line: 110, type: !109, align: 8) !108 = distinct !DISubprogram(name: "@scratch", linkageName: "@scratch", scope: !5, file: !5, line: 109, scopeLine: 109, spFlags: DISPFlagLocalToUnit | DISPFlagDefinition, unit: !109 = !DICompositeType(tag: DW_TAG_structure_type, name: "Arena_Cursor", scope: !5, file: !5, line: 88, size: 128, align: 64, elements: !110, identifier: "foo__Arena_Cursor") !110 = !{!111, !116} !111 = !DIDerivedType(tag: DW_TAG_member, name: "arena", scope: !109, file: !5, line: 89, baseType: !112, size: 64, align: 64) !112 = !DIDerivedType(tag: DW_TAG_pointer_type, name: "Arena*", baseType: !113, size: 64, align: 64, dwarfAddressSpace: 0) !113 = !DICompositeType(tag: DW_TAG_structure_type, name: "Arena", scope: !5, file: !5, line: 84, size: 64, align: 64, elements: !114, identifier: "foo__Arena") !114 = !{!115} !115 = !DIDerivedType(tag: DW_TAG_member, name: "cursor", scope: !113, file: !5, line: 85, baseType: !44, size: 64, align: 64) !116 = !DIDerivedType(tag: DW_TAG_member, name: "cursor", scope: !109, file: !5, line: 90, baseType: !44, size: 64, align: 64, offset: 64) !117 = !DILocation(line: 110, column: 16, scope: !108, inlinedAt: !118) !118 = !DILocation(line: 50, column: 3, scope: !104) !119 = !DILocation(line: 110, column: 40, scope: !108, inlinedAt: !118) !120 = !DILocation(line: 110, column: 26, scope: !108, inlinedAt: !118) !121 = !DILocalVariable(name: "scratch", scope: !104, file: !5, line: 50, type: !112, align: 8) !122 = !DILocation(line: 50, column: 21, scope: !104) !123 = !DILocation(line: 112, column: 9, scope: !124, inlinedAt: !118) !124 = distinct !DILexicalBlock(scope: !108, file: !5, line: 112, column: 3) !125 = !DILocalVariable(name: "asdf", scope: !126, file: !5, line: 51, type: !12, align: 8) !126 = distinct !DILexicalBlock(scope: !104, file: !5, line: 50, column: 30) !127 = !DILocation(line: 51, column: 11, scope: !126) !128 = !DILocation(line: 52, column: 12, scope: !126) !129 = !DILocation(line: 111, column: 21, scope: !130, inlinedAt: !118) !130 = distinct !DILexicalBlock(scope: !108, file: !5, line: 111, column: 9) !131 = !DILocation(line: 111, column: 9, scope: !130, inlinedAt: !118) !132 = distinct !DISubprogram(name: "_$main", linkageName: "main", scope: !5, file: !5, line: 15, type: !133, scopeLine: 15, flags: DIFlagPrototyped, spFlags: DISPFlagDefinition !133 = !DISubroutineType(types: !134) !134 = !{!13, !13, !135} !135 = !DIDerivedType(tag: DW_TAG_pointer_type, name: "char**", baseType: !41, size: 64, align: 64 !136 = !DILocalVariable(name: ".anon", arg: 1, scope: !132, file: !5, line: 15, type: !13) !137 = !DILocation(line: 15, column: 8, scope: !132) !138 = !DILocalVariable(name: ".anon", arg: 2, scope: !132, file: !5, line: 15, type: !135) !139 = !DILocalVariable(name: "list", scope: !140, file: !5, line: 45, type: !33, align: 8) !142 = !DILocation(line: 45, column: 11, scope: !140, inlinedAt: !137) !143 = !DILocalVariable(name: "list", scope: !144, file: !5, line: 24, type: !33, align: 8) !145 = !DILocation(line: 24, column: 11, scope: !144, inlinedAt: !146) !146 = !DILocation(line: 45, column: 18, scope: !140, inlinedAt: !137) !147 = !DILocation(line: 24, column: 43, scope: !144, inlinedAt: !146) !148 = !DILocation(line: 277, column: 55, scope: !149, inlinedAt: !151) !149 = distinct !DISubprogram(name: "alloc_array_try", linkageName: "alloc_array_try", scope: !150, file: !150, line: 275, scopeLine: 275, spFlags: DISPFlagLocalToUnit | DISPFlagDefinition !150 = !DIFile(filename: "mem_allocator.c3", !151 = !DILocation(line: 269, column: 9, scope: !152, inlinedAt: !153) !152 = distinct !DISubprogram(name: "alloc_array", linkageName: "alloc_array", scope: !150, file: !150, line: 267, scopeLine: 267, spFlags: DISPFlagLocalToUnit | DISPFlagDefinition !153 = !DILocation(line: 688, column: 20, scope: !154, inlinedAt: !155) !154 = distinct !DISubprogram(name: "alloc_array", linkageName: "alloc_array", scope: !74, file: !74, line: 686, scopeLine: 686, spFlags: DISPFlagLocalToUnit | DISPFlagDefinition !155 = !DILocation(line: 24, column: 23, scope: !144, inlinedAt: !146) !156 = !DILocation(line: 277, column: 40, scope: !149, inlinedAt: !151) !157 = !DILocation(line: 62, column: 7, scope: !158, inlinedAt: !159) !158 = distinct !DISubprogram(name: "malloc_try", linkageName: "malloc_try", scope: !150, file: !150, line: 60, scopeLine: 60, spFlags: DISPFlagLocalToUnit | DISPFlagDefinition !159 = !DILocation(line: 277, column: 10, scope: !149, inlinedAt: !151) !160 = !DILocation(line: 62, column: 20, scope: !158, inlinedAt: !159) !161 = !DILocation(line: 28, column: 71, scope: !162, inlinedAt: !163) !162 = distinct !DISubprogram(name: "[DEFAULT INIT]", linkageName: "[DEFAULT INIT]", scope: !150, file: !150, line: 28, scopeLine: 28, spFlags: DISPFlagLocalToUnit | DISPFlagDefinition !163 = !DILocation(line: 68, column: 10, scope: !158, inlinedAt: !159) !164 = !DILocation(line: 277, column: 67, scope: !149, inlinedAt: !151) !165 = !DILocalVariable(name: "i", scope: !166, file: !5, line: 25, type: !13, align: 4) !166 = distinct !DILexicalBlock(scope: !144, file: !141, line: 25, column: 2) !167 = !DILocation(line: 25, column: 11, scope: !166, inlinedAt: !146) !168 = !DILocation(line: 25, column: 15, scope: !166, inlinedAt: !146) !169 = !DILocation(line: 25, column: 18, scope: !166, inlinedAt: !146) !170 = !DILocation(line: 25, column: 22, scope: !166, inlinedAt: !146) !171 = !DILocalVariable(name: "arg", scope: !172, file: !5, line: 27, type: !41, align: 8) !172 = distinct !DILexicalBlock(scope: !166, file: !141, line: 26, column: 2) !173 = !DILocation(line: 27, column: 9, scope: !172, inlinedAt: !146) !174 = !DILocation(line: 27, column: 15, scope: !172, inlinedAt: !146) !175 = !DILocation(line: 27, column: 20, scope: !172, inlinedAt: !146) !176 = !DILocalVariable(name: "len", scope: !172, file: !5, line: 28, type: !44, align: 8) !177 = !DILocation(line: 28, column: 7, scope: !172, inlinedAt: !146) !178 = !DILocation(line: 28, column: 13, scope: !172, inlinedAt: !146) !179 = !DILocation(line: 29, column: 3, scope: !172, inlinedAt: !146) !180 = !DILocation(line: 29, column: 8, scope: !172, inlinedAt: !146) !181 = !DILocation(line: 29, column: 21, scope: !172, inlinedAt: !146) !182 = !DILocalVariable(name: "len", scope: !183, file: !5, line: 5, type: !44, align: 8) !183 = distinct !DISubprogram(name: "_strlen", linkageName: "_strlen", scope: !141, file: !141, line: 3, scopeLine: 3, spFlags: DISPFlagLocalToUnit | DISPFlagDefinition !184 = !DILocation(line: 5, column: 6, scope: !183, inlinedAt: !185) !185 = !DILocation(line: 29, column: 26, scope: !172, inlinedAt: !146) !186 = !DILocation(line: 5, column: 12, scope: !183, inlinedAt: !185) !187 = !DILocation(line: 6, column: 2, scope: !183, inlinedAt: !185) !188 = !DILocation(line: 6, column: 9, scope: !189, inlinedAt: !185) !189 = distinct !DILexicalBlock(scope: !183, file: !141, line: 6, column: 2) !190 = !DILocation(line: 6, column: 13, scope: !189, inlinedAt: !185) !191 = !DILocation(line: 6, column: 19, scope: !189, inlinedAt: !185) !192 = !DILocation(line: 7, column: 9, scope: !183, inlinedAt: !185) !193 = !DILocation(line: 25, column: 28, scope: !166, inlinedAt: !146) !194 = !DILocation(line: 31, column: 9, scope: !144, inlinedAt: !146) !195 = !DILocation(line: 47, column: 12, scope: !140, inlinedAt: !137) !196 = !DILocation(line: 47, column: 9, scope: !140, inlinedAt: !137) !197 = !DILocation(line: 46, column: 13, scope: !198, inlinedAt: !137) !198 = distinct !DILexicalBlock(scope: !140, file: !141, line: 46, column: 8) !199 = !DILocation(line: 46, column: 8, scope: !198, inlinedAt: !137)