From 32b0f365a2f428e4f2b92f38474d1eccf70fd7d4 Mon Sep 17 00:00:00 2001 From: David Blaikie Date: Wed, 1 Oct 2014 00:56:55 +0000 Subject: Implement DW_TAG_subrange_type with DW_AT_count rather than DW_AT_upper_bound This allows proper disambiguation of unbounded arrays and arrays of zero bound ("struct foo { int x[]; };" and "struct foo { int x[0]; }"). GCC instead produces an upper bound of -1 in the latter situation, but count seems tidier. This way lower_bound is provided if it's not the language default and count is provided if the count is known, otherwise it's omitted. Simple. If someone wants to look at rdar://problem/12566646 and see if this change is acceptable to that bug/fix, that might be helpful (see the empty-and-one-elem-array.ll test case which cites that radar). llvm-svn: 218726 --- llvm/test/DebugInfo/X86/nondefault-subrange-array.ll | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'llvm/test/DebugInfo/X86/nondefault-subrange-array.ll') diff --git a/llvm/test/DebugInfo/X86/nondefault-subrange-array.ll b/llvm/test/DebugInfo/X86/nondefault-subrange-array.ll index 75728b5e192..dbf6cb6fecb 100644 --- a/llvm/test/DebugInfo/X86/nondefault-subrange-array.ll +++ b/llvm/test/DebugInfo/X86/nondefault-subrange-array.ll @@ -19,7 +19,7 @@ ; CHECK: DW_TAG_subrange_type ; CHECK-NEXT: DW_AT_type [DW_FORM_ref4] (cu + 0x{{[0-9a-f]*}} => {[[BASE2:0x[0-9a-f]*]]}) ; CHECK-NEXT: DW_AT_lower_bound [DW_FORM_data8] (0xfffffffffffffffd) -; CHECK-NEXT: DW_AT_upper_bound [DW_FORM_data1] (0x26) +; CHECK-NEXT: DW_AT_count [DW_FORM_data1] (0x2a) ; CHECK: [[BASE]]: DW_TAG_base_type ; CHECK: [[BASE2]]: DW_TAG_base_type -- cgit v1.2.3