[llvm-branch-commits] [llvm-branch] r86271 - in /llvm/branches/Apple/Leela: lib/Analysis/DebugInfo.cpp test/DebugInfo/2009-11-06-InvalideDerivedType.ll

Devang Patel dpatel at apple.com
Fri Nov 6 10:33:54 PST 2009


Author: dpatel
Date: Fri Nov  6 12:33:53 2009
New Revision: 86271

URL: http://llvm.org/viewvc/llvm-project?rev=86271&view=rev
Log:
Merge r86269 from trunk.

Added:
    llvm/branches/Apple/Leela/test/DebugInfo/2009-11-06-InvalideDerivedType.ll
      - copied unchanged from r86269, llvm/trunk/test/DebugInfo/2009-11-06-InvalideDerivedType.ll
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=86271&r1=86270&r2=86271&view=diff

==============================================================================
--- llvm/branches/Apple/Leela/lib/Analysis/DebugInfo.cpp (original)
+++ llvm/branches/Apple/Leela/lib/Analysis/DebugInfo.cpp Fri Nov  6 12:33:53 2009
@@ -409,6 +409,10 @@
       Tag == dwarf::DW_TAG_const_type || Tag == dwarf::DW_TAG_volatile_type ||
       Tag == dwarf::DW_TAG_restrict_type) {
     DIType BaseType = getTypeDerivedFrom();
+    // If this type is not derived from any type then take conservative 
+    // approach.
+    if (BaseType.isNull())
+      return getSizeInBits();
     if (BaseType.isDerivedType())
       return DIDerivedType(BaseType.getNode()).getOriginalTypeSize();
     else





More information about the llvm-branch-commits mailing list