llvm.org GIT mirror llvm / 1a57aa4
Update to current output. PR14039 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@193494 91177308-0d34-0410-b5e6-96231b3b80d8 Bill Wendling 5 years ago
1 changed file(s) with 68 addition(s) and 67 deletion(s). Raw diff Collapse all Expand all
649649
650650 .. code-block:: llvm
651651
652 define void @_Z3foov() #0 {
652 define void @foo() #0 {
653653 entry:
654 %X = alloca i32, align 4 ; [#uses=3 type=i32*]
655 %Y = alloca i32, align 4 ; [#uses=2 type=i32*]
656 %Z = alloca i32, align 4 ; [#uses=2 type=i32*]
657 call void @llvm.dbg.declare(metadata !{i32* %X}, metadata !8), !dbg !10
654 %X = alloca i32, align 4
655 %Y = alloca i32, align 4
656 %Z = alloca i32, align 4
657 call void @llvm.dbg.declare(metadata !{i32* %X}, metadata !10), !dbg !12
658658 ; [debug line = 2:7] [debug variable = X]
659 store i32 21, i32* %X, align 4, !dbg !11 ; [debug line = 2:13]
660 call void @llvm.dbg.declare(metadata !{i32* %Y}, metadata !12), !dbg !13
659 store i32 21, i32* %X, align 4, !dbg !12
660 call void @llvm.dbg.declare(metadata !{i32* %Y}, metadata !13), !dbg !14
661661 ; [debug line = 3:7] [debug variable = Y]
662 store i32 22, i32* %Y, align 4, !dbg !14 ; [debug line = 3:13]
662 store i32 22, i32* %Y, align 4, !dbg !14
663663 call void @llvm.dbg.declare(metadata !{i32* %Z}, metadata !15), !dbg !17
664664 ; [debug line = 5:9] [debug variable = Z]
665 store i32 23, i32* %Z, align 4, !dbg !18 ; [debug line = 5:15]
666 %0 = load i32* %X, align 4, !dbg !19 ; [#uses=1 type=i32] \
665 store i32 23, i32* %Z, align 4, !dbg !17
666 %0 = load i32* %X, align 4, !dbg !18
667667 [debug line = 6:5]
668 store i32 %0, i32* %Z, align 4, !dbg !19 ; [debug line = 6:5]
669 %1 = load i32* %Y, align 4, !dbg !20 ; [#uses=1 type=i32] \
668 store i32 %0, i32* %Z, align 4, !dbg !18
669 %1 = load i32* %Y, align 4, !dbg !19
670670 [debug line = 8:3]
671 store i32 %1, i32* %X, align 4, !dbg !20 ; [debug line = 8:3]
672 ret void, !dbg !21 ; [debug line = 9:1]
673 }
674
675 ; [#uses=3]
671 store i32 %1, i32* %X, align 4, !dbg !19
672 ret void, !dbg !20
673 }
674
676675 ; Function Attrs: nounwind readnone
677676 declare void @llvm.dbg.declare(metadata, metadata) #1
678677
679 attributes #0 = { optsize zeroext "less-precise-fpmad"="false"
680 "no-frame-pointer-elim"="true" "no-frame-pointer-elim-non-leaf"="true"
681 "no-infs-fp-math"="false" "no-nans-fp-math"="false" "unsafe-fp-math"="false"
678 attributes #0 = { nounwind ssp uwtable "less-precise-fpmad"="false"
679 "no-frame-pointer-elim"="true" "no-frame-pointer-elim-non-leaf"
680 "no-infs-fp-math"="false" "no-nans-fp-math"="false"
681 "stack-protector-buffer-size"="8" "unsafe-fp-math"="false"
682682 "use-soft-float"="false" }
683683 attributes #1 = { nounwind readnone }
684684
685685 !llvm.dbg.cu = !{!0}
686
686 !llvm.module.flags = !{!8}
687 !llvm.ident = !{!9}
688
687689 !0 = metadata !{i32 786449, metadata !1, i32 12,
688 metadata !"clang version 3.4 ", i1 false, metadata !"", i32 0,
689 metadata !2, metadata !2, metadata !3, metadata !2,
690 metadata !2, metadata !""} ; [ DW_TAG_compile_unit ] \
690 metadata !"clang version 3.4 (trunk 193128) (llvm/trunk 193139)",
691 i1 false, metadata !"", i32 0, metadata !2, metadata !2, metadata !3,
692 metadata !2, metadata !2, metadata !""} ; [ DW_TAG_compile_unit ] \
691693 [/private/tmp/foo.c] \
692 [DW_LANG_C]
693 !1 = metadata !{metadata !"foo.c", metadata !"/private/tmp"}
694 [DW_LANG_C99]
695 !1 = metadata !{metadata !"t.c", metadata !"/private/tmp"}
694696 !2 = metadata !{i32 0}
695697 !3 = metadata !{metadata !4}
696698 !4 = metadata !{i32 786478, metadata !1, metadata !5, metadata !"foo",
697 metadata !"foo", metadata !"_Z3foov", i32 1, metadata !6,
698 i1 false, i1 true, i32 0, i32 0, null, i32 256, i1 false,
699 void ()* @_Z3foov, null, null, metadata !2, i32 1}
699 metadata !"foo", metadata !"", i32 1, metadata !6,
700 i1 false, i1 true, i32 0, i32 0, null, i32 0, i1 false,
701 void ()* @foo, null, null, metadata !2, i32 1}
700702 ; [ DW_TAG_subprogram ] [line 1] [def] [foo]
701 !5 = metadata !{i32 786473, metadata !1} ; [ DW_TAG_file_type ] \
702 [/private/tmp/foo.c]
703 !6 = metadata !{i32 786453, i32 0, i32 0, metadata !"", i32 0, i64 0, i64 0,
704 i64 0, i32 0, null, metadata !7, i32 0, i32 0}
703 !5 = metadata !{i32 786473, metadata !1} ; [ DW_TAG_file_type ] \
704 [/private/tmp/t.c]
705 !6 = metadata !{i32 786453, i32 0, null, metadata !"", i32 0, i64 0, i64 0,
706 i64 0, i32 0, null, metadata !7, i32 0, null, null, null}
705707 ; [ DW_TAG_subroutine_type ] \
706708 [line 0, size 0, align 0, offset 0] [from ]
707709 !7 = metadata !{null}
708 !8 = metadata !{i32 786688, metadata !4, metadata !"X", metadata !5, i32 2, \
709 metadata !9, i32 0, i32 0} ; [ DW_TAG_auto_variable ] [X] \
710 [line 2]
711 !9 = metadata !{i32 786468, null, null, metadata !"int", i32 0, i64 32, \
712 i64 32, i64 0, i32 0, i32 5} ; [ DW_TAG_base_type ] [int] \
713 [line 0, size 32, align 32, offset 0, enc DW_ATE_signed]
714 !10 = metadata !{i32 2, i32 7, metadata !4, null}
715 !11 = metadata !{i32 2, i32 13, metadata !4, null}
716 !12 = metadata !{i32 786688, metadata !4, metadata !"Y", metadata !5, i32 3, \
717 metadata !9, i32 0, i32 0} ; [ DW_TAG_auto_variable ] [Y] \
710 !8 = metadata !{i32 2, metadata !"Dwarf Version", i32 2}
711 !9 = metadata !{metadata !"clang version 3.4 (trunk 193128) (llvm/trunk 193139)"}
712 !10 = metadata !{i32 786688, metadata !4, metadata !"X", metadata !5, i32 2,
713 metadata !11, i32 0, i32 0} ; [ DW_TAG_auto_variable ] [X] \
714 [line 2]
715 !11 = metadata !{i32 786468, null, null, metadata !"int", i32 0, i64 32,
716 i64 32, i64 0, i32 0, i32 5} ; [ DW_TAG_base_type ] [int] \
717 [line 0, size 32, align 32, offset 0, enc DW_ATE_signed]
718 !12 = metadata !{i32 2, i32 0, metadata !4, null}
719 !13 = metadata !{i32 786688, metadata !4, metadata !"Y", metadata !5, i32 3,
720 metadata !11, i32 0, i32 0} ; [ DW_TAG_auto_variable ] [Y] \
718721 [line 3]
719 !13 = metadata !{i32 3, i32 7, metadata !4, null}
720 !14 = metadata !{i32 3, i32 13, metadata !4, null}
721 !15 = metadata !{i32 786688, metadata !16, metadata !"Z", metadata !5, i32 5, \
722 metadata !9, i32 0, i32 0} ; [ DW_TAG_auto_variable ] [Z] \
722 !14 = metadata !{i32 3, i32 0, metadata !4, null}
723 !15 = metadata !{i32 786688, metadata !16, metadata !"Z", metadata !5, i32 5,
724 metadata !11, i32 0, i32 0} ; [ DW_TAG_auto_variable ] [Z] \
723725 [line 5]
724 !16 = metadata !{i32 786443, metadata !1, metadata !4, i32 4, i32 3, i32 0}
725 ; [ DW_TAG_lexical_block ] [/private/tmp/foo.c]
726 !17 = metadata !{i32 5, i32 9, metadata !16, null}
727 !18 = metadata !{i32 5, i32 15, metadata !16, null}
728 !19 = metadata !{i32 6, i32 5, metadata !16, null}
729 !20 = metadata !{i32 8, i32 3, metadata !4, null}
730 !21 = metadata !{i32 9, i32 1, metadata !4, null}
726 !16 = metadata !{i32 786443, metadata !1, metadata !4, i32 4, i32 0, i32 0} \
727 ; [ DW_TAG_lexical_block ] [/private/tmp/t.c]
728 !17 = metadata !{i32 5, i32 0, metadata !16, null}
729 !18 = metadata !{i32 6, i32 0, metadata !16, null}
730 !19 = metadata !{i32 8, i32 0, metadata !4, null} ; [ DW_TAG_imported_declaration ]
731 !20 = metadata !{i32 9, i32 0, metadata !4, null}
731732
732733 This example illustrates a few important details about LLVM debugging
733734 information. In particular, it shows how the ``llvm.dbg.declare`` intrinsic and
737738
738739 .. code-block:: llvm
739740
740 call void @llvm.dbg.declare(metadata !{i32* %X}, metadata !8), !dbg !10
741 call void @llvm.dbg.declare(metadata !{i32* %X}, metadata !10), !dbg !12
741742 ; [debug line = 2:7] [debug variable = X]
742743
743744 The first intrinsic ``%llvm.dbg.declare`` encodes debugging information for the
744 variable ``X``. The metadata ``!dbg !10`` attached to the intrinsic provides
745 variable ``X``. The metadata ``!dbg !12`` attached to the intrinsic provides
745746 scope information for the variable ``X``.
746747
747748 .. code-block:: llvm
748749
749 !10 = metadata !{i32 2, i32 7, metadata !4, null}
750 !12 = metadata !{i32 2, i32 0, metadata !4, null}
750751 !4 = metadata !{i32 786478, metadata !1, metadata !5, metadata !"foo",
751 metadata !"foo", metadata !"_Z3foov", i32 1, metadata !6,
752 i1 false, i1 true, i32 0, i32 0, null, i32 256, i1 false,
753 void ()* @_Z3foov, null, null, metadata !2, i32 1}
754 ; [ DW_TAG_subprogram ] [line 1] [def] [foo]
755
756 Here ``!10`` is metadata providing location information. It has four fields:
752 metadata !"foo", metadata !"", i32 1, metadata !6,
753 i1 false, i1 true, i32 0, i32 0, null, i32 0, i1 false,
754 void ()* @foo, null, null, metadata !2, i32 1}
755 ; [ DW_TAG_subprogram ] [line 1] [def] [foo]
756
757 Here ``!12`` is metadata providing location information. It has four fields:
757758 line number, column number, scope, and original scope. The original scope
758759 represents inline location if this instruction is inlined inside a caller, and
759760 is null otherwise. In this example, scope is encoded by ``!4``, a
774775
775776 .. code-block:: llvm
776777
777 !16 = metadata !{i32 786443, metadata !1, metadata !4, i32 4, i32 3, i32 0}
778 ; [ DW_TAG_lexical_block ] [/private/tmp/foo.c]
779 !17 = metadata !{i32 5, i32 9, metadata !16, null}
778 !16 = metadata !{i32 786443, metadata !1, metadata !4, i32 4, i32 0, i32 0}
779 ; [ DW_TAG_lexical_block ] [/private/tmp/t.c]
780 !17 = metadata !{i32 5, i32 0, metadata !16, null}
780781
781782 Here ``!15`` indicates that ``Z`` is declared at line number 5 and
782 column number 9 inside of lexical scope ``!16``. The lexical scope itself
783 column number 0 inside of lexical scope ``!16``. The lexical scope itself
783784 resides inside of subprogram ``!4`` described above.
784785
785786 The scope information attached with each instruction provides a straightforward