547 lines · plain
1# clang++ -g -gdwarf-4 -emit-llvm -S main.cpp2# llc -O2 -mtriple=x86_64-unknown-linux-gnu main.ll3# void use(int * x, int * y) {4# *x += 4;5# *y -= 2;6# }7#8# int helper(int z_, int d_);9# int x = 0;10# int y = 1;11# int main(int argc, char *argv[]) {12# x = argc;13# y = argc + 3;14# use(&x, &y);15# return helper(x, y);16# }17 18 .text19 .file "main.cpp"20 .file 1 "." "main.cpp"21 .globl _Z3usePiS_ # -- Begin function _Z3usePiS_22 .p2align 4, 0x9023 .type _Z3usePiS_,@function24_Z3usePiS_: # @_Z3usePiS_25.Lfunc_begin0:26 .loc 1 1 0 # main.cpp:1:027 .cfi_startproc28# %bb.0: # %entry29 #DEBUG_VALUE: use:x <- $rdi30 #DEBUG_VALUE: use:y <- $rsi31 .loc 1 2 4 prologue_end # main.cpp:2:432 addl $4, (%rdi)33 .loc 1 3 4 # main.cpp:3:434 addl $-2, (%rsi)35 .loc 1 4 1 # main.cpp:4:136 retq37.Ltmp0:38.Lfunc_end0:39 .size _Z3usePiS_, .Lfunc_end0-_Z3usePiS_40 .cfi_endproc41 # -- End function42 .globl main # -- Begin function main43 .p2align 4, 0x9044 .type main,@function45main: # @main46.Lfunc_begin1:47 .loc 1 9 0 # main.cpp:9:048 .cfi_startproc49# %bb.0: # %entry50 #DEBUG_VALUE: main:argc <- $edi51 #DEBUG_VALUE: main:argv <- $rsi52 # kill: def $edi killed $edi def $rdi53 .loc 1 2 4 prologue_end # main.cpp:2:454 leal 4(%rdi), %eax55 movl %eax, x(%rip)56.Ltmp1:57 #DEBUG_VALUE: use:x <- undef58 .loc 1 3 4 # main.cpp:3:459 leal 1(%rdi), %esi60.Ltmp2:61 #DEBUG_VALUE: main:argv <- [DW_OP_LLVM_entry_value 1] $rsi62 movl %esi, y(%rip)63.Ltmp3:64 #DEBUG_VALUE: use:y <- undef65 .loc 1 13 11 # main.cpp:13:1166 movl %eax, %edi67.Ltmp4:68 #DEBUG_VALUE: main:argc <- [DW_OP_LLVM_entry_value 1] $edi69 jmp _Z6helperii # TAILCALL70.Ltmp5:71.Lfunc_end1:72 .size main, .Lfunc_end1-main73 .cfi_endproc74 # -- End function75 .type x,@object # @x76 .bss77 .globl x78 .p2align 279x:80 .long 0 # 0x081 .size x, 482 83 .type y,@object # @y84 .data85 .globl y86 .p2align 287y:88 .long 1 # 0x189 .size y, 490 91 .section .debug_loc.dwo,"e",@progbits92.Ldebug_loc0:93 .byte 394 .byte 395 .long .Ltmp4-.Lfunc_begin196 .short 1 # Loc expr size97 .byte 85 # super-register DW_OP_reg598 .byte 399 .byte 5100 .long .Lfunc_end1-.Ltmp4101 .short 4 # Loc expr size102 .byte 243 # DW_OP_GNU_entry_value103 .byte 1 # 1104 .byte 85 # super-register DW_OP_reg5105 .byte 159 # DW_OP_stack_value106 .byte 0107.Ldebug_loc1:108 .byte 3109 .byte 3110 .long .Ltmp2-.Lfunc_begin1111 .short 1 # Loc expr size112 .byte 84 # DW_OP_reg4113 .byte 3114 .byte 6115 .long .Lfunc_end1-.Ltmp2116 .short 4 # Loc expr size117 .byte 243 # DW_OP_GNU_entry_value118 .byte 1 # 1119 .byte 84 # DW_OP_reg4120 .byte 159 # DW_OP_stack_value121 .byte 0122 .section .debug_abbrev,"",@progbits123 .byte 1 # Abbreviation Code124 .byte 17 # DW_TAG_compile_unit125 .byte 0 # DW_CHILDREN_no126 .byte 16 # DW_AT_stmt_list127 .byte 23 # DW_FORM_sec_offset128 .byte 27 # DW_AT_comp_dir129 .byte 14 # DW_FORM_strp130 .ascii "\260B" # DW_AT_GNU_dwo_name131 .byte 14 # DW_FORM_strp132 .ascii "\261B" # DW_AT_GNU_dwo_id133 .byte 7 # DW_FORM_data8134 .byte 17 # DW_AT_low_pc135 .byte 1 # DW_FORM_addr136 .byte 18 # DW_AT_high_pc137 .byte 6 # DW_FORM_data4138 .ascii "\263B" # DW_AT_GNU_addr_base139 .byte 23 # DW_FORM_sec_offset140 .byte 0 # EOM(1)141 .byte 0 # EOM(2)142 .byte 0 # EOM(3)143 .section .debug_info,"",@progbits144.Lcu_begin0:145 .long .Ldebug_info_end0-.Ldebug_info_start0 # Length of Unit146.Ldebug_info_start0:147 .short 4 # DWARF version number148 .long .debug_abbrev # Offset Into Abbrev. Section149 .byte 8 # Address Size (in bytes)150 .byte 1 # Abbrev [1] 0xb:0x25 DW_TAG_compile_unit151 .long .Lline_table_start0 # DW_AT_stmt_list152 .long .Lskel_string0 # DW_AT_comp_dir153 .long .Lskel_string1 # DW_AT_GNU_dwo_name154 .quad -4922924650784735988 # DW_AT_GNU_dwo_id155 .quad .Lfunc_begin0 # DW_AT_low_pc156 .long .Lfunc_end1-.Lfunc_begin0 # DW_AT_high_pc157 .long .Laddr_table_base0 # DW_AT_GNU_addr_base158.Ldebug_info_end0:159 .section .debug_str,"MS",@progbits,1160.Lskel_string0:161 .asciz "." # string offset=0162.Lskel_string1:163 .asciz "main.dwo" # string offset=2164 .section .debug_str.dwo,"eMS",@progbits,1165.Linfo_string0:166 .asciz "x" # string offset=0167.Linfo_string1:168 .asciz "int" # string offset=2169.Linfo_string2:170 .asciz "y" # string offset=6171.Linfo_string3:172 .asciz "_Z3usePiS_" # string offset=8173.Linfo_string4:174 .asciz "use" # string offset=19175.Linfo_string5:176 .asciz "_Z6helperii" # string offset=23177.Linfo_string6:178 .asciz "helper" # string offset=35179.Linfo_string7:180 .asciz "main" # string offset=42181.Linfo_string8:182 .asciz "argc" # string offset=47183.Linfo_string9:184 .asciz "argv" # string offset=52185.Linfo_string10:186 .asciz "char" # string offset=57187.Linfo_string11:188 .asciz "clang version 15.0.0" # string offset=62189.Linfo_string12:190 .asciz "main.cpp" # string offset=83191.Linfo_string13:192 .asciz "main.dwo" # string offset=92193 .section .debug_str_offsets.dwo,"e",@progbits194 .long 0195 .long 2196 .long 6197 .long 8198 .long 19199 .long 23200 .long 35201 .long 42202 .long 47203 .long 52204 .long 57205 .long 62206 .long 83207 .long 92208 .section .debug_info.dwo,"e",@progbits209 .long .Ldebug_info_dwo_end0-.Ldebug_info_dwo_start0 # Length of Unit210.Ldebug_info_dwo_start0:211 .short 4 # DWARF version number212 .long 0 # Offset Into Abbrev. Section213 .byte 8 # Address Size (in bytes)214 .byte 1 # Abbrev [1] 0xb:0xbd DW_TAG_compile_unit215 .byte 11 # DW_AT_producer216 .short 33 # DW_AT_language217 .byte 12 # DW_AT_name218 .byte 13 # DW_AT_GNU_dwo_name219 .quad -4922924650784735988 # DW_AT_GNU_dwo_id220 .byte 2 # Abbrev [2] 0x19:0xb DW_TAG_variable221 .byte 0 # DW_AT_name222 .long 36 # DW_AT_type223 # DW_AT_external224 .byte 1 # DW_AT_decl_file225 .byte 7 # DW_AT_decl_line226 .byte 2 # DW_AT_location227 .byte 251228 .byte 0229 .byte 3 # Abbrev [3] 0x24:0x4 DW_TAG_base_type230 .byte 1 # DW_AT_name231 .byte 5 # DW_AT_encoding232 .byte 4 # DW_AT_byte_size233 .byte 2 # Abbrev [2] 0x28:0xb DW_TAG_variable234 .byte 2 # DW_AT_name235 .long 36 # DW_AT_type236 # DW_AT_external237 .byte 1 # DW_AT_decl_file238 .byte 8 # DW_AT_decl_line239 .byte 2 # DW_AT_location240 .byte 251241 .byte 1242 .byte 4 # Abbrev [4] 0x33:0x1b DW_TAG_subprogram243 .byte 2 # DW_AT_low_pc244 .long .Lfunc_end0-.Lfunc_begin0 # DW_AT_high_pc245 .byte 1 # DW_AT_frame_base246 .byte 87247 # DW_AT_GNU_all_call_sites248 .long 78 # DW_AT_abstract_origin249 .byte 5 # Abbrev [5] 0x3f:0x7 DW_TAG_formal_parameter250 .byte 1 # DW_AT_location251 .byte 85252 .long 84 # DW_AT_abstract_origin253 .byte 5 # Abbrev [5] 0x46:0x7 DW_TAG_formal_parameter254 .byte 1 # DW_AT_location255 .byte 84256 .long 92 # DW_AT_abstract_origin257 .byte 0 # End Of Children Mark258 .byte 6 # Abbrev [6] 0x4e:0x17 DW_TAG_subprogram259 .byte 3 # DW_AT_linkage_name260 .byte 4 # DW_AT_name261 .byte 1 # DW_AT_decl_file262 .byte 1 # DW_AT_decl_line263 # DW_AT_external264 .byte 1 # DW_AT_inline265 .byte 7 # Abbrev [7] 0x54:0x8 DW_TAG_formal_parameter266 .byte 0 # DW_AT_name267 .byte 1 # DW_AT_decl_file268 .byte 1 # DW_AT_decl_line269 .long 101 # DW_AT_type270 .byte 7 # Abbrev [7] 0x5c:0x8 DW_TAG_formal_parameter271 .byte 2 # DW_AT_name272 .byte 1 # DW_AT_decl_file273 .byte 1 # DW_AT_decl_line274 .long 101 # DW_AT_type275 .byte 0 # End Of Children Mark276 .byte 8 # Abbrev [8] 0x65:0x5 DW_TAG_pointer_type277 .long 36 # DW_AT_type278 .byte 9 # Abbrev [9] 0x6a:0x3b DW_TAG_subprogram279 .byte 3 # DW_AT_low_pc280 .long .Lfunc_end1-.Lfunc_begin1 # DW_AT_high_pc281 .byte 1 # DW_AT_frame_base282 .byte 87283 # DW_AT_GNU_all_call_sites284 .byte 7 # DW_AT_name285 .byte 1 # DW_AT_decl_file286 .byte 9 # DW_AT_decl_line287 .long 36 # DW_AT_type288 # DW_AT_external289 .byte 10 # Abbrev [10] 0x79:0xc DW_TAG_formal_parameter290 .long .Ldebug_loc0-.debug_loc.dwo # DW_AT_location291 .byte 8 # DW_AT_name292 .byte 1 # DW_AT_decl_file293 .byte 9 # DW_AT_decl_line294 .long 36 # DW_AT_type295 .byte 10 # Abbrev [10] 0x85:0xc DW_TAG_formal_parameter296 .long .Ldebug_loc1-.debug_loc.dwo # DW_AT_location297 .byte 9 # DW_AT_name298 .byte 1 # DW_AT_decl_file299 .byte 9 # DW_AT_decl_line300 .long 185 # DW_AT_type301 .byte 11 # Abbrev [11] 0x91:0xd DW_TAG_inlined_subroutine302 .long 78 # DW_AT_abstract_origin303 .byte 3 # DW_AT_low_pc304 .long .Ltmp3-.Lfunc_begin1 # DW_AT_high_pc305 .byte 1 # DW_AT_call_file306 .byte 12 # DW_AT_call_line307 .byte 4 # DW_AT_call_column308 .byte 12 # Abbrev [12] 0x9e:0x6 DW_TAG_GNU_call_site309 .long 165 # DW_AT_abstract_origin310 # DW_AT_GNU_tail_call311 .byte 4 # DW_AT_low_pc312 .byte 0 # End Of Children Mark313 .byte 13 # Abbrev [13] 0xa5:0x14 DW_TAG_subprogram314 .byte 5 # DW_AT_linkage_name315 .byte 6 # DW_AT_name316 .byte 1 # DW_AT_decl_file317 .byte 6 # DW_AT_decl_line318 .long 36 # DW_AT_type319 # DW_AT_declaration320 # DW_AT_external321 .byte 14 # Abbrev [14] 0xae:0x5 DW_TAG_formal_parameter322 .long 36 # DW_AT_type323 .byte 14 # Abbrev [14] 0xb3:0x5 DW_TAG_formal_parameter324 .long 36 # DW_AT_type325 .byte 0 # End Of Children Mark326 .byte 8 # Abbrev [8] 0xb9:0x5 DW_TAG_pointer_type327 .long 190 # DW_AT_type328 .byte 8 # Abbrev [8] 0xbe:0x5 DW_TAG_pointer_type329 .long 195 # DW_AT_type330 .byte 3 # Abbrev [3] 0xc3:0x4 DW_TAG_base_type331 .byte 10 # DW_AT_name332 .byte 6 # DW_AT_encoding333 .byte 1 # DW_AT_byte_size334 .byte 0 # End Of Children Mark335.Ldebug_info_dwo_end0:336 .section .debug_abbrev.dwo,"e",@progbits337 .byte 1 # Abbreviation Code338 .byte 17 # DW_TAG_compile_unit339 .byte 1 # DW_CHILDREN_yes340 .byte 37 # DW_AT_producer341 .ascii "\202>" # DW_FORM_GNU_str_index342 .byte 19 # DW_AT_language343 .byte 5 # DW_FORM_data2344 .byte 3 # DW_AT_name345 .ascii "\202>" # DW_FORM_GNU_str_index346 .ascii "\260B" # DW_AT_GNU_dwo_name347 .ascii "\202>" # DW_FORM_GNU_str_index348 .ascii "\261B" # DW_AT_GNU_dwo_id349 .byte 7 # DW_FORM_data8350 .byte 0 # EOM(1)351 .byte 0 # EOM(2)352 .byte 2 # Abbreviation Code353 .byte 52 # DW_TAG_variable354 .byte 0 # DW_CHILDREN_no355 .byte 3 # DW_AT_name356 .ascii "\202>" # DW_FORM_GNU_str_index357 .byte 73 # DW_AT_type358 .byte 19 # DW_FORM_ref4359 .byte 63 # DW_AT_external360 .byte 25 # DW_FORM_flag_present361 .byte 58 # DW_AT_decl_file362 .byte 11 # DW_FORM_data1363 .byte 59 # DW_AT_decl_line364 .byte 11 # DW_FORM_data1365 .byte 2 # DW_AT_location366 .byte 24 # DW_FORM_exprloc367 .byte 0 # EOM(1)368 .byte 0 # EOM(2)369 .byte 3 # Abbreviation Code370 .byte 36 # DW_TAG_base_type371 .byte 0 # DW_CHILDREN_no372 .byte 3 # DW_AT_name373 .ascii "\202>" # DW_FORM_GNU_str_index374 .byte 62 # DW_AT_encoding375 .byte 11 # DW_FORM_data1376 .byte 11 # DW_AT_byte_size377 .byte 11 # DW_FORM_data1378 .byte 0 # EOM(1)379 .byte 0 # EOM(2)380 .byte 4 # Abbreviation Code381 .byte 46 # DW_TAG_subprogram382 .byte 1 # DW_CHILDREN_yes383 .byte 17 # DW_AT_low_pc384 .ascii "\201>" # DW_FORM_GNU_addr_index385 .byte 18 # DW_AT_high_pc386 .byte 6 # DW_FORM_data4387 .byte 64 # DW_AT_frame_base388 .byte 24 # DW_FORM_exprloc389 .ascii "\227B" # DW_AT_GNU_all_call_sites390 .byte 25 # DW_FORM_flag_present391 .byte 49 # DW_AT_abstract_origin392 .byte 19 # DW_FORM_ref4393 .byte 0 # EOM(1)394 .byte 0 # EOM(2)395 .byte 5 # Abbreviation Code396 .byte 5 # DW_TAG_formal_parameter397 .byte 0 # DW_CHILDREN_no398 .byte 2 # DW_AT_location399 .byte 24 # DW_FORM_exprloc400 .byte 49 # DW_AT_abstract_origin401 .byte 19 # DW_FORM_ref4402 .byte 0 # EOM(1)403 .byte 0 # EOM(2)404 .byte 6 # Abbreviation Code405 .byte 46 # DW_TAG_subprogram406 .byte 1 # DW_CHILDREN_yes407 .byte 110 # DW_AT_linkage_name408 .ascii "\202>" # DW_FORM_GNU_str_index409 .byte 3 # DW_AT_name410 .ascii "\202>" # DW_FORM_GNU_str_index411 .byte 58 # DW_AT_decl_file412 .byte 11 # DW_FORM_data1413 .byte 59 # DW_AT_decl_line414 .byte 11 # DW_FORM_data1415 .byte 63 # DW_AT_external416 .byte 25 # DW_FORM_flag_present417 .byte 32 # DW_AT_inline418 .byte 11 # DW_FORM_data1419 .byte 0 # EOM(1)420 .byte 0 # EOM(2)421 .byte 7 # Abbreviation Code422 .byte 5 # DW_TAG_formal_parameter423 .byte 0 # DW_CHILDREN_no424 .byte 3 # DW_AT_name425 .ascii "\202>" # DW_FORM_GNU_str_index426 .byte 58 # DW_AT_decl_file427 .byte 11 # DW_FORM_data1428 .byte 59 # DW_AT_decl_line429 .byte 11 # DW_FORM_data1430 .byte 73 # DW_AT_type431 .byte 19 # DW_FORM_ref4432 .byte 0 # EOM(1)433 .byte 0 # EOM(2)434 .byte 8 # Abbreviation Code435 .byte 15 # DW_TAG_pointer_type436 .byte 0 # DW_CHILDREN_no437 .byte 73 # DW_AT_type438 .byte 19 # DW_FORM_ref4439 .byte 0 # EOM(1)440 .byte 0 # EOM(2)441 .byte 9 # Abbreviation Code442 .byte 46 # DW_TAG_subprogram443 .byte 1 # DW_CHILDREN_yes444 .byte 17 # DW_AT_low_pc445 .ascii "\201>" # DW_FORM_GNU_addr_index446 .byte 18 # DW_AT_high_pc447 .byte 6 # DW_FORM_data4448 .byte 64 # DW_AT_frame_base449 .byte 24 # DW_FORM_exprloc450 .ascii "\227B" # DW_AT_GNU_all_call_sites451 .byte 25 # DW_FORM_flag_present452 .byte 3 # DW_AT_name453 .ascii "\202>" # DW_FORM_GNU_str_index454 .byte 58 # DW_AT_decl_file455 .byte 11 # DW_FORM_data1456 .byte 59 # DW_AT_decl_line457 .byte 11 # DW_FORM_data1458 .byte 73 # DW_AT_type459 .byte 19 # DW_FORM_ref4460 .byte 63 # DW_AT_external461 .byte 25 # DW_FORM_flag_present462 .byte 0 # EOM(1)463 .byte 0 # EOM(2)464 .byte 10 # Abbreviation Code465 .byte 5 # DW_TAG_formal_parameter466 .byte 0 # DW_CHILDREN_no467 .byte 2 # DW_AT_location468 .byte 23 # DW_FORM_sec_offset469 .byte 3 # DW_AT_name470 .ascii "\202>" # DW_FORM_GNU_str_index471 .byte 58 # DW_AT_decl_file472 .byte 11 # DW_FORM_data1473 .byte 59 # DW_AT_decl_line474 .byte 11 # DW_FORM_data1475 .byte 73 # DW_AT_type476 .byte 19 # DW_FORM_ref4477 .byte 0 # EOM(1)478 .byte 0 # EOM(2)479 .byte 11 # Abbreviation Code480 .byte 29 # DW_TAG_inlined_subroutine481 .byte 0 # DW_CHILDREN_no482 .byte 49 # DW_AT_abstract_origin483 .byte 19 # DW_FORM_ref4484 .byte 17 # DW_AT_low_pc485 .ascii "\201>" # DW_FORM_GNU_addr_index486 .byte 18 # DW_AT_high_pc487 .byte 6 # DW_FORM_data4488 .byte 88 # DW_AT_call_file489 .byte 11 # DW_FORM_data1490 .byte 89 # DW_AT_call_line491 .byte 11 # DW_FORM_data1492 .byte 87 # DW_AT_call_column493 .byte 11 # DW_FORM_data1494 .byte 0 # EOM(1)495 .byte 0 # EOM(2)496 .byte 12 # Abbreviation Code497 .ascii "\211\202\001" # DW_TAG_GNU_call_site498 .byte 0 # DW_CHILDREN_no499 .byte 49 # DW_AT_abstract_origin500 .byte 19 # DW_FORM_ref4501 .ascii "\225B" # DW_AT_GNU_tail_call502 .byte 25 # DW_FORM_flag_present503 .byte 17 # DW_AT_low_pc504 .ascii "\201>" # DW_FORM_GNU_addr_index505 .byte 0 # EOM(1)506 .byte 0 # EOM(2)507 .byte 13 # Abbreviation Code508 .byte 46 # DW_TAG_subprogram509 .byte 1 # DW_CHILDREN_yes510 .byte 110 # DW_AT_linkage_name511 .ascii "\202>" # DW_FORM_GNU_str_index512 .byte 3 # DW_AT_name513 .ascii "\202>" # DW_FORM_GNU_str_index514 .byte 58 # DW_AT_decl_file515 .byte 11 # DW_FORM_data1516 .byte 59 # DW_AT_decl_line517 .byte 11 # DW_FORM_data1518 .byte 73 # DW_AT_type519 .byte 19 # DW_FORM_ref4520 .byte 60 # DW_AT_declaration521 .byte 25 # DW_FORM_flag_present522 .byte 63 # DW_AT_external523 .byte 25 # DW_FORM_flag_present524 .byte 0 # EOM(1)525 .byte 0 # EOM(2)526 .byte 14 # Abbreviation Code527 .byte 5 # DW_TAG_formal_parameter528 .byte 0 # DW_CHILDREN_no529 .byte 73 # DW_AT_type530 .byte 19 # DW_FORM_ref4531 .byte 0 # EOM(1)532 .byte 0 # EOM(2)533 .byte 0 # EOM(3)534 .section .debug_addr,"",@progbits535.Laddr_table_base0:536 .quad x537 .quad y538 .quad .Lfunc_begin0539 .quad .Lfunc_begin1540 .quad .Ltmp5541 .quad .Ltmp4542 .quad .Ltmp2543 .ident "clang version 15.0.0"544 .section ".note.GNU-stack","",@progbits545 .section .debug_line,"",@progbits546.Lline_table_start0:547