[llvm-branch-commits] [llvm-branch] r86074 - in /llvm/branches/Apple/Leela/lib: Analysis/DebugInfo.cpp CodeGen/AsmPrinter/DwarfDebug.cpp

Bill Wendling isanbard at gmail.com
Wed Nov 4 15:52:21 PST 2009


Author: void
Date: Wed Nov  4 17:52:21 2009
New Revision: 86074

URL: http://llvm.org/viewvc/llvm-project?rev=86074&view=rev
Log:
$ svn merge -c 86073 https://llvm.org/svn/llvm-project/llvm/trunk
--- Merging r86073 into '.':
U    lib/Analysis/DebugInfo.cpp
U    lib/CodeGen/AsmPrinter/DwarfDebug.cpp


Modified:
    llvm/branches/Apple/Leela/lib/Analysis/DebugInfo.cpp
    llvm/branches/Apple/Leela/lib/CodeGen/AsmPrinter/DwarfDebug.cpp

Modified: llvm/branches/Apple/Leela/lib/Analysis/DebugInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/Apple/Leela/lib/Analysis/DebugInfo.cpp?rev=86074&r1=86073&r2=86074&view=diff

==============================================================================
--- llvm/branches/Apple/Leela/lib/Analysis/DebugInfo.cpp (original)
+++ llvm/branches/Apple/Leela/lib/Analysis/DebugInfo.cpp Wed Nov  4 17:52:21 2009
@@ -401,12 +401,18 @@
 /// getOriginalTypeSize - If this type is derived from a base type then
 /// return base type size.
 uint64_t DIDerivedType::getOriginalTypeSize() const {
-  DIType BT = getTypeDerivedFrom();
-  if (!BT.isNull() && BT.isDerivedType())
-    return DIDerivedType(BT.getNode()).getOriginalTypeSize();
-  if (BT.isNull())
-    return getSizeInBits();
-  return BT.getSizeInBits();
+  unsigned Tag = getTag();
+  if (Tag == dwarf::DW_TAG_member || Tag == dwarf::DW_TAG_typedef ||
+      Tag == dwarf::DW_TAG_const_type || Tag == dwarf::DW_TAG_volatile_type ||
+      Tag == dwarf::DW_TAG_restrict_type) {
+    DIType BaseType = getTypeDerivedFrom();
+    if (BaseType.isDerivedType())
+      return DIDerivedType(BaseType.getNode()).getOriginalTypeSize();
+    else
+      return BaseType.getSizeInBits();
+  }
+    
+  return getSizeInBits();
 }
 
 /// describes - Return true if this subprogram provides debugging

Modified: llvm/branches/Apple/Leela/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/Apple/Leela/lib/CodeGen/AsmPrinter/DwarfDebug.cpp?rev=86074&r1=86073&r2=86074&view=diff

==============================================================================
--- llvm/branches/Apple/Leela/lib/CodeGen/AsmPrinter/DwarfDebug.cpp (original)
+++ llvm/branches/Apple/Leela/lib/CodeGen/AsmPrinter/DwarfDebug.cpp Wed Nov  4 17:52:21 2009
@@ -1138,9 +1138,7 @@
   AddSourceLine(MemberDie, &DT);
 
   uint64_t Size = DT.getSizeInBits();
-  uint64_t FieldSize = Size;
-  if (DT.getTypeDerivedFrom().getTag() != dwarf::DW_TAG_array_type)
-    FieldSize = DT.getOriginalTypeSize();
+  uint64_t FieldSize = DT.getOriginalTypeSize();
 
   if (Size != FieldSize) {
     // Handle bitfield.





More information about the llvm-branch-commits mailing list