579 lines · plain
1# clang++ -g -gdwarf-5 -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 0 "." "main.cpp" md5 0x1f627913a0daee879e00a3a51726f0ef21 .globl _Z3usePiS_ # -- Begin function _Z3usePiS_22 .p2align 4, 0x9023 .type _Z3usePiS_,@function24_Z3usePiS_: # @_Z3usePiS_25.Lfunc_begin0:26 .loc 0 1 0 # main.cpp:1:027 .cfi_startproc28# %bb.0: # %entry29 #DEBUG_VALUE: use:x <- $rdi30 #DEBUG_VALUE: use:y <- $rsi31 .loc 0 2 4 prologue_end # main.cpp:2:432 addl $4, (%rdi)33 .loc 0 3 4 # main.cpp:3:434 addl $-2, (%rsi)35 .loc 0 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 0 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 0 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 0 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 0 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_loclists.dwo,"e",@progbits92 .long .Ldebug_list_header_end0-.Ldebug_list_header_start0 # Length93.Ldebug_list_header_start0:94 .short 5 # Version95 .byte 8 # Address size96 .byte 0 # Segment selector size97 .long 2 # Offset entry count98.Lloclists_table_base0:99 .long .Ldebug_loc0-.Lloclists_table_base0100 .long .Ldebug_loc1-.Lloclists_table_base0101.Ldebug_loc0:102 .byte 1 # DW_LLE_base_addressx103 .byte 2 # base address index104 .byte 4 # DW_LLE_offset_pair105 .uleb128 .Lfunc_begin1-.Lfunc_begin0 # starting offset106 .uleb128 .Ltmp4-.Lfunc_begin0 # ending offset107 .byte 1 # Loc expr size108 .byte 85 # super-register DW_OP_reg5109 .byte 4 # DW_LLE_offset_pair110 .uleb128 .Ltmp4-.Lfunc_begin0 # starting offset111 .uleb128 .Lfunc_end1-.Lfunc_begin0 # ending offset112 .byte 4 # Loc expr size113 .byte 163 # DW_OP_entry_value114 .byte 1 # 1115 .byte 85 # super-register DW_OP_reg5116 .byte 159 # DW_OP_stack_value117 .byte 0 # DW_LLE_end_of_list118.Ldebug_loc1:119 .byte 1 # DW_LLE_base_addressx120 .byte 2 # base address index121 .byte 4 # DW_LLE_offset_pair122 .uleb128 .Lfunc_begin1-.Lfunc_begin0 # starting offset123 .uleb128 .Ltmp2-.Lfunc_begin0 # ending offset124 .byte 1 # Loc expr size125 .byte 84 # DW_OP_reg4126 .byte 4 # DW_LLE_offset_pair127 .uleb128 .Ltmp2-.Lfunc_begin0 # starting offset128 .uleb128 .Lfunc_end1-.Lfunc_begin0 # ending offset129 .byte 4 # Loc expr size130 .byte 163 # DW_OP_entry_value131 .byte 1 # 1132 .byte 84 # DW_OP_reg4133 .byte 159 # DW_OP_stack_value134 .byte 0 # DW_LLE_end_of_list135.Ldebug_list_header_end0:136 .section .debug_abbrev,"",@progbits137 .byte 1 # Abbreviation Code138 .byte 74 # DW_TAG_skeleton_unit139 .byte 0 # DW_CHILDREN_no140 .byte 16 # DW_AT_stmt_list141 .byte 23 # DW_FORM_sec_offset142 .byte 114 # DW_AT_str_offsets_base143 .byte 23 # DW_FORM_sec_offset144 .byte 27 # DW_AT_comp_dir145 .byte 37 # DW_FORM_strx1146 .byte 118 # DW_AT_dwo_name147 .byte 37 # DW_FORM_strx1148 .byte 17 # DW_AT_low_pc149 .byte 27 # DW_FORM_addrx150 .byte 18 # DW_AT_high_pc151 .byte 6 # DW_FORM_data4152 .byte 115 # DW_AT_addr_base153 .byte 23 # DW_FORM_sec_offset154 .byte 0 # EOM(1)155 .byte 0 # EOM(2)156 .byte 0 # EOM(3)157 .section .debug_info,"",@progbits158.Lcu_begin0:159 .long .Ldebug_info_end0-.Ldebug_info_start0 # Length of Unit160.Ldebug_info_start0:161 .short 5 # DWARF version number162 .byte 4 # DWARF Unit Type163 .byte 8 # Address Size (in bytes)164 .long .debug_abbrev # Offset Into Abbrev. Section165 .quad 4593992475441569756166 .byte 1 # Abbrev [1] 0x14:0x14 DW_TAG_skeleton_unit167 .long .Lline_table_start0 # DW_AT_stmt_list168 .long .Lstr_offsets_base0 # DW_AT_str_offsets_base169 .byte 0 # DW_AT_comp_dir170 .byte 1 # DW_AT_dwo_name171 .byte 2 # DW_AT_low_pc172 .long .Lfunc_end1-.Lfunc_begin0 # DW_AT_high_pc173 .long .Laddr_table_base0 # DW_AT_addr_base174.Ldebug_info_end0:175 .section .debug_str_offsets,"",@progbits176 .long 12 # Length of String Offsets Set177 .short 5178 .short 0179.Lstr_offsets_base0:180 .section .debug_str,"MS",@progbits,1181.Lskel_string0:182 .asciz "." # string offset=0183.Lskel_string1:184 .asciz "main.dwo" # string offset=2185 .section .debug_str_offsets,"",@progbits186 .long .Lskel_string0187 .long .Lskel_string1188 .section .debug_str_offsets.dwo,"e",@progbits189 .long 60 # Length of String Offsets Set190 .short 5191 .short 0192 .section .debug_str.dwo,"eMS",@progbits,1193.Linfo_string0:194 .asciz "x" # string offset=0195.Linfo_string1:196 .asciz "int" # string offset=2197.Linfo_string2:198 .asciz "y" # string offset=6199.Linfo_string3:200 .asciz "_Z3usePiS_" # string offset=8201.Linfo_string4:202 .asciz "use" # string offset=19203.Linfo_string5:204 .asciz "_Z6helperii" # string offset=23205.Linfo_string6:206 .asciz "helper" # string offset=35207.Linfo_string7:208 .asciz "main" # string offset=42209.Linfo_string8:210 .asciz "argc" # string offset=47211.Linfo_string9:212 .asciz "argv" # string offset=52213.Linfo_string10:214 .asciz "char" # string offset=57215.Linfo_string11:216 .asciz "clang version 15.0.0" # string offset=62217.Linfo_string12:218 .asciz "main.cpp" # string offset=83219.Linfo_string13:220 .asciz "main.dwo" # string offset=92221 .section .debug_str_offsets.dwo,"e",@progbits222 .long 0223 .long 2224 .long 6225 .long 8226 .long 19227 .long 23228 .long 35229 .long 42230 .long 47231 .long 52232 .long 57233 .long 62234 .long 83235 .long 92236 .section .debug_info.dwo,"e",@progbits237 .long .Ldebug_info_dwo_end0-.Ldebug_info_dwo_start0 # Length of Unit238.Ldebug_info_dwo_start0:239 .short 5 # DWARF version number240 .byte 5 # DWARF Unit Type241 .byte 8 # Address Size (in bytes)242 .long 0 # Offset Into Abbrev. Section243 .quad 4593992475441569756244 .byte 1 # Abbrev [1] 0x14:0xae DW_TAG_compile_unit245 .byte 11 # DW_AT_producer246 .short 33 # DW_AT_language247 .byte 12 # DW_AT_name248 .byte 13 # DW_AT_dwo_name249 .byte 2 # Abbrev [2] 0x1a:0xb DW_TAG_variable250 .byte 0 # DW_AT_name251 .long 37 # DW_AT_type252 # DW_AT_external253 .byte 0 # DW_AT_decl_file254 .byte 7 # DW_AT_decl_line255 .byte 2 # DW_AT_location256 .byte 161257 .byte 0258 .byte 3 # Abbrev [3] 0x25:0x4 DW_TAG_base_type259 .byte 1 # DW_AT_name260 .byte 5 # DW_AT_encoding261 .byte 4 # DW_AT_byte_size262 .byte 2 # Abbrev [2] 0x29:0xb DW_TAG_variable263 .byte 2 # DW_AT_name264 .long 37 # DW_AT_type265 # DW_AT_external266 .byte 0 # DW_AT_decl_file267 .byte 8 # DW_AT_decl_line268 .byte 2 # DW_AT_location269 .byte 161270 .byte 1271 .byte 4 # Abbrev [4] 0x34:0x1b DW_TAG_subprogram272 .byte 2 # DW_AT_low_pc273 .long .Lfunc_end0-.Lfunc_begin0 # DW_AT_high_pc274 .byte 1 # DW_AT_frame_base275 .byte 87276 # DW_AT_call_all_calls277 .long 79 # DW_AT_abstract_origin278 .byte 5 # Abbrev [5] 0x40:0x7 DW_TAG_formal_parameter279 .byte 1 # DW_AT_location280 .byte 85281 .long 84 # DW_AT_abstract_origin282 .byte 5 # Abbrev [5] 0x47:0x7 DW_TAG_formal_parameter283 .byte 1 # DW_AT_location284 .byte 84285 .long 92 # DW_AT_abstract_origin286 .byte 0 # End Of Children Mark287 .byte 6 # Abbrev [6] 0x4f:0x16 DW_TAG_subprogram288 .byte 3 # DW_AT_linkage_name289 .byte 4 # DW_AT_name290 .byte 0 # DW_AT_decl_file291 .byte 1 # DW_AT_decl_line292 # DW_AT_external293 # DW_AT_inline294 .byte 7 # Abbrev [7] 0x54:0x8 DW_TAG_formal_parameter295 .byte 0 # DW_AT_name296 .byte 0 # DW_AT_decl_file297 .byte 1 # DW_AT_decl_line298 .long 101 # DW_AT_type299 .byte 7 # Abbrev [7] 0x5c:0x8 DW_TAG_formal_parameter300 .byte 2 # DW_AT_name301 .byte 0 # DW_AT_decl_file302 .byte 1 # DW_AT_decl_line303 .long 101 # DW_AT_type304 .byte 0 # End Of Children Mark305 .byte 8 # Abbrev [8] 0x65:0x5 DW_TAG_pointer_type306 .long 37 # DW_AT_type307 .byte 9 # Abbrev [9] 0x6a:0x35 DW_TAG_subprogram308 .byte 3 # DW_AT_low_pc309 .long .Lfunc_end1-.Lfunc_begin1 # DW_AT_high_pc310 .byte 1 # DW_AT_frame_base311 .byte 87312 # DW_AT_call_all_calls313 .byte 7 # DW_AT_name314 .byte 0 # DW_AT_decl_file315 .byte 9 # DW_AT_decl_line316 .long 37 # DW_AT_type317 # DW_AT_external318 .byte 10 # Abbrev [10] 0x79:0x9 DW_TAG_formal_parameter319 .byte 0 # DW_AT_location320 .byte 8 # DW_AT_name321 .byte 0 # DW_AT_decl_file322 .byte 9 # DW_AT_decl_line323 .long 37 # DW_AT_type324 .byte 10 # Abbrev [10] 0x82:0x9 DW_TAG_formal_parameter325 .byte 1 # DW_AT_location326 .byte 9 # DW_AT_name327 .byte 0 # DW_AT_decl_file328 .byte 9 # DW_AT_decl_line329 .long 179 # DW_AT_type330 .byte 11 # Abbrev [11] 0x8b:0xd DW_TAG_inlined_subroutine331 .long 79 # DW_AT_abstract_origin332 .byte 3 # DW_AT_low_pc333 .long .Ltmp3-.Lfunc_begin1 # DW_AT_high_pc334 .byte 0 # DW_AT_call_file335 .byte 12 # DW_AT_call_line336 .byte 4 # DW_AT_call_column337 .byte 12 # Abbrev [12] 0x98:0x6 DW_TAG_call_site338 .long 159 # DW_AT_call_origin339 # DW_AT_call_tail_call340 .byte 4 # DW_AT_call_pc341 .byte 0 # End Of Children Mark342 .byte 13 # Abbrev [13] 0x9f:0x14 DW_TAG_subprogram343 .byte 5 # DW_AT_linkage_name344 .byte 6 # DW_AT_name345 .byte 0 # DW_AT_decl_file346 .byte 6 # DW_AT_decl_line347 .long 37 # DW_AT_type348 # DW_AT_declaration349 # DW_AT_external350 .byte 14 # Abbrev [14] 0xa8:0x5 DW_TAG_formal_parameter351 .long 37 # DW_AT_type352 .byte 14 # Abbrev [14] 0xad:0x5 DW_TAG_formal_parameter353 .long 37 # DW_AT_type354 .byte 0 # End Of Children Mark355 .byte 8 # Abbrev [8] 0xb3:0x5 DW_TAG_pointer_type356 .long 184 # DW_AT_type357 .byte 8 # Abbrev [8] 0xb8:0x5 DW_TAG_pointer_type358 .long 189 # DW_AT_type359 .byte 3 # Abbrev [3] 0xbd:0x4 DW_TAG_base_type360 .byte 10 # DW_AT_name361 .byte 6 # DW_AT_encoding362 .byte 1 # DW_AT_byte_size363 .byte 0 # End Of Children Mark364.Ldebug_info_dwo_end0:365 .section .debug_abbrev.dwo,"e",@progbits366 .byte 1 # Abbreviation Code367 .byte 17 # DW_TAG_compile_unit368 .byte 1 # DW_CHILDREN_yes369 .byte 37 # DW_AT_producer370 .byte 37 # DW_FORM_strx1371 .byte 19 # DW_AT_language372 .byte 5 # DW_FORM_data2373 .byte 3 # DW_AT_name374 .byte 37 # DW_FORM_strx1375 .byte 118 # DW_AT_dwo_name376 .byte 37 # DW_FORM_strx1377 .byte 0 # EOM(1)378 .byte 0 # EOM(2)379 .byte 2 # Abbreviation Code380 .byte 52 # DW_TAG_variable381 .byte 0 # DW_CHILDREN_no382 .byte 3 # DW_AT_name383 .byte 37 # DW_FORM_strx1384 .byte 73 # DW_AT_type385 .byte 19 # DW_FORM_ref4386 .byte 63 # DW_AT_external387 .byte 25 # DW_FORM_flag_present388 .byte 58 # DW_AT_decl_file389 .byte 11 # DW_FORM_data1390 .byte 59 # DW_AT_decl_line391 .byte 11 # DW_FORM_data1392 .byte 2 # DW_AT_location393 .byte 24 # DW_FORM_exprloc394 .byte 0 # EOM(1)395 .byte 0 # EOM(2)396 .byte 3 # Abbreviation Code397 .byte 36 # DW_TAG_base_type398 .byte 0 # DW_CHILDREN_no399 .byte 3 # DW_AT_name400 .byte 37 # DW_FORM_strx1401 .byte 62 # DW_AT_encoding402 .byte 11 # DW_FORM_data1403 .byte 11 # DW_AT_byte_size404 .byte 11 # DW_FORM_data1405 .byte 0 # EOM(1)406 .byte 0 # EOM(2)407 .byte 4 # Abbreviation Code408 .byte 46 # DW_TAG_subprogram409 .byte 1 # DW_CHILDREN_yes410 .byte 17 # DW_AT_low_pc411 .byte 27 # DW_FORM_addrx412 .byte 18 # DW_AT_high_pc413 .byte 6 # DW_FORM_data4414 .byte 64 # DW_AT_frame_base415 .byte 24 # DW_FORM_exprloc416 .byte 122 # DW_AT_call_all_calls417 .byte 25 # DW_FORM_flag_present418 .byte 49 # DW_AT_abstract_origin419 .byte 19 # DW_FORM_ref4420 .byte 0 # EOM(1)421 .byte 0 # EOM(2)422 .byte 5 # Abbreviation Code423 .byte 5 # DW_TAG_formal_parameter424 .byte 0 # DW_CHILDREN_no425 .byte 2 # DW_AT_location426 .byte 24 # DW_FORM_exprloc427 .byte 49 # DW_AT_abstract_origin428 .byte 19 # DW_FORM_ref4429 .byte 0 # EOM(1)430 .byte 0 # EOM(2)431 .byte 6 # Abbreviation Code432 .byte 46 # DW_TAG_subprogram433 .byte 1 # DW_CHILDREN_yes434 .byte 110 # DW_AT_linkage_name435 .byte 37 # DW_FORM_strx1436 .byte 3 # DW_AT_name437 .byte 37 # DW_FORM_strx1438 .byte 58 # DW_AT_decl_file439 .byte 11 # DW_FORM_data1440 .byte 59 # DW_AT_decl_line441 .byte 11 # DW_FORM_data1442 .byte 63 # DW_AT_external443 .byte 25 # DW_FORM_flag_present444 .byte 32 # DW_AT_inline445 .byte 33 # DW_FORM_implicit_const446 .byte 1447 .byte 0 # EOM(1)448 .byte 0 # EOM(2)449 .byte 7 # Abbreviation Code450 .byte 5 # DW_TAG_formal_parameter451 .byte 0 # DW_CHILDREN_no452 .byte 3 # DW_AT_name453 .byte 37 # DW_FORM_strx1454 .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 0 # EOM(1)461 .byte 0 # EOM(2)462 .byte 8 # Abbreviation Code463 .byte 15 # DW_TAG_pointer_type464 .byte 0 # DW_CHILDREN_no465 .byte 73 # DW_AT_type466 .byte 19 # DW_FORM_ref4467 .byte 0 # EOM(1)468 .byte 0 # EOM(2)469 .byte 9 # Abbreviation Code470 .byte 46 # DW_TAG_subprogram471 .byte 1 # DW_CHILDREN_yes472 .byte 17 # DW_AT_low_pc473 .byte 27 # DW_FORM_addrx474 .byte 18 # DW_AT_high_pc475 .byte 6 # DW_FORM_data4476 .byte 64 # DW_AT_frame_base477 .byte 24 # DW_FORM_exprloc478 .byte 122 # DW_AT_call_all_calls479 .byte 25 # DW_FORM_flag_present480 .byte 3 # DW_AT_name481 .byte 37 # DW_FORM_strx1482 .byte 58 # DW_AT_decl_file483 .byte 11 # DW_FORM_data1484 .byte 59 # DW_AT_decl_line485 .byte 11 # DW_FORM_data1486 .byte 73 # DW_AT_type487 .byte 19 # DW_FORM_ref4488 .byte 63 # DW_AT_external489 .byte 25 # DW_FORM_flag_present490 .byte 0 # EOM(1)491 .byte 0 # EOM(2)492 .byte 10 # Abbreviation Code493 .byte 5 # DW_TAG_formal_parameter494 .byte 0 # DW_CHILDREN_no495 .byte 2 # DW_AT_location496 .byte 34 # DW_FORM_loclistx497 .byte 3 # DW_AT_name498 .byte 37 # DW_FORM_strx1499 .byte 58 # DW_AT_decl_file500 .byte 11 # DW_FORM_data1501 .byte 59 # DW_AT_decl_line502 .byte 11 # DW_FORM_data1503 .byte 73 # DW_AT_type504 .byte 19 # DW_FORM_ref4505 .byte 0 # EOM(1)506 .byte 0 # EOM(2)507 .byte 11 # Abbreviation Code508 .byte 29 # DW_TAG_inlined_subroutine509 .byte 0 # DW_CHILDREN_no510 .byte 49 # DW_AT_abstract_origin511 .byte 19 # DW_FORM_ref4512 .byte 17 # DW_AT_low_pc513 .byte 27 # DW_FORM_addrx514 .byte 18 # DW_AT_high_pc515 .byte 6 # DW_FORM_data4516 .byte 88 # DW_AT_call_file517 .byte 11 # DW_FORM_data1518 .byte 89 # DW_AT_call_line519 .byte 11 # DW_FORM_data1520 .byte 87 # DW_AT_call_column521 .byte 11 # DW_FORM_data1522 .byte 0 # EOM(1)523 .byte 0 # EOM(2)524 .byte 12 # Abbreviation Code525 .byte 72 # DW_TAG_call_site526 .byte 0 # DW_CHILDREN_no527 .byte 127 # DW_AT_call_origin528 .byte 19 # DW_FORM_ref4529 .ascii "\202\001" # DW_AT_call_tail_call530 .byte 25 # DW_FORM_flag_present531 .ascii "\201\001" # DW_AT_call_pc532 .byte 27 # DW_FORM_addrx533 .byte 0 # EOM(1)534 .byte 0 # EOM(2)535 .byte 13 # Abbreviation Code536 .byte 46 # DW_TAG_subprogram537 .byte 1 # DW_CHILDREN_yes538 .byte 110 # DW_AT_linkage_name539 .byte 37 # DW_FORM_strx1540 .byte 3 # DW_AT_name541 .byte 37 # DW_FORM_strx1542 .byte 58 # DW_AT_decl_file543 .byte 11 # DW_FORM_data1544 .byte 59 # DW_AT_decl_line545 .byte 11 # DW_FORM_data1546 .byte 73 # DW_AT_type547 .byte 19 # DW_FORM_ref4548 .byte 60 # DW_AT_declaration549 .byte 25 # DW_FORM_flag_present550 .byte 63 # DW_AT_external551 .byte 25 # DW_FORM_flag_present552 .byte 0 # EOM(1)553 .byte 0 # EOM(2)554 .byte 14 # Abbreviation Code555 .byte 5 # DW_TAG_formal_parameter556 .byte 0 # DW_CHILDREN_no557 .byte 73 # DW_AT_type558 .byte 19 # DW_FORM_ref4559 .byte 0 # EOM(1)560 .byte 0 # EOM(2)561 .byte 0 # EOM(3)562 .section .debug_addr,"",@progbits563 .long .Ldebug_addr_end0-.Ldebug_addr_start0 # Length of contribution564.Ldebug_addr_start0:565 .short 5 # DWARF version number566 .byte 8 # Address size567 .byte 0 # Segment selector size568.Laddr_table_base0:569 .quad x570 .quad y571 .quad .Lfunc_begin0572 .quad .Lfunc_begin1573 .quad .Ltmp4574.Ldebug_addr_end0:575 .ident "clang version 15.0.0"576 .section ".note.GNU-stack","",@progbits577 .section .debug_line,"",@progbits578.Lline_table_start0:579