From 9493dae613847b01b79914502f337814fe3e00ac Mon Sep 17 00:00:00 2001 From: Bill Wendling Date: Tue, 4 Dec 2012 21:34:03 +0000 Subject: [PATCH] Use the 'count' attribute to calculate the upper bound of an array. The count attribute is more accurate with regards to the size of an array. It also obviates the upper bound attribute in the subrange. We can also better handle an unbound array by setting the count to -1 instead of the lower bound to 1 and upper bound to 0. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@169312 91177308-0d34-0410-b5e6-96231b3b80d8 --- include/llvm/DIBuilder.h | 2 +- include/llvm/DebugInfo.h | 3 +- lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp | 29 ++++++++++--------- lib/VMCore/DIBuilder.cpp | 4 +-- lib/VMCore/DebugInfo.cpp | 6 +++- test/CodeGen/ARM/debug-info-branch-folding.ll | 2 +- test/CodeGen/ARM/debug-info-qreg.ll | 2 +- .../CodeGen/Thumb/2010-07-15-debugOrdering.ll | 2 +- test/CodeGen/X86/2009-02-12-DebugInfoVLA.ll | 2 +- test/CodeGen/X86/2010-07-06-DbgCrash.ll | 2 +- test/CodeGen/X86/2012-11-30-misched-dbg.ll | 2 +- test/CodeGen/X86/dbg-at-specficiation.ll | 2 +- test/CodeGen/X86/dbg-declare.ll | 2 +- test/CodeGen/X86/dbg-subrange.ll | 2 +- .../2010-03-30-InvalidDbgInfoCrash.ll | 2 +- test/DebugInfo/2010-05-03-OriginDIE.ll | 2 +- .../DebugInfo/X86/empty-and-one-elem-array.ll | 5 ++-- test/DebugInfo/X86/empty-array.ll | 3 +- test/DebugInfo/X86/op_deref.ll | 2 +- test/DebugInfo/array.ll | 2 +- test/JitListener/test-common-symbols.ll | 2 +- test/JitListener/test-inline.ll | 2 +- test/JitListener/test-parameters.ll | 2 +- 23 files changed, 44 insertions(+), 40 deletions(-) diff --git a/include/llvm/DIBuilder.h b/include/llvm/DIBuilder.h index 72566322e12..f6bc7b12ec7 100644 --- a/include/llvm/DIBuilder.h +++ b/include/llvm/DIBuilder.h @@ -371,7 +371,7 @@ namespace llvm { /// getOrCreateSubrange - Create a descriptor for a value range. This /// implicitly uniques the values returned. - DISubrange getOrCreateSubrange(int64_t Lo, int64_t Hi, int64_t Count); + DISubrange getOrCreateSubrange(int64_t Lo, int64_t Count); /// createGlobalVariable - Create a new descriptor for the specified global. /// @param Name Name of the variable. diff --git a/include/llvm/DebugInfo.h b/include/llvm/DebugInfo.h index 70b1ef37ce0..8601f5532b3 100644 --- a/include/llvm/DebugInfo.h +++ b/include/llvm/DebugInfo.h @@ -143,8 +143,7 @@ namespace llvm { explicit DISubrange(const MDNode *N = 0) : DIDescriptor(N) {} uint64_t getLo() const { return getUInt64Field(1); } - uint64_t getHi() const { return getUInt64Field(2); } - int64_t getCount() const { return getInt64Field(3); } + int64_t getCount() const { return getInt64Field(2); } }; /// DIArray - This descriptor holds an array of descriptors. diff --git a/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp b/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp index f5f36e461f1..c8807079491 100644 --- a/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp +++ b/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp @@ -1250,24 +1250,25 @@ void CompileUnit::constructSubrangeDIE(DIE &Buffer, DISubrange SR, DIE *IndexTy) { DIE *DW_Subrange = new DIE(dwarf::DW_TAG_subrange_type); addDIEEntry(DW_Subrange, dwarf::DW_AT_type, dwarf::DW_FORM_ref4, IndexTy); - uint64_t L = SR.getLo(); - uint64_t H = SR.getHi(); - int64_t Count = SR.getCount(); // The L value defines the lower bounds which is typically zero for C/C++. The - // H value is the upper bounds. Values are 64 bit. H - L + 1 is the size - // of the array. If L > H then do not emit DW_AT_lower_bound and - // DW_AT_upper_bound attributes. If L is zero and H is also zero then the - // array has one element and in such case do not emit lower bound. + // Count value is the number of elements. Values are 64 bit. If Count == -1 + // then the array is unbounded and we do not emit DW_AT_lower_bound and + // DW_AT_upper_bound attributes. If L == 0 and Count == 0, then the array has + // zero elements in which case we do not emit an upper bound. + uint64_t L = SR.getLo(); + int64_t Count = SR.getCount(); - if (L > H) { - Buffer.addChild(DW_Subrange); - return; + if (Count != -1) { + // FIXME: An unbounded array should reference the expression that defines + // the array. + if (L) + addUInt(DW_Subrange, dwarf::DW_AT_lower_bound, 0, L); + + if (Count != 0) + addUInt(DW_Subrange, dwarf::DW_AT_upper_bound, 0, Count - 1); } - if (L) - addUInt(DW_Subrange, dwarf::DW_AT_lower_bound, 0, L); - if (H > 0 || Count != 0) - addUInt(DW_Subrange, dwarf::DW_AT_upper_bound, 0, H); + Buffer.addChild(DW_Subrange); } diff --git a/lib/VMCore/DIBuilder.cpp b/lib/VMCore/DIBuilder.cpp index 2b77edc7f99..b3bbde86c54 100644 --- a/lib/VMCore/DIBuilder.cpp +++ b/lib/VMCore/DIBuilder.cpp @@ -741,12 +741,10 @@ DIArray DIBuilder::getOrCreateArray(ArrayRef Elements) { /// getOrCreateSubrange - Create a descriptor for a value range. This /// implicitly uniques the values returned. -DISubrange DIBuilder::getOrCreateSubrange(int64_t Lo, int64_t Hi, - int64_t Count) { +DISubrange DIBuilder::getOrCreateSubrange(int64_t Lo, int64_t Count) { Value *Elts[] = { GetTagConstant(VMContext, dwarf::DW_TAG_subrange_type), ConstantInt::get(Type::getInt64Ty(VMContext), Lo), - ConstantInt::get(Type::getInt64Ty(VMContext), Hi), ConstantInt::get(Type::getInt64Ty(VMContext), Count) }; diff --git a/lib/VMCore/DebugInfo.cpp b/lib/VMCore/DebugInfo.cpp index 73eb92ee846..0b43cc0beba 100644 --- a/lib/VMCore/DebugInfo.cpp +++ b/lib/VMCore/DebugInfo.cpp @@ -1049,7 +1049,11 @@ void DIDescriptor::print(raw_ostream &OS) const { } void DISubrange::printInternal(raw_ostream &OS) const { - OS << " [" << getLo() << ", " << getHi() << ']'; + int64_t Count = getCount(); + if (Count != -1) + OS << " [" << getLo() << ", " << Count - 1 << ']'; + else + OS << " [unbound]"; } void DIScope::printInternal(raw_ostream &OS) const { diff --git a/test/CodeGen/ARM/debug-info-branch-folding.ll b/test/CodeGen/ARM/debug-info-branch-folding.ll index 52076ada858..a3a1fc0b2f8 100644 --- a/test/CodeGen/ARM/debug-info-branch-folding.ll +++ b/test/CodeGen/ARM/debug-info-branch-folding.ll @@ -52,7 +52,7 @@ declare void @llvm.dbg.value(metadata, i64, metadata) nounwind readnone !6 = metadata !{i32 590083, metadata !2, metadata !"", metadata !2, i32 0, i64 128, i64 128, i32 0, i32 0, metadata !7, metadata !8, i32 0, i32 0} ; [ DW_TAG_vector_type ] !7 = metadata !{i32 589860, metadata !2, metadata !"float", null, i32 0, i64 32, i64 32, i64 0, i32 0, i32 4} ; [ DW_TAG_base_type ] !8 = metadata !{metadata !9} -!9 = metadata !{i32 589857, i64 0, i64 3, i64 4} ; [ DW_TAG_subrange_type ] +!9 = metadata !{i32 589857, i64 0, i64 4} ; [ DW_TAG_subrange_type ] !10 = metadata !{i32 589870, i32 0, metadata !1, metadata !"main", metadata !"main", metadata !"", metadata !1, i32 59, metadata !11, i1 false, i1 true, i32 0, i32 0, i32 0, i32 256, i1 true, i32 (i32, i8**, i1)* @main, null} ; [ DW_TAG_subprogram ] !11 = metadata !{i32 589845, metadata !1, metadata !"", metadata !1, i32 0, i64 0, i64 0, i32 0, i32 0, i32 0, metadata !12, i32 0, i32 0} ; [ DW_TAG_subroutine_type ] !12 = metadata !{metadata !13} diff --git a/test/CodeGen/ARM/debug-info-qreg.ll b/test/CodeGen/ARM/debug-info-qreg.ll index 7e925c1d020..c6bfe3a25e2 100644 --- a/test/CodeGen/ARM/debug-info-qreg.ll +++ b/test/CodeGen/ARM/debug-info-qreg.ll @@ -49,7 +49,7 @@ declare void @llvm.dbg.value(metadata, i64, metadata) nounwind readnone !6 = metadata !{i32 590083, metadata !2, metadata !"", metadata !2, i32 0, i64 128, i64 128, i32 0, i32 0, metadata !7, metadata !8, i32 0, i32 0} ; [ DW_TAG_vector_type ] !7 = metadata !{i32 589860, metadata !2, metadata !"float", null, i32 0, i64 32, i64 32, i64 0, i32 0, i32 4} ; [ DW_TAG_base_type ] !8 = metadata !{metadata !9} -!9 = metadata !{i32 589857, i64 0, i64 3, i64 4} ; [ DW_TAG_subrange_type ] +!9 = metadata !{i32 589857, i64 0, i64 4} ; [ DW_TAG_subrange_type ] !10 = metadata !{i32 589870, i32 0, metadata !1, metadata !"main", metadata !"main", metadata !"", metadata !1, i32 59, metadata !11, i1 false, i1 true, i32 0, i32 0, i32 0, i32 256, i1 true, i32 (i32, i8**)* @main, null} ; [ DW_TAG_subprogram ] !11 = metadata !{i32 589845, metadata !1, metadata !"", metadata !1, i32 0, i64 0, i64 0, i32 0, i32 0, i32 0, metadata !12, i32 0, i32 0} ; [ DW_TAG_subroutine_type ] !12 = metadata !{metadata !13} diff --git a/test/CodeGen/Thumb/2010-07-15-debugOrdering.ll b/test/CodeGen/Thumb/2010-07-15-debugOrdering.ll index 84a5cfa94ec..498c78165eb 100644 --- a/test/CodeGen/Thumb/2010-07-15-debugOrdering.ll +++ b/test/CodeGen/Thumb/2010-07-15-debugOrdering.ll @@ -61,7 +61,7 @@ declare void @llvm.dbg.value(metadata, i64, metadata) nounwind readnone !12 = metadata !{i32 524289, metadata !4, metadata !"", metadata !4, i32 0, i64 192, i64 32, i64 0, i32 0, metadata !13, metadata !14, i32 0, null} ; [ DW_TAG_array_type ] !13 = metadata !{i32 524324, metadata !4, metadata !"double", metadata !4, i32 0, i64 64, i64 32, i64 0, i32 0, i32 4} ; [ DW_TAG_base_type ] !14 = metadata !{metadata !15} -!15 = metadata !{i32 524321, i64 0, i64 2, i64 3} ; [ DW_TAG_subrange_type ] +!15 = metadata !{i32 524321, i64 0, i64 3} ; [ DW_TAG_subrange_type ] !16 = metadata !{i32 524334, i32 0, metadata !8, metadata !"ggVector3", metadata !"ggVector3", metadata !"", metadata !9, i32 72, metadata !17, i1 false, i1 false, i32 0, i32 0, null, i1 false, i1 false, null} ; [ DW_TAG_subprogram ] !17 = metadata !{i32 524309, metadata !4, metadata !"", metadata !4, i32 0, i64 0, i64 0, i64 0, i32 0, null, metadata !18, i32 0, null} ; [ DW_TAG_subroutine_type ] !18 = metadata !{null, metadata !19, metadata !20} diff --git a/test/CodeGen/X86/2009-02-12-DebugInfoVLA.ll b/test/CodeGen/X86/2009-02-12-DebugInfoVLA.ll index 57c9ea78fa8..890fd0f067c 100644 --- a/test/CodeGen/X86/2009-02-12-DebugInfoVLA.ll +++ b/test/CodeGen/X86/2009-02-12-DebugInfoVLA.ll @@ -78,7 +78,7 @@ declare void @llvm.stackrestore(i8*) nounwind !9 = metadata !{i32 458767, metadata !2, metadata !"", metadata !2, i32 0, i64 64, i64 64, i64 0, i32 64, metadata !10} ; [ DW_TAG_pointer_type ] !10 = metadata !{i32 458753, metadata !2, metadata !"", metadata !2, i32 0, i64 8, i64 8, i64 0, i32 0, metadata !5, metadata !11, i32 0, null} ; [ DW_TAG_array_type ] !11 = metadata !{metadata !12} -!12 = metadata !{i32 458785, i64 0, i64 0, i64 1} ; [ DW_TAG_subrange_type ] +!12 = metadata !{i32 458785, i64 0, i64 1} ; [ DW_TAG_subrange_type ] !13 = metadata !{i32 3, i32 0, metadata !14, null} !14 = metadata !{i32 458763, metadata !1, i32 0, i32 0} ; [ DW_TAG_lexical_block ] !15 = metadata !{i32 4, i32 0, metadata !14, null} diff --git a/test/CodeGen/X86/2010-07-06-DbgCrash.ll b/test/CodeGen/X86/2010-07-06-DbgCrash.ll index 7b18cc7a7c4..208e93e098e 100644 --- a/test/CodeGen/X86/2010-07-06-DbgCrash.ll +++ b/test/CodeGen/X86/2010-07-06-DbgCrash.ll @@ -16,7 +16,7 @@ !103 = metadata !{i32 524299, metadata !97, i32 73, i32 0} ; [ DW_TAG_lexical_block ] !104 = metadata !{i32 524289, metadata !38, metadata !"", metadata !38, i32 0, i64 85312, i64 64, i64 0, i32 0, metadata !46, metadata !105, i32 0, null} ; [ DW_TAG_array_type ] !105 = metadata !{metadata !106} -!106 = metadata !{i32 524321, i64 0, i64 1332, i64 1333} ; [ DW_TAG_subrange_type ] +!106 = metadata !{i32 524321, i64 0, i64 1333} ; [ DW_TAG_subrange_type ] !107 = metadata !{i32 73, i32 0, metadata !103, null} define i32 @main() nounwind ssp { diff --git a/test/CodeGen/X86/2012-11-30-misched-dbg.ll b/test/CodeGen/X86/2012-11-30-misched-dbg.ll index c498203980d..c1432400678 100644 --- a/test/CodeGen/X86/2012-11-30-misched-dbg.ll +++ b/test/CodeGen/X86/2012-11-30-misched-dbg.ll @@ -82,4 +82,4 @@ declare i32 @__sprintf_chk(i8*, i32, i64, i8*, ...) !15 = metadata !{i32 786433, null, metadata !"", null, i32 0, i64 160, i64 8, i32 0, i32 0, metadata !16, metadata !17, i32 0, i32 0} ; [ DW_TAG_array_type ] [line 0, size 160, align 8, offset 0] [from char] !16 = metadata !{i32 786468, null, metadata !"char", null, i32 0, i64 8, i64 8, i64 0, i32 0, i32 6} ; [ DW_TAG_base_type ] [char] [line 0, size 8, align 8, offset 0, enc DW_ATE_signed_char] !17 = metadata !{metadata !18} -!18 = metadata !{i32 786465, i64 0, i64 19} ; [ DW_TAG_subrange_type ] [0, 19] +!18 = metadata !{i32 786465, i64 0, i64 20} ; [ DW_TAG_subrange_type ] [0, 19] diff --git a/test/CodeGen/X86/dbg-at-specficiation.ll b/test/CodeGen/X86/dbg-at-specficiation.ll index cbd1e82c450..48b8202bd5f 100644 --- a/test/CodeGen/X86/dbg-at-specficiation.ll +++ b/test/CodeGen/X86/dbg-at-specficiation.ll @@ -17,4 +17,4 @@ !7 = metadata !{i32 720897, null, metadata !"", null, i32 0, i64 320, i64 32, i32 0, i32 0, metadata !8, metadata !9, i32 0, i32 0} ; [ DW_TAG_array_type ] !8 = metadata !{i32 720932, null, metadata !"int", null, i32 0, i64 32, i64 32, i64 0, i32 0, i32 5} ; [ DW_TAG_base_type ] !9 = metadata !{metadata !10} -!10 = metadata !{i32 720929, i64 0, i64 9, i64 10} ; [ DW_TAG_subrange_type ] +!10 = metadata !{i32 720929, i64 0, i64 10} ; [ DW_TAG_subrange_type ] diff --git a/test/CodeGen/X86/dbg-declare.ll b/test/CodeGen/X86/dbg-declare.ll index c948f6cfc89..b73e310cc54 100644 --- a/test/CodeGen/X86/dbg-declare.ll +++ b/test/CodeGen/X86/dbg-declare.ll @@ -51,7 +51,7 @@ declare void @llvm.stackrestore(i8*) nounwind !19 = metadata !{i32 786433, null, metadata !"", null, i32 0, i64 0, i64 8, i32 0, i32 0, metadata !20, metadata !21, i32 0, i32 0} ; [ DW_TAG_array_type ] !20 = metadata !{i32 786468, null, metadata !"char", null, i32 0, i64 8, i64 8, i64 0, i32 0, i32 6} ; [ DW_TAG_base_type ] !21 = metadata !{metadata !22} -!22 = metadata !{i32 786465, i64 1, i64 0, i64 -1} ; [ DW_TAG_subrange_type ] +!22 = metadata !{i32 786465, i64 0, i64 -1} ; [ DW_TAG_subrange_type ] !23 = metadata !{i32 7, i32 8, metadata !17, null} !24 = metadata !{i32 9, i32 1, metadata !17, null} !25 = metadata !{i32 8, i32 3, metadata !17, null} diff --git a/test/CodeGen/X86/dbg-subrange.ll b/test/CodeGen/X86/dbg-subrange.ll index 5ef79162d9a..0efb50e9a97 100644 --- a/test/CodeGen/X86/dbg-subrange.ll +++ b/test/CodeGen/X86/dbg-subrange.ll @@ -31,7 +31,7 @@ entry: !14 = metadata !{i32 720897, null, metadata !"", null, i32 0, i64 34359738368, i64 8, i32 0, i32 0, metadata !15, metadata !16, i32 0, i32 0} ; [ DW_TAG_array_type ] !15 = metadata !{i32 720932, null, metadata !"char", null, i32 0, i64 8, i64 8, i64 0, i32 0, i32 6} ; [ DW_TAG_base_type ] !16 = metadata !{metadata !17} -!17 = metadata !{i32 720929, i64 0, i64 4294967295, i64 4294967296} ; [ DW_TAG_subrange_type ] +!17 = metadata !{i32 720929, i64 0, i64 4294967296} ; [ DW_TAG_subrange_type ] !18 = metadata !{i32 5, i32 3, metadata !19, null} !19 = metadata !{i32 720907, metadata !5, i32 4, i32 1, metadata !6, i32 0} ; [ DW_TAG_lexical_block ] !20 = metadata !{i32 6, i32 1, metadata !19, null} diff --git a/test/DebugInfo/2010-03-30-InvalidDbgInfoCrash.ll b/test/DebugInfo/2010-03-30-InvalidDbgInfoCrash.ll index fdb904faab6..accdf8a86cb 100644 --- a/test/DebugInfo/2010-03-30-InvalidDbgInfoCrash.ll +++ b/test/DebugInfo/2010-03-30-InvalidDbgInfoCrash.ll @@ -25,6 +25,6 @@ declare void @llvm.dbg.declare(metadata, metadata) nounwind readnone !14 = metadata !{i32 524289, metadata !4, metadata !"", metadata !4, i32 0, i64 8, i64 8, i64 0, i32 0, metadata !15, metadata !16, i32 0, null} ; [ DW_TAG_array_type ] !15 = metadata !{i32 524324, metadata !4, metadata !"char", metadata !4, i32 0, i64 8, i64 8, i64 0, i32 0, i32 6} ; [ DW_TAG_base_type ] !16 = metadata !{metadata !17} -!17 = metadata !{i32 524321, i64 0, i64 0, i64 1} ; [ DW_TAG_subrange_type ] +!17 = metadata !{i32 524321, i64 0, i64 1} ; [ DW_TAG_subrange_type ] !18 = metadata !{metadata !"llvm.mdnode.fwdref.19"} !19 = metadata !{metadata !"llvm.mdnode.fwdref.23"} diff --git a/test/DebugInfo/2010-05-03-OriginDIE.ll b/test/DebugInfo/2010-05-03-OriginDIE.ll index 62f7600d7c8..1ade0450463 100644 --- a/test/DebugInfo/2010-05-03-OriginDIE.ll +++ b/test/DebugInfo/2010-05-03-OriginDIE.ll @@ -81,6 +81,6 @@ declare void @uuid_LtoB(i8*, i8*) !30 = metadata !{i32 524310, metadata !3, metadata !"uint32_t", metadata !12, i32 55, i64 0, i64 0, i64 0, i32 0, metadata !31} ; [ DW_TAG_typedef ] !31 = metadata !{i32 524324, metadata !3, metadata !"unsigned int", metadata !3, i32 0, i64 32, i64 32, i64 0, i32 0, i32 7} ; [ DW_TAG_base_type ] !32 = metadata !{metadata !33} -!33 = metadata !{i32 524321, i64 0, i64 1, i64 2} ; [ DW_TAG_subrange_type ] +!33 = metadata !{i32 524321, i64 0, i64 2} ; [ DW_TAG_subrange_type ] !34 = metadata !{i32 524544, metadata !24, metadata !"addr", metadata !10, i32 96, metadata !35} ; [ DW_TAG_auto_variable ] !35 = metadata !{i32 524303, metadata !3, metadata !"", metadata !3, i32 0, i64 32, i64 32, i64 0, i32 0, metadata !11} ; [ DW_TAG_pointer_type ] diff --git a/test/DebugInfo/X86/empty-and-one-elem-array.ll b/test/DebugInfo/X86/empty-and-one-elem-array.ll index 2b7a7eac8e8..b9224b1fdea 100644 --- a/test/DebugInfo/X86/empty-and-one-elem-array.ll +++ b/test/DebugInfo/X86/empty-and-one-elem-array.ll @@ -50,6 +50,7 @@ declare void @llvm.dbg.declare(metadata, metadata) nounwind readnone ; CHECK-NEXT: 0x000000b2: DW_AT_type [DW_FORM_ref4] (cu + 0x0074 => {0x00000074}) ; CHECK: 0x000000b6: DW_TAG_subrange_type [11] ; CHECK-NEXT: 0x000000b7: DW_AT_type [DW_FORM_ref4] (cu + 0x007b => {0x0000007b}) +; CHECK-NOT: DW_AT_upper_bound ; int bar::b[0]: ; CHECK: 0x000000d3: DW_TAG_member [10] @@ -76,7 +77,7 @@ declare void @llvm.dbg.declare(metadata, metadata) nounwind readnone !15 = metadata !{i32 786445, metadata !12, metadata !"b", metadata !6, i32 3, i64 32, i64 32, i64 32, i32 0, metadata !16} ; [ DW_TAG_member ] [b] [line 3, size 32, align 32, offset 32] [from ] !16 = metadata !{i32 786433, null, metadata !"", null, i32 0, i64 32, i64 32, i32 0, i32 0, metadata !9, metadata !17, i32 0, i32 0} ; [ DW_TAG_array_type ] [line 0, size 32, align 32, offset 0] [from int] !17 = metadata !{metadata !18} -!18 = metadata !{i32 786465, i64 0, i64 0, i64 1} ; [ DW_TAG_subrange_type ] [0, 0] +!18 = metadata !{i32 786465, i64 0, i64 1} ; [ DW_TAG_subrange_type ] [0, 1] !19 = metadata !{i32 12, i32 0, metadata !11, null} !20 = metadata !{i32 786688, metadata !11, metadata !"my_bar", metadata !6, i32 13, metadata !21, i32 0, i32 0} ; [ DW_TAG_auto_variable ] [my_bar] [line 13] !21 = metadata !{i32 786451, null, metadata !"bar", metadata !6, i32 6, i64 32, i64 32, i32 0, i32 0, null, metadata !22, i32 0, i32 0, i32 0} ; [ DW_TAG_structure_type ] [bar] [line 6, size 32, align 32, offset 0] [from ] @@ -85,7 +86,7 @@ declare void @llvm.dbg.declare(metadata, metadata) nounwind readnone !24 = metadata !{i32 786445, metadata !21, metadata !"b", metadata !6, i32 8, i64 0, i64 32, i64 32, i32 0, metadata !25} ; [ DW_TAG_member ] [b] [line 8, size 0, align 32, offset 32] [from ] !25 = metadata !{i32 786433, null, metadata !"", null, i32 0, i64 0, i64 32, i32 0, i32 0, metadata !9, metadata !26, i32 0, i32 0} ; [ DW_TAG_array_type ] [line 0, size 0, align 32, offset 0] [from int] !26 = metadata !{metadata !27} -!27 = metadata !{i32 786465, i64 0, i64 0, i64 0} ; [ DW_TAG_subrange_type ] [0, 0] +!27 = metadata !{i32 786465, i64 0, i64 0} ; [ DW_TAG_subrange_type ] [0, 0] !28 = metadata !{i32 13, i32 0, metadata !11, null} !29 = metadata !{i32 15, i32 0, metadata !11, null} !30 = metadata !{i32 16, i32 0, metadata !11, null} diff --git a/test/DebugInfo/X86/empty-array.ll b/test/DebugInfo/X86/empty-array.ll index 7258af2f3d4..cd968478ab8 100644 --- a/test/DebugInfo/X86/empty-array.ll +++ b/test/DebugInfo/X86/empty-array.ll @@ -15,6 +15,7 @@ ; CHECK: 0x00000035: DW_TAG_subrange_type [5] ; CHECK-NEXT: 0x00000036: DW_AT_type [DW_FORM_ref4] (cu + 0x002d => {0x0000002d}) +; CHECK-NOT: DW_AT_upper_bound ; CHECK: 0x00000048: DW_TAG_member [8] ; CHECK-NEXT: 0x00000049: DW_AT_name [DW_FORM_strp] ( .debug_str[0x0000003f] = "x") @@ -35,7 +36,7 @@ !10 = metadata !{i32 786433, null, metadata !"", null, i32 0, i64 0, i64 32, i32 0, i32 0, metadata !11, metadata !12, i32 0, i32 0} ; [ DW_TAG_array_type ] [line 0, size 0, align 32, offset 0] [from int] !11 = metadata !{i32 786468, null, metadata !"int", null, i32 0, i64 32, i64 32, i64 0, i32 0, i32 5} ; [ DW_TAG_base_type ] [int] [line 0, size 32, align 32, offset 0, enc DW_ATE_signed] !12 = metadata !{metadata !13} -!13 = metadata !{i32 786465, i64 1, i64 0, i64 -1} ; [ DW_TAG_subrange_type ] [1, 0] +!13 = metadata !{i32 786465, i64 0, i64 -1} ; [ DW_TAG_subrange_type ] [unbound] !14 = metadata !{i32 786478, i32 0, metadata !7, metadata !"A", metadata !"A", metadata !"", metadata !6, i32 1, metadata !15, i1 false, i1 false, i32 0, i32 0, null, i32 320, i1 false, null, null, i32 0, metadata !18, i32 1} ; [ DW_TAG_subprogram ] [line 1] [A] !15 = metadata !{i32 786453, i32 0, metadata !"", i32 0, i32 0, i64 0, i64 0, i64 0, i32 0, null, metadata !16, i32 0, i32 0} ; [ DW_TAG_subroutine_type ] [line 0, size 0, align 0, offset 0] [from ] !16 = metadata !{null, metadata !17} diff --git a/test/DebugInfo/X86/op_deref.ll b/test/DebugInfo/X86/op_deref.ll index c84b2e6931f..b0b09e74f1a 100644 --- a/test/DebugInfo/X86/op_deref.ll +++ b/test/DebugInfo/X86/op_deref.ll @@ -76,7 +76,7 @@ declare void @llvm.stackrestore(i8*) nounwind !14 = metadata !{i32 786688, metadata !13, metadata !"vla", metadata !6, i32 3, metadata !15, i32 0, i32 0, i64 2} ; [ DW_TAG_auto_variable ] !15 = metadata !{i32 786433, null, metadata !"", null, i32 0, i64 0, i64 32, i32 0, i32 0, metadata !9, metadata !16, i32 0, i32 0} ; [ DW_TAG_array_type ] !16 = metadata !{metadata !17} -!17 = metadata !{i32 786465, i64 1, i64 0} ; [ DW_TAG_subrange_type ] +!17 = metadata !{i32 786465, i64 0, i64 -1} ; [ DW_TAG_subrange_type ] !18 = metadata !{i32 3, i32 7, metadata !13, null} !19 = metadata !{i32 786688, metadata !13, metadata !"i", metadata !6, i32 4, metadata !9, i32 0, i32 0} ; [ DW_TAG_auto_variable ] !20 = metadata !{i32 4, i32 7, metadata !13, null} diff --git a/test/DebugInfo/array.ll b/test/DebugInfo/array.ll index fef8fbe4cf4..d1671ad2fd2 100644 --- a/test/DebugInfo/array.ll +++ b/test/DebugInfo/array.ll @@ -29,6 +29,6 @@ declare void @llvm.dbg.declare(metadata, metadata) nounwind readnone ;CHECK-NOT: DW_AT_lower_bound ;CHECK-NOT: DW_AT_upper_bound ;CHECK-NEXT: End Of Children Mark -!10 = metadata !{i32 589857, i64 1, i64 0, i64 -1} ; [ DW_TAG_subrange_type ] +!10 = metadata !{i32 589857, i64 0, i64 -1} ; [ DW_TAG_subrange_type ] !11 = metadata !{i32 4, i32 7, metadata !7, null} !12 = metadata !{i32 5, i32 3, metadata !7, null} diff --git a/test/JitListener/test-common-symbols.ll b/test/JitListener/test-common-symbols.ll index b6640435872..bc94bda9a41 100644 --- a/test/JitListener/test-common-symbols.ll +++ b/test/JitListener/test-common-symbols.ll @@ -97,7 +97,7 @@ declare void @llvm.dbg.declare(metadata, metadata) nounwind readnone !17 = metadata !{i32 720948, i32 0, null, metadata !"zero_arr", metadata !"zero_arr", metadata !"", metadata !6, i32 3, metadata !18, i32 0, i32 1, [10 x i32]* @zero_arr} ; [ DW_TAG_variable ] !18 = metadata !{i32 720897, null, metadata !"", null, i32 0, i64 320, i64 32, i32 0, i32 0, metadata !9, metadata !19, i32 0, i32 0} ; [ DW_TAG_array_type ] !19 = metadata !{metadata !20} -!20 = metadata !{i32 720929, i64 0, i64 9, i64 10} ; [ DW_TAG_subrange_type ] +!20 = metadata !{i32 720929, i64 0, i64 10} ; [ DW_TAG_subrange_type ] !21 = metadata !{i32 7, i32 5, metadata !22, null} !22 = metadata !{i32 720907, metadata !5, i32 6, i32 1, metadata !6, i32 0} ; [ DW_TAG_lexical_block ] !23 = metadata !{i32 9, i32 5, metadata !22, null} diff --git a/test/JitListener/test-inline.ll b/test/JitListener/test-inline.ll index 6da3a038b02..8bfaeafa108 100644 --- a/test/JitListener/test-inline.ll +++ b/test/JitListener/test-inline.ll @@ -154,7 +154,7 @@ declare void @llvm.memcpy.p0i8.p0i8.i64(i8* nocapture, i8* nocapture, i64, i32, !24 = metadata !{i32 720909, metadata !20, metadata !"c2", metadata !6, i32 24, i64 16, i64 8, i64 8, i32 0, metadata !25} ; [ DW_TAG_member ] !25 = metadata !{i32 720897, null, metadata !"", null, i32 0, i64 16, i64 8, i32 0, i32 0, metadata !23, metadata !26, i32 0, i32 0} ; [ DW_TAG_array_type ] !26 = metadata !{metadata !27} -!27 = metadata !{i32 720929, i64 0, i64 1, i64 2} ; [ DW_TAG_subrange_type ] +!27 = metadata !{i32 720929, i64 0, i64 2} ; [ DW_TAG_subrange_type ] !28 = metadata !{i32 720942, i32 0, metadata !20, metadata !"char_struct", metadata !"char_struct", metadata !"", metadata !6, i32 22, metadata !29, i1 false, i1 false, i32 0, i32 0, null, i32 320, i1 false, null, null, i32 0, metadata !10} ; [ DW_TAG_subprogram ] !29 = metadata !{i32 720917, i32 0, metadata !"", i32 0, i32 0, i64 0, i64 0, i32 0, i32 0, i32 0, metadata !30, i32 0, i32 0} ; [ DW_TAG_subroutine_type ] !30 = metadata !{null, metadata !31} diff --git a/test/JitListener/test-parameters.ll b/test/JitListener/test-parameters.ll index a53c0809e17..0c437a81818 100644 --- a/test/JitListener/test-parameters.ll +++ b/test/JitListener/test-parameters.ll @@ -144,7 +144,7 @@ declare void @llvm.memcpy.p0i8.p0i8.i64(i8* nocapture, i8* nocapture, i64, i32, !24 = metadata !{i32 720909, metadata !20, metadata !"c2", metadata !6, i32 24, i64 16, i64 8, i64 8, i32 0, metadata !25} ; [ DW_TAG_member ] !25 = metadata !{i32 720897, null, metadata !"", null, i32 0, i64 16, i64 8, i32 0, i32 0, metadata !23, metadata !26, i32 0, i32 0} ; [ DW_TAG_array_type ] !26 = metadata !{metadata !27} -!27 = metadata !{i32 720929, i64 0, i64 1, i64 2} ; [ DW_TAG_subrange_type ] +!27 = metadata !{i32 720929, i64 0, i64 2} ; [ DW_TAG_subrange_type ] !28 = metadata !{i32 720942, i32 0, metadata !20, metadata !"char_struct", metadata !"char_struct", metadata !"", metadata !6, i32 22, metadata !29, i1 false, i1 false, i32 0, i32 0, null, i32 320, i1 false, null, null, i32 0, metadata !10} ; [ DW_TAG_subprogram ] !29 = metadata !{i32 720917, i32 0, metadata !"", i32 0, i32 0, i64 0, i64 0, i32 0, i32 0, i32 0, metadata !30, i32 0, i32 0} ; [ DW_TAG_subroutine_type ] !30 = metadata !{null, metadata !31}