# __attribute__((always_inline)) # int doStuff2(int val) { # int foo = 3; # return val + foo; # } # __attribute__((always_inline)) # int doStuff2Same(int val) { # int foo = 3; # return val + foo; # } # # int foo(int val) { # return doStuff2Same(val) + doStuff2(val); # } # clang++ -ffunction-sections -g2 -gdwarf-5 -gsplit-dwarf .text .file "helper.cpp" .section .text._Z8doStuff2i,"ax",@progbits .globl _Z8doStuff2i # -- Begin function _Z8doStuff2i .p2align 4, 0x90 .type _Z8doStuff2i,@function _Z8doStuff2i: # @_Z8doStuff2i .Lfunc_begin0: .file 0 "." "helper.cpp" md5 0xf7f6e64a58e78e3af8b3db5e5cae6221 .loc 0 2 0 # helper.cpp:2:0 .cfi_startproc # %bb.0: # %entry pushq %rbp .cfi_def_cfa_offset 16 .cfi_offset %rbp, -16 movq %rsp, %rbp .cfi_def_cfa_register %rbp movl %edi, -4(%rbp) .Ltmp0: .loc 0 3 7 prologue_end # helper.cpp:3:7 movl $3, -8(%rbp) .loc 0 4 10 # helper.cpp:4:10 movl -4(%rbp), %eax .loc 0 4 14 is_stmt 0 # helper.cpp:4:14 addl -8(%rbp), %eax .loc 0 4 3 epilogue_begin # helper.cpp:4:3 popq %rbp .cfi_def_cfa %rsp, 8 retq .Ltmp1: .Lfunc_end0: .size _Z8doStuff2i, .Lfunc_end0-_Z8doStuff2i .cfi_endproc # -- End function .section .text._Z12doStuff2Samei,"ax",@progbits .globl _Z12doStuff2Samei # -- Begin function _Z12doStuff2Samei .p2align 4, 0x90 .type _Z12doStuff2Samei,@function _Z12doStuff2Samei: # @_Z12doStuff2Samei .Lfunc_begin1: .loc 0 7 0 is_stmt 1 # helper.cpp:7:0 .cfi_startproc # %bb.0: # %entry pushq %rbp .cfi_def_cfa_offset 16 .cfi_offset %rbp, -16 movq %rsp, %rbp .cfi_def_cfa_register %rbp movl %edi, -4(%rbp) .Ltmp2: .loc 0 8 7 prologue_end # helper.cpp:8:7 movl $3, -8(%rbp) .loc 0 9 12 # helper.cpp:9:12 movl -4(%rbp), %eax .loc 0 9 16 is_stmt 0 # helper.cpp:9:16 addl -8(%rbp), %eax .loc 0 9 5 epilogue_begin # helper.cpp:9:5 popq %rbp .cfi_def_cfa %rsp, 8 retq .Ltmp3: .Lfunc_end1: .size _Z12doStuff2Samei, .Lfunc_end1-_Z12doStuff2Samei .cfi_endproc # -- End function .section .text._Z3fooi,"ax",@progbits .globl _Z3fooi # -- Begin function _Z3fooi .p2align 4, 0x90 .type _Z3fooi,@function _Z3fooi: # @_Z3fooi .Lfunc_begin2: .loc 0 12 0 is_stmt 1 # helper.cpp:12:0 .cfi_startproc # %bb.0: # %entry pushq %rbp .cfi_def_cfa_offset 16 .cfi_offset %rbp, -16 movq %rsp, %rbp .cfi_def_cfa_register %rbp movl %edi, -20(%rbp) .Ltmp4: .loc 0 13 23 prologue_end # helper.cpp:13:23 movl -20(%rbp), %eax movl %eax, -4(%rbp) .Ltmp5: .loc 0 8 7 # helper.cpp:8:7 movl $3, -8(%rbp) .loc 0 9 12 # helper.cpp:9:12 movl -4(%rbp), %eax .loc 0 9 16 is_stmt 0 # helper.cpp:9:16 addl -8(%rbp), %eax .Ltmp6: .loc 0 13 39 is_stmt 1 # helper.cpp:13:39 movl -20(%rbp), %ecx movl %ecx, -12(%rbp) .Ltmp7: .loc 0 3 7 # helper.cpp:3:7 movl $3, -16(%rbp) .loc 0 4 10 # helper.cpp:4:10 movl -12(%rbp), %ecx .loc 0 4 14 is_stmt 0 # helper.cpp:4:14 addl -16(%rbp), %ecx .Ltmp8: .loc 0 13 28 is_stmt 1 # helper.cpp:13:28 addl %ecx, %eax .loc 0 13 3 epilogue_begin is_stmt 0 # helper.cpp:13:3 popq %rbp .cfi_def_cfa %rsp, 8 retq .Ltmp9: .Lfunc_end2: .size _Z3fooi, .Lfunc_end2-_Z3fooi .cfi_endproc # -- End function .section .debug_abbrev,"",@progbits .byte 1 # Abbreviation Code .byte 74 # DW_TAG_skeleton_unit .byte 0 # DW_CHILDREN_no .byte 16 # DW_AT_stmt_list .byte 23 # DW_FORM_sec_offset .byte 114 # DW_AT_str_offsets_base .byte 23 # DW_FORM_sec_offset .byte 27 # DW_AT_comp_dir .byte 37 # DW_FORM_strx1 .ascii "\264B" # DW_AT_GNU_pubnames .byte 25 # DW_FORM_flag_present .byte 118 # DW_AT_dwo_name .byte 37 # DW_FORM_strx1 .byte 17 # DW_AT_low_pc .byte 1 # DW_FORM_addr .byte 85 # DW_AT_ranges .byte 35 # DW_FORM_rnglistx .byte 115 # DW_AT_addr_base .byte 23 # DW_FORM_sec_offset .byte 116 # DW_AT_rnglists_base .byte 23 # DW_FORM_sec_offset .byte 0 # EOM(1) .byte 0 # EOM(2) .byte 0 # EOM(3) .section .debug_info,"",@progbits .Lcu_begin0: .long .Ldebug_info_end0-.Ldebug_info_start0 # Length of Unit .Ldebug_info_start0: .short 5 # DWARF version number .byte 4 # DWARF Unit Type .byte 8 # Address Size (in bytes) .long .debug_abbrev # Offset Into Abbrev. Section .quad -7414121603437528769 .byte 1 # Abbrev [1] 0x14:0x1c DW_TAG_skeleton_unit .long .Lline_table_start0 # DW_AT_stmt_list .long .Lstr_offsets_base0 # DW_AT_str_offsets_base .byte 0 # DW_AT_comp_dir # DW_AT_GNU_pubnames .byte 1 # DW_AT_dwo_name .quad 0 # DW_AT_low_pc .byte 0 # DW_AT_ranges .long .Laddr_table_base0 # DW_AT_addr_base .long .Lrnglists_table_base0 # DW_AT_rnglists_base .Ldebug_info_end0: .section .debug_rnglists,"",@progbits .long .Ldebug_list_header_end0-.Ldebug_list_header_start0 # Length .Ldebug_list_header_start0: .short 5 # Version .byte 8 # Address size .byte 0 # Segment selector size .long 1 # Offset entry count .Lrnglists_table_base0: .long .Ldebug_ranges2-.Lrnglists_table_base0 .Ldebug_ranges2: .byte 3 # DW_RLE_startx_length .byte 0 # start index .uleb128 .Lfunc_end0-.Lfunc_begin0 # length .byte 3 # DW_RLE_startx_length .byte 1 # start index .uleb128 .Lfunc_end1-.Lfunc_begin1 # length .byte 3 # DW_RLE_startx_length .byte 2 # start index .uleb128 .Lfunc_end2-.Lfunc_begin2 # length .byte 0 # DW_RLE_end_of_list .Ldebug_list_header_end0: .section .debug_str_offsets,"",@progbits .long 12 # Length of String Offsets Set .short 5 .short 0 .Lstr_offsets_base0: .section .debug_str,"MS",@progbits,1 .Lskel_string0: .asciz "." # string offset=0 .Lskel_string1: .asciz "helper.dwo" # string offset=45 .section .debug_str_offsets,"",@progbits .long .Lskel_string0 .long .Lskel_string1 .section .debug_str_offsets.dwo,"e",@progbits .long 48 # Length of String Offsets Set .short 5 .short 0 .section .debug_str.dwo,"eMS",@progbits,1 .Linfo_string0: .asciz "_Z12doStuff2Samei" # string offset=0 .Linfo_string1: .asciz "doStuff2Same" # string offset=18 .Linfo_string2: .asciz "int" # string offset=31 .Linfo_string3: .asciz "val" # string offset=35 .Linfo_string4: .asciz "foo" # string offset=39 .Linfo_string5: .asciz "_Z8doStuff2i" # string offset=43 .Linfo_string6: .asciz "doStuff2" # string offset=56 .Linfo_string7: .asciz "_Z3fooi" # string offset=65 .Linfo_string8: .asciz "clang version 18.0.0 (git@github.com:llvm/llvm-project.git 63dbe7e808d07bdf25bad85301980bc323b0cd64)" # string offset=73 .Linfo_string9: .asciz "helper.cpp" # string offset=174 .Linfo_string10: .asciz "helper.dwo" # string offset=185 .section .debug_str_offsets.dwo,"e",@progbits .long 0 .long 18 .long 31 .long 35 .long 39 .long 43 .long 56 .long 65 .long 73 .long 174 .long 185 .section .debug_info.dwo,"e",@progbits .long .Ldebug_info_dwo_end0-.Ldebug_info_dwo_start0 # Length of Unit .Ldebug_info_dwo_start0: .short 5 # DWARF version number .byte 5 # DWARF Unit Type .byte 8 # Address Size (in bytes) .long 0 # Offset Into Abbrev. Section .quad -7414121603437528769 .byte 1 # Abbrev [1] 0x14:0xc9 DW_TAG_compile_unit .byte 8 # DW_AT_producer .short 33 # DW_AT_language .byte 9 # DW_AT_name .byte 10 # DW_AT_dwo_name .byte 2 # Abbrev [2] 0x1a:0x1d DW_TAG_subprogram .byte 0 # DW_AT_low_pc .long .Lfunc_end0-.Lfunc_begin0 # DW_AT_high_pc .byte 1 # DW_AT_frame_base .byte 86 .long 114 # DW_AT_abstract_origin .byte 3 # Abbrev [3] 0x26:0x8 DW_TAG_formal_parameter .byte 2 # DW_AT_location .byte 145 .byte 124 .long 123 # DW_AT_abstract_origin .byte 4 # Abbrev [4] 0x2e:0x8 DW_TAG_variable .byte 2 # DW_AT_location .byte 145 .byte 120 .long 131 # DW_AT_abstract_origin .byte 0 # End Of Children Mark .byte 2 # Abbrev [2] 0x37:0x1d DW_TAG_subprogram .byte 1 # DW_AT_low_pc .long .Lfunc_end1-.Lfunc_begin1 # DW_AT_high_pc .byte 1 # DW_AT_frame_base .byte 86 .long 84 # DW_AT_abstract_origin .byte 3 # Abbrev [3] 0x43:0x8 DW_TAG_formal_parameter .byte 2 # DW_AT_location .byte 145 .byte 124 .long 93 # DW_AT_abstract_origin .byte 4 # Abbrev [4] 0x4b:0x8 DW_TAG_variable .byte 2 # DW_AT_location .byte 145 .byte 120 .long 101 # DW_AT_abstract_origin .byte 0 # End Of Children Mark .byte 5 # Abbrev [5] 0x54:0x1a DW_TAG_subprogram .byte 0 # DW_AT_linkage_name .byte 1 # DW_AT_name .byte 0 # DW_AT_decl_file .byte 7 # DW_AT_decl_line .long 110 # DW_AT_type # DW_AT_external # DW_AT_inline .byte 6 # Abbrev [6] 0x5d:0x8 DW_TAG_formal_parameter .byte 3 # DW_AT_name .byte 0 # DW_AT_decl_file .byte 7 # DW_AT_decl_line .long 110 # DW_AT_type .byte 7 # Abbrev [7] 0x65:0x8 DW_TAG_variable .byte 4 # DW_AT_name .byte 0 # DW_AT_decl_file .byte 8 # DW_AT_decl_line .long 110 # DW_AT_type .byte 0 # End Of Children Mark .byte 8 # Abbrev [8] 0x6e:0x4 DW_TAG_base_type .byte 2 # DW_AT_name .byte 5 # DW_AT_encoding .byte 4 # DW_AT_byte_size .byte 5 # Abbrev [5] 0x72:0x1a DW_TAG_subprogram .byte 5 # DW_AT_linkage_name .byte 6 # DW_AT_name .byte 0 # DW_AT_decl_file .byte 2 # DW_AT_decl_line .long 110 # DW_AT_type # DW_AT_external # DW_AT_inline .byte 6 # Abbrev [6] 0x7b:0x8 DW_TAG_formal_parameter .byte 3 # DW_AT_name .byte 0 # DW_AT_decl_file .byte 2 # DW_AT_decl_line .long 110 # DW_AT_type .byte 7 # Abbrev [7] 0x83:0x8 DW_TAG_variable .byte 4 # DW_AT_name .byte 0 # DW_AT_decl_file .byte 3 # DW_AT_decl_line .long 110 # DW_AT_type .byte 0 # End Of Children Mark .byte 9 # Abbrev [9] 0x8c:0x50 DW_TAG_subprogram .byte 2 # DW_AT_low_pc .long .Lfunc_end2-.Lfunc_begin2 # DW_AT_high_pc .byte 1 # DW_AT_frame_base .byte 86 .byte 7 # DW_AT_linkage_name .byte 4 # DW_AT_name .byte 0 # DW_AT_decl_file .byte 12 # DW_AT_decl_line .long 110 # DW_AT_type # DW_AT_external .byte 10 # Abbrev [10] 0x9c:0xb DW_TAG_formal_parameter .byte 2 # DW_AT_location .byte 145 .byte 108 .byte 3 # DW_AT_name .byte 0 # DW_AT_decl_file .byte 12 # DW_AT_decl_line .long 110 # DW_AT_type .byte 11 # Abbrev [11] 0xa7:0x1a DW_TAG_inlined_subroutine .long 84 # DW_AT_abstract_origin .byte 0 # DW_AT_ranges .byte 0 # DW_AT_call_file .byte 13 # DW_AT_call_line .byte 10 # DW_AT_call_column .byte 3 # Abbrev [3] 0xb0:0x8 DW_TAG_formal_parameter .byte 2 # DW_AT_location .byte 145 .byte 124 .long 93 # DW_AT_abstract_origin .byte 4 # Abbrev [4] 0xb8:0x8 DW_TAG_variable .byte 2 # DW_AT_location .byte 145 .byte 120 .long 101 # DW_AT_abstract_origin .byte 0 # End Of Children Mark .byte 11 # Abbrev [11] 0xc1:0x1a DW_TAG_inlined_subroutine .long 114 # DW_AT_abstract_origin .byte 1 # DW_AT_ranges .byte 0 # DW_AT_call_file .byte 13 # DW_AT_call_line .byte 30 # DW_AT_call_column .byte 3 # Abbrev [3] 0xca:0x8 DW_TAG_formal_parameter .byte 2 # DW_AT_location .byte 145 .byte 116 .long 123 # DW_AT_abstract_origin .byte 4 # Abbrev [4] 0xd2:0x8 DW_TAG_variable .byte 2 # DW_AT_location .byte 145 .byte 112 .long 131 # DW_AT_abstract_origin .byte 0 # End Of Children Mark .byte 0 # End Of Children Mark .byte 0 # End Of Children Mark .Ldebug_info_dwo_end0: .section .debug_abbrev.dwo,"e",@progbits .byte 1 # Abbreviation Code .byte 17 # DW_TAG_compile_unit .byte 1 # DW_CHILDREN_yes .byte 37 # DW_AT_producer .byte 37 # DW_FORM_strx1 .byte 19 # DW_AT_language .byte 5 # DW_FORM_data2 .byte 3 # DW_AT_name .byte 37 # DW_FORM_strx1 .byte 118 # DW_AT_dwo_name .byte 37 # DW_FORM_strx1 .byte 0 # EOM(1) .byte 0 # EOM(2) .byte 2 # Abbreviation Code .byte 46 # DW_TAG_subprogram .byte 1 # DW_CHILDREN_yes .byte 17 # DW_AT_low_pc .byte 27 # DW_FORM_addrx .byte 18 # DW_AT_high_pc .byte 6 # DW_FORM_data4 .byte 64 # DW_AT_frame_base .byte 24 # DW_FORM_exprloc .byte 49 # DW_AT_abstract_origin .byte 19 # DW_FORM_ref4 .byte 0 # EOM(1) .byte 0 # EOM(2) .byte 3 # Abbreviation Code .byte 5 # DW_TAG_formal_parameter .byte 0 # DW_CHILDREN_no .byte 2 # DW_AT_location .byte 24 # DW_FORM_exprloc .byte 49 # DW_AT_abstract_origin .byte 19 # DW_FORM_ref4 .byte 0 # EOM(1) .byte 0 # EOM(2) .byte 4 # Abbreviation Code .byte 52 # DW_TAG_variable .byte 0 # DW_CHILDREN_no .byte 2 # DW_AT_location .byte 24 # DW_FORM_exprloc .byte 49 # DW_AT_abstract_origin .byte 19 # DW_FORM_ref4 .byte 0 # EOM(1) .byte 0 # EOM(2) .byte 5 # Abbreviation Code .byte 46 # DW_TAG_subprogram .byte 1 # DW_CHILDREN_yes .byte 110 # DW_AT_linkage_name .byte 37 # DW_FORM_strx1 .byte 3 # DW_AT_name .byte 37 # DW_FORM_strx1 .byte 58 # DW_AT_decl_file .byte 11 # DW_FORM_data1 .byte 59 # DW_AT_decl_line .byte 11 # DW_FORM_data1 .byte 73 # DW_AT_type .byte 19 # DW_FORM_ref4 .byte 63 # DW_AT_external .byte 25 # DW_FORM_flag_present .byte 32 # DW_AT_inline .byte 33 # DW_FORM_implicit_const .byte 1 .byte 0 # EOM(1) .byte 0 # EOM(2) .byte 6 # Abbreviation Code .byte 5 # DW_TAG_formal_parameter .byte 0 # DW_CHILDREN_no .byte 3 # DW_AT_name .byte 37 # DW_FORM_strx1 .byte 58 # DW_AT_decl_file .byte 11 # DW_FORM_data1 .byte 59 # DW_AT_decl_line .byte 11 # DW_FORM_data1 .byte 73 # DW_AT_type .byte 19 # DW_FORM_ref4 .byte 0 # EOM(1) .byte 0 # EOM(2) .byte 7 # Abbreviation Code .byte 52 # DW_TAG_variable .byte 0 # DW_CHILDREN_no .byte 3 # DW_AT_name .byte 37 # DW_FORM_strx1 .byte 58 # DW_AT_decl_file .byte 11 # DW_FORM_data1 .byte 59 # DW_AT_decl_line .byte 11 # DW_FORM_data1 .byte 73 # DW_AT_type .byte 19 # DW_FORM_ref4 .byte 0 # EOM(1) .byte 0 # EOM(2) .byte 8 # Abbreviation Code .byte 36 # DW_TAG_base_type .byte 0 # DW_CHILDREN_no .byte 3 # DW_AT_name .byte 37 # DW_FORM_strx1 .byte 62 # DW_AT_encoding .byte 11 # DW_FORM_data1 .byte 11 # DW_AT_byte_size .byte 11 # DW_FORM_data1 .byte 0 # EOM(1) .byte 0 # EOM(2) .byte 9 # Abbreviation Code .byte 46 # DW_TAG_subprogram .byte 1 # DW_CHILDREN_yes .byte 17 # DW_AT_low_pc .byte 27 # DW_FORM_addrx .byte 18 # DW_AT_high_pc .byte 6 # DW_FORM_data4 .byte 64 # DW_AT_frame_base .byte 24 # DW_FORM_exprloc .byte 110 # DW_AT_linkage_name .byte 37 # DW_FORM_strx1 .byte 3 # DW_AT_name .byte 37 # DW_FORM_strx1 .byte 58 # DW_AT_decl_file .byte 11 # DW_FORM_data1 .byte 59 # DW_AT_decl_line .byte 11 # DW_FORM_data1 .byte 73 # DW_AT_type .byte 19 # DW_FORM_ref4 .byte 63 # DW_AT_external .byte 25 # DW_FORM_flag_present .byte 0 # EOM(1) .byte 0 # EOM(2) .byte 10 # Abbreviation Code .byte 5 # DW_TAG_formal_parameter .byte 0 # DW_CHILDREN_no .byte 2 # DW_AT_location .byte 24 # DW_FORM_exprloc .byte 3 # DW_AT_name .byte 37 # DW_FORM_strx1 .byte 58 # DW_AT_decl_file .byte 11 # DW_FORM_data1 .byte 59 # DW_AT_decl_line .byte 11 # DW_FORM_data1 .byte 73 # DW_AT_type .byte 19 # DW_FORM_ref4 .byte 0 # EOM(1) .byte 0 # EOM(2) .byte 11 # Abbreviation Code .byte 29 # DW_TAG_inlined_subroutine .byte 1 # DW_CHILDREN_yes .byte 49 # DW_AT_abstract_origin .byte 19 # DW_FORM_ref4 .byte 85 # DW_AT_ranges .byte 35 # DW_FORM_rnglistx .byte 88 # DW_AT_call_file .byte 11 # DW_FORM_data1 .byte 89 # DW_AT_call_line .byte 11 # DW_FORM_data1 .byte 87 # DW_AT_call_column .byte 11 # DW_FORM_data1 .byte 0 # EOM(1) .byte 0 # EOM(2) .byte 0 # EOM(3) .section .debug_rnglists.dwo,"e",@progbits .long .Ldebug_list_header_end1-.Ldebug_list_header_start1 # Length .Ldebug_list_header_start1: .short 5 # Version .byte 8 # Address size .byte 0 # Segment selector size .long 2 # Offset entry count .Lrnglists_dwo_table_base0: .long .Ldebug_ranges0-.Lrnglists_dwo_table_base0 .long .Ldebug_ranges1-.Lrnglists_dwo_table_base0 .Ldebug_ranges0: .byte 1 # DW_RLE_base_addressx .byte 2 # base address index .byte 4 # DW_RLE_offset_pair .uleb128 .Ltmp5-.Lfunc_begin2 # starting offset .uleb128 .Ltmp6-.Lfunc_begin2 # ending offset .byte 0 # DW_RLE_end_of_list .Ldebug_ranges1: .byte 1 # DW_RLE_base_addressx .byte 2 # base address index .byte 4 # DW_RLE_offset_pair .uleb128 .Ltmp7-.Lfunc_begin2 # starting offset .uleb128 .Ltmp8-.Lfunc_begin2 # ending offset .byte 0 # DW_RLE_end_of_list .Ldebug_list_header_end1: .section .debug_addr,"",@progbits .long .Ldebug_addr_end0-.Ldebug_addr_start0 # Length of contribution .Ldebug_addr_start0: .short 5 # DWARF version number .byte 8 # Address size .byte 0 # Segment selector size .Laddr_table_base0: .quad .Lfunc_begin0 .quad .Lfunc_begin1 .quad .Lfunc_begin2 .Ldebug_addr_end0: .section .debug_gnu_pubnames,"",@progbits .long .LpubNames_end0-.LpubNames_start0 # Length of Public Names Info .LpubNames_start0: .short 2 # DWARF Version .long .Lcu_begin0 # Offset of Compilation Unit Info .long 48 # Compilation Unit Length .long 84 # DIE offset .byte 48 # Attributes: FUNCTION, EXTERNAL .asciz "doStuff2Same" # External Name .long 114 # DIE offset .byte 48 # Attributes: FUNCTION, EXTERNAL .asciz "doStuff2" # External Name .long 140 # DIE offset .byte 48 # Attributes: FUNCTION, EXTERNAL .asciz "foo" # External Name .long 0 # End Mark .LpubNames_end0: .section .debug_gnu_pubtypes,"",@progbits .long .LpubTypes_end0-.LpubTypes_start0 # Length of Public Types Info .LpubTypes_start0: .short 2 # DWARF Version .long .Lcu_begin0 # Offset of Compilation Unit Info .long 48 # Compilation Unit Length .long 110 # DIE offset .byte 144 # Attributes: TYPE, STATIC .asciz "int" # External Name .long 0 # End Mark .LpubTypes_end0: .ident "clang version 18.0.0 (git@github.com:llvm/llvm-project.git 63dbe7e808d07bdf25bad85301980bc323b0cd64)" .section ".note.GNU-stack","",@progbits .addrsig .section .debug_line,"",@progbits .Lline_table_start0: