[llvm] r205512 - DebugInfo: Use a 64 bit type for the subrange

David Blaikie dblaikie at gmail.com
Wed Apr 2 23:28:20 PDT 2014


Author: dblaikie
Date: Thu Apr  3 01:28:20 2014
New Revision: 205512

URL: http://llvm.org/viewvc/llvm-project?rev=205512&view=rev
Log:
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.

Modified:
    llvm/trunk/lib/CodeGen/AsmPrinter/DwarfUnit.cpp
    llvm/trunk/test/DebugInfo/X86/empty-array.ll
    llvm/trunk/test/DebugInfo/X86/nondefault-subrange-array.ll

Modified: llvm/trunk/lib/CodeGen/AsmPrinter/DwarfUnit.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/AsmPrinter/DwarfUnit.cpp?rev=205512&r1=205511&r2=205512&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/AsmPrinter/DwarfUnit.cpp (original)
+++ llvm/trunk/lib/CodeGen/AsmPrinter/DwarfUnit.cpp Thu Apr  3 01:28:20 2014
@@ -1766,12 +1766,12 @@ void DwarfUnit::constructArrayTypeDIE(DI
   // 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);
   }
 

Modified: llvm/trunk/test/DebugInfo/X86/empty-array.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/DebugInfo/X86/empty-array.ll?rev=205512&r1=205511&r2=205512&view=diff
==============================================================================
--- llvm/trunk/test/DebugInfo/X86/empty-array.ll (original)
+++ llvm/trunk/test/DebugInfo/X86/empty-array.ll Thu Apr  3 01:28:20 2014
@@ -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}

Modified: llvm/trunk/test/DebugInfo/X86/nondefault-subrange-array.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/DebugInfo/X86/nondefault-subrange-array.ll?rev=205512&r1=205511&r2=205512&view=diff
==============================================================================
--- llvm/trunk/test/DebugInfo/X86/nondefault-subrange-array.ll (original)
+++ llvm/trunk/test/DebugInfo/X86/nondefault-subrange-array.ll Thu Apr  3 01:28:20 2014
@@ -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}





More information about the llvm-commits mailing list