[llvm-branch-commits] [llvm-branch] r86900 - /llvm/branches/Apple/Leela-M1/lib/Analysis/DebugInfo.cpp

Bill Wendling isanbard at gmail.com
Wed Nov 11 15:40:14 PST 2009


Author: void
Date: Wed Nov 11 17:40:14 2009
New Revision: 86900

URL: http://llvm.org/viewvc/llvm-project?rev=86900&view=rev
Log:
$ svn merge -c 86074 https://llvm.org/svn/llvm-project/llvm/branches/Apple/Leela
--- Merging r86074 into '.':
U    lib/Analysis/DebugInfo.cpp


Modified:
    llvm/branches/Apple/Leela-M1/lib/Analysis/DebugInfo.cpp

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

==============================================================================
--- llvm/branches/Apple/Leela-M1/lib/Analysis/DebugInfo.cpp (original)
+++ llvm/branches/Apple/Leela-M1/lib/Analysis/DebugInfo.cpp Wed Nov 11 17:40:14 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





More information about the llvm-branch-commits mailing list