2013-12-20 00:37:18 +00:00
|
|
|
; REQUIRES: object-emission
|
2013-12-18 21:48:19 +00:00
|
|
|
; Test (r)value qualifiers on C++11 non-static member functions.
|
|
|
|
; Generated from tools/clang/test/CodeGenCXX/debug-info-qualifiers.cpp
|
|
|
|
;
|
2013-12-19 01:41:16 +00:00
|
|
|
; class A {
|
|
|
|
; public:
|
|
|
|
; void l() const &;
|
|
|
|
; void r() const &&;
|
|
|
|
; };
|
|
|
|
;
|
|
|
|
; void g() {
|
|
|
|
; A a;
|
|
|
|
; auto pl = &A::l;
|
|
|
|
; auto pr = &A::r;
|
|
|
|
; }
|
|
|
|
;
|
2014-01-30 01:39:17 +00:00
|
|
|
; RUN: %llc_dwarf -filetype=obj -O0 < %s | llvm-dwarfdump - | FileCheck %s
|
2013-12-18 21:48:19 +00:00
|
|
|
; CHECK: DW_TAG_subroutine_type DW_CHILDREN_yes
|
|
|
|
; CHECK-NEXT: DW_AT_reference DW_FORM_flag_present
|
|
|
|
; CHECK: DW_TAG_subroutine_type DW_CHILDREN_yes
|
|
|
|
; CHECK-NEXT: DW_AT_rvalue_reference DW_FORM_flag_present
|
|
|
|
;
|
|
|
|
; CHECK: DW_TAG_subprogram
|
|
|
|
; CHECK-NOT: DW_TAG_subprogram
|
|
|
|
; CHECK: DW_AT_name {{.*}}"l"
|
|
|
|
; CHECK-NOT: DW_TAG_subprogram
|
|
|
|
; CHECK: DW_AT_reference [DW_FORM_flag_present] (true)
|
|
|
|
|
|
|
|
; CHECK: DW_TAG_subprogram
|
|
|
|
; CHECK-NOT: DW_TAG_subprogram
|
|
|
|
; CHECK: DW_AT_name {{.*}}"r"
|
|
|
|
; CHECK-NOT: DW_TAG_subprogram
|
|
|
|
; CHECK: DW_AT_rvalue_reference [DW_FORM_flag_present] (true)
|
|
|
|
|
|
|
|
%class.A = type { i8 }
|
|
|
|
|
|
|
|
; Function Attrs: nounwind
|
|
|
|
define void @_Z1gv() #0 {
|
|
|
|
%a = alloca %class.A, align 1
|
|
|
|
%pl = alloca { i64, i64 }, align 8
|
|
|
|
%pr = alloca { i64, i64 }, align 8
|
2014-10-02 22:15:31 +00:00
|
|
|
call void @llvm.dbg.declare(metadata !{%class.A* %a}, metadata !24, metadata !{i32 786690}), !dbg !25
|
|
|
|
call void @llvm.dbg.declare(metadata !{{ i64, i64 }* %pl}, metadata !26, metadata !{i32 786690}), !dbg !31
|
2013-12-18 21:48:19 +00:00
|
|
|
store { i64, i64 } { i64 ptrtoint (void (%class.A*)* @_ZNKR1A1lEv to i64), i64 0 }, { i64, i64 }* %pl, align 8, !dbg !31
|
2014-10-02 22:15:31 +00:00
|
|
|
call void @llvm.dbg.declare(metadata !{{ i64, i64 }* %pr}, metadata !32, metadata !{i32 786690}), !dbg !35
|
2013-12-18 21:48:19 +00:00
|
|
|
store { i64, i64 } { i64 ptrtoint (void (%class.A*)* @_ZNKO1A1rEv to i64), i64 0 }, { i64, i64 }* %pr, align 8, !dbg !35
|
|
|
|
ret void, !dbg !36
|
|
|
|
}
|
|
|
|
|
|
|
|
; Function Attrs: nounwind readnone
|
Move the complex address expression out of DIVariable and into an extra
argument of the llvm.dbg.declare/llvm.dbg.value intrinsics.
Previously, DIVariable was a variable-length field that has an optional
reference to a Metadata array consisting of a variable number of
complex address expressions. In the case of OpPiece expressions this is
wasting a lot of storage in IR, because when an aggregate type is, e.g.,
SROA'd into all of its n individual members, the IR will contain n copies
of the DIVariable, all alike, only differing in the complex address
reference at the end.
By making the complex address into an extra argument of the
dbg.value/dbg.declare intrinsics, all of the pieces can reference the
same variable and the complex address expressions can be uniqued across
the CU, too.
Down the road, this will allow us to move other flags, such as
"indirection" out of the DIVariable, too.
The new intrinsics look like this:
declare void @llvm.dbg.declare(metadata %storage, metadata %var, metadata %expr)
declare void @llvm.dbg.value(metadata %storage, i64 %offset, metadata %var, metadata %expr)
This patch adds a new LLVM-local tag to DIExpressions, so we can detect
and pretty-print DIExpression metadata nodes.
What this patch doesn't do:
This patch does not touch the "Indirect" field in DIVariable; but moving
that into the expression would be a natural next step.
http://reviews.llvm.org/D4919
rdar://problem/17994491
Thanks to dblaikie and dexonsmith for reviewing this patch!
Note: I accidentally committed a bogus older version of this patch previously.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@218787 91177308-0d34-0410-b5e6-96231b3b80d8
2014-10-01 18:55:02 +00:00
|
|
|
declare void @llvm.dbg.declare(metadata, metadata, metadata) #1
|
2013-12-18 21:48:19 +00:00
|
|
|
|
|
|
|
declare void @_ZNKR1A1lEv(%class.A*)
|
|
|
|
|
|
|
|
declare void @_ZNKO1A1rEv(%class.A*)
|
|
|
|
|
|
|
|
attributes #0 = { nounwind }
|
|
|
|
attributes #1 = { nounwind readnone }
|
|
|
|
|
|
|
|
!llvm.dbg.cu = !{!0}
|
|
|
|
!llvm.module.flags = !{!21, !22}
|
|
|
|
!llvm.ident = !{!23}
|
|
|
|
|
2014-10-02 22:15:31 +00:00
|
|
|
!0 = metadata !{i32 786449, metadata !1, i32 4, metadata !"clang version 3.5 ", i1 false, metadata !"", i32 0, metadata !2, metadata !3, metadata !16, metadata !2, metadata !2, metadata !""} ; [ DW_TAG_compile_unit ] [] [DW_LANG_C_plus_plus]
|
2013-12-18 21:48:19 +00:00
|
|
|
!1 = metadata !{metadata !"", metadata !""}
|
2014-02-04 01:23:52 +00:00
|
|
|
!2 = metadata !{}
|
2013-12-18 21:48:19 +00:00
|
|
|
!3 = metadata !{metadata !4}
|
2014-10-02 22:15:31 +00:00
|
|
|
!4 = metadata !{i32 786434, metadata !5, null, metadata !"A", i32 2, i64 8, i64 8, i32 0, i32 0, null, metadata !6, i32 0, null, null, metadata !"_ZTS1A"} ; [ DW_TAG_class_type ] [A] [line 2, size 8, align 8, offset 0] [def] [from ]
|
2013-12-18 21:48:19 +00:00
|
|
|
!5 = metadata !{metadata !"debug-info-qualifiers.cpp", metadata !""}
|
|
|
|
!6 = metadata !{metadata !7, metadata !13}
|
2014-10-02 22:15:31 +00:00
|
|
|
!7 = metadata !{i32 786478, metadata !5, metadata !"_ZTS1A", metadata !"l", metadata !"l", metadata !"_ZNKR1A1lEv", i32 5, metadata !8, i1 false, i1 false, i32 0, i32 0, null, i32 16640, i1 false, null, null, i32 0, metadata !12, i32 5} ; [ DW_TAG_subprogram ] [line 5] [reference] [l]
|
|
|
|
!8 = metadata !{i32 786453, i32 0, null, metadata !"", i32 0, i64 0, i64 0, i64 0, i32 16384, null, metadata !9, i32 0, null, null, null} ; [ DW_TAG_subroutine_type ] [line 0, size 0, align 0, offset 0] [reference] [from ]
|
2013-12-18 21:48:19 +00:00
|
|
|
!9 = metadata !{null, metadata !10}
|
2014-10-02 22:15:31 +00:00
|
|
|
!10 = metadata !{i32 786447, null, null, metadata !"", i32 0, i64 64, i64 64, i64 0, i32 1088, metadata !11} ; [ DW_TAG_pointer_type ] [line 0, size 64, align 64, offset 0] [artificial] [from ]
|
|
|
|
!11 = metadata !{i32 786470, null, null, metadata !"", i32 0, i64 0, i64 0, i64 0, i32 0, metadata !"_ZTS1A"} ; [ DW_TAG_const_type ] [line 0, size 0, align 0, offset 0] [from _ZTS1A]
|
2013-12-18 21:48:19 +00:00
|
|
|
!12 = metadata !{i32 786468}
|
2014-10-02 22:15:31 +00:00
|
|
|
!13 = metadata !{i32 786478, metadata !5, metadata !"_ZTS1A", metadata !"r", metadata !"r", metadata !"_ZNKO1A1rEv", i32 7, metadata !14, i1 false, i1 false, i32 0, i32 0, null, i32 33024, i1 false, null, null, i32 0, metadata !15, i32 7} ; [ DW_TAG_subprogram ] [line 7] [rvalue reference] [r]
|
|
|
|
!14 = metadata !{i32 786453, i32 0, null, metadata !"", i32 0, i64 0, i64 0, i64 0, i32 32768, null, metadata !9, i32 0, null, null, null} ; [ DW_TAG_subroutine_type ] [line 0, size 0, align 0, offset 0] [rvalue reference] [from ]
|
2013-12-18 21:48:19 +00:00
|
|
|
!15 = metadata !{i32 786468}
|
|
|
|
!16 = metadata !{metadata !17}
|
2014-10-02 22:15:31 +00:00
|
|
|
!17 = metadata !{i32 786478, metadata !5, metadata !18, metadata !"g", metadata !"g", metadata !"_Z1gv", i32 10, metadata !19, i1 false, i1 true, i32 0, i32 0, null, i32 256, i1 false, void ()* @_Z1gv, null, null, metadata !2, i32 10} ; [ DW_TAG_subprogram ] [line 10] [def] [g]
|
|
|
|
!18 = metadata !{i32 786473, metadata !5} ; [ DW_TAG_file_type ]
|
|
|
|
!19 = metadata !{i32 786453, i32 0, null, metadata !"", i32 0, i64 0, i64 0, i64 0, i32 0, null, metadata !20, i32 0, null, null, null} ; [ DW_TAG_subroutine_type ] [line 0, size 0, align 0, offset 0] [from ]
|
2013-12-18 21:48:19 +00:00
|
|
|
!20 = metadata !{null}
|
|
|
|
!21 = metadata !{i32 2, metadata !"Dwarf Version", i32 4}
|
2014-10-02 22:15:31 +00:00
|
|
|
!22 = metadata !{i32 1, metadata !"Debug Info Version", i32 1}
|
2013-12-18 21:48:19 +00:00
|
|
|
!23 = metadata !{metadata !"clang version 3.5 "}
|
2014-10-02 22:15:31 +00:00
|
|
|
!24 = metadata !{i32 786688, metadata !17, metadata !"a", metadata !18, i32 11, metadata !4, i32 0, i32 0} ; [ DW_TAG_auto_variable ] [a] [line 11]
|
2013-12-18 21:48:19 +00:00
|
|
|
!25 = metadata !{i32 11, i32 0, metadata !17, null}
|
2014-10-02 22:15:31 +00:00
|
|
|
!26 = metadata !{i32 786688, metadata !17, metadata !"pl", metadata !18, i32 16, metadata !27, i32 0, i32 0} ; [ DW_TAG_auto_variable ] [pl] [line 16]
|
|
|
|
!27 = metadata !{i32 786463, null, null, null, i32 0, i64 0, i64 0, i64 0, i32 0, metadata !28, metadata !"_ZTS1A"} ; [ DW_TAG_ptr_to_member_type ] [line 0, size 0, align 0, offset 0] [from ]
|
|
|
|
!28 = metadata !{i32 786453, i32 0, null, metadata !"", i32 0, i64 0, i64 0, i64 0, i32 16384, null, metadata !29, i32 0, null, null, null} ; [ DW_TAG_subroutine_type ] [line 0, size 0, align 0, offset 0] [reference] [from ]
|
2013-12-18 21:48:19 +00:00
|
|
|
!29 = metadata !{null, metadata !30}
|
2014-10-02 22:15:31 +00:00
|
|
|
!30 = metadata !{i32 786447, null, null, metadata !"", i32 0, i64 64, i64 64, i64 0, i32 1088, metadata !"_ZTS1A"} ; [ DW_TAG_pointer_type ] [line 0, size 64, align 64, offset 0] [artificial] [from _ZTS1A]
|
2013-12-18 21:48:19 +00:00
|
|
|
!31 = metadata !{i32 16, i32 0, metadata !17, null}
|
2014-10-02 22:15:31 +00:00
|
|
|
!32 = metadata !{i32 786688, metadata !17, metadata !"pr", metadata !18, i32 21, metadata !33, i32 0, i32 0} ; [ DW_TAG_auto_variable ] [pr] [line 21]
|
|
|
|
!33 = metadata !{i32 786463, null, null, null, i32 0, i64 0, i64 0, i64 0, i32 0, metadata !34, metadata !"_ZTS1A"} ; [ DW_TAG_ptr_to_member_type ] [line 0, size 0, align 0, offset 0] [from ]
|
|
|
|
!34 = metadata !{i32 786453, i32 0, null, metadata !"", i32 0, i64 0, i64 0, i64 0, i32 32768, null, metadata !29, i32 0, null, null, null} ; [ DW_TAG_subroutine_type ] [line 0, size 0, align 0, offset 0] [rvalue reference] [from ]
|
2013-12-18 21:48:19 +00:00
|
|
|
!35 = metadata !{i32 21, i32 0, metadata !17, null}
|
|
|
|
!36 = metadata !{i32 22, i32 0, metadata !17, null}
|