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

Bill Wendling isanbard at gmail.com
Sat Oct 31 02:05:08 PDT 2009


Author: void
Date: Sat Oct 31 04:05:06 2009
New Revision: 85646

URL: http://llvm.org/viewvc/llvm-project?rev=85646&view=rev
Log:
$ svn merge -c 85619 https://llvm.org/svn/llvm-project/llvm/trunk
--- Merging r85619 into '.':
U    lib/Analysis/DebugInfo.cpp
$ svn merge -c 85630 https://llvm.org/svn/llvm-project/llvm/trunk
--- Merging r85630 into '.':
G    lib/Analysis/DebugInfo.cpp


Modified:
    llvm/branches/Apple/Leela/lib/Analysis/DebugInfo.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=85646&r1=85645&r2=85646&view=diff

==============================================================================
--- llvm/branches/Apple/Leela/lib/Analysis/DebugInfo.cpp (original)
+++ llvm/branches/Apple/Leela/lib/Analysis/DebugInfo.cpp Sat Oct 31 04:05:06 2009
@@ -84,8 +84,11 @@
     return NULL;
 
   if (Elt < DbgNode->getNumElements())
-    if (MDString *MDS = dyn_cast_or_null<MDString>(DbgNode->getElement(Elt)))
+    if (MDString *MDS = dyn_cast_or_null<MDString>(DbgNode->getElement(Elt))) {
+      if (MDS->getLength() == 0)
+        return NULL;
       return MDS->getString().data();
+    }
 
   return NULL;
 }
@@ -398,10 +401,10 @@
 /// getOriginalTypeSize - If this type is derived from a base type then
 /// return base type size.
 uint64_t DIDerivedType::getOriginalTypeSize() const {
-  if (getTag() != dwarf::DW_TAG_member)
-    return getSizeInBits();
   DIType BT = getTypeDerivedFrom();
-  if (BT.getTag() != dwarf::DW_TAG_base_type)
+  if (!BT.isNull() && BT.isDerivedType())
+    return DIDerivedType(BT.getNode()).getOriginalTypeSize();
+  if (BT.isNull())
     return getSizeInBits();
   return BT.getSizeInBits();
 }





More information about the llvm-branch-commits mailing list