summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Blaikie <dblaikie@gmail.com>2014-04-03 06:28:20 +0000
committerDavid Blaikie <dblaikie@gmail.com>2014-04-03 06:28:20 +0000
commit1233d41ff47cc29aaa36e45d2afd6b68899efbef (patch)
tree8de04c76c1336a722a3690a82f1876c11ee66482
parent5a64ab6e032f81bb1d3d03cd957a37306b2b4b06 (diff)
downloadllvm-1233d41ff47cc29aaa36e45d2afd6b68899efbef.tar.gz
llvm-1233d41ff47cc29aaa36e45d2afd6b68899efbef.tar.bz2
llvm-1233d41ff47cc29aaa36e45d2afd6b68899efbef.tar.xz
DebugInfo: Use a 64 bit type for the subrange
While we were encoding 64 bit values (data8) in the subrange itself, using a 32 bit type for the subrange was still confusing the gdb. Oh, and make it unsigned too. As the comment points out, this could be pushed into the frontend so that it would be 32 or 64 bit as appropriate, etc. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@205512 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--lib/CodeGen/AsmPrinter/DwarfUnit.cpp8
-rw-r--r--test/DebugInfo/X86/empty-array.ll4
-rw-r--r--test/DebugInfo/X86/nondefault-subrange-array.ll6
3 files changed, 9 insertions, 9 deletions
diff --git a/lib/CodeGen/AsmPrinter/DwarfUnit.cpp b/lib/CodeGen/AsmPrinter/DwarfUnit.cpp
index 97f251086a..82e9bb008a 100644
--- a/lib/CodeGen/AsmPrinter/DwarfUnit.cpp
+++ b/lib/CodeGen/AsmPrinter/DwarfUnit.cpp
@@ -1766,12 +1766,12 @@ void DwarfUnit::constructArrayTypeDIE(DIE &Buffer, DICompositeType CTy) {
// as different languages may have different sizes for indexes.
DIE *IdxTy = getIndexTyDie();
if (!IdxTy) {
- // Construct an anonymous type for index type.
+ // Construct an integer type to use for indexes.
IdxTy = createAndAddDIE(dwarf::DW_TAG_base_type, *UnitDie);
- addString(IdxTy, dwarf::DW_AT_name, "int");
- addUInt(IdxTy, dwarf::DW_AT_byte_size, None, sizeof(int32_t));
+ addString(IdxTy, dwarf::DW_AT_name, "sizetype");
+ addUInt(IdxTy, dwarf::DW_AT_byte_size, None, sizeof(int64_t));
addUInt(IdxTy, dwarf::DW_AT_encoding, dwarf::DW_FORM_data1,
- dwarf::DW_ATE_signed);
+ dwarf::DW_ATE_unsigned);
setIndexTyDie(IdxTy);
}
diff --git a/test/DebugInfo/X86/empty-array.ll b/test/DebugInfo/X86/empty-array.ll
index 461b9da3ad..3fab313fe0 100644
--- a/test/DebugInfo/X86/empty-array.ll
+++ b/test/DebugInfo/X86/empty-array.ll
@@ -21,8 +21,8 @@
; CHECK: [[BASETYPE]]: DW_TAG_base_type
; CHECK: [[BASE2]]: DW_TAG_base_type
; CHECK-NEXT: DW_AT_name
-; CHECK-NEXT: DW_AT_byte_size [DW_FORM_data1] (0x04)
-; CHECK-NEXT: DW_AT_encoding [DW_FORM_data1] (0x05)
+; CHECK-NEXT: DW_AT_byte_size [DW_FORM_data1] (0x08)
+; CHECK-NEXT: DW_AT_encoding [DW_FORM_data1] (0x07)
!llvm.dbg.cu = !{!0}
!llvm.module.flags = !{!21}
diff --git a/test/DebugInfo/X86/nondefault-subrange-array.ll b/test/DebugInfo/X86/nondefault-subrange-array.ll
index b097578a6e..4df1bd4847 100644
--- a/test/DebugInfo/X86/nondefault-subrange-array.ll
+++ b/test/DebugInfo/X86/nondefault-subrange-array.ll
@@ -23,9 +23,9 @@
; CHECK: [[BASE]]: DW_TAG_base_type
; CHECK: [[BASE2]]: DW_TAG_base_type
-; CHECK-NEXT: DW_AT_name [DW_FORM_strp] ( .debug_str[0x{{[0-9a-f]*}}] = "int")
-; CHECK-NEXT: DW_AT_byte_size [DW_FORM_data1] (0x04)
-; CHECK-NEXT: DW_AT_encoding [DW_FORM_data1] (0x05)
+; CHECK-NEXT: DW_AT_name [DW_FORM_strp] ( .debug_str[0x{{[0-9a-f]*}}] = "sizetype")
+; CHECK-NEXT: DW_AT_byte_size [DW_FORM_data1] (0x08)
+; CHECK-NEXT: DW_AT_encoding [DW_FORM_data1] (0x07)
!llvm.dbg.cu = !{!0}
!llvm.module.flags = !{!21}