[llvm-branch-commits] [cfe-branch] r120673 - /cfe/branches/Apple/whitney/lib/CodeGen/CGDebugInfo.cpp

Daniel Dunbar daniel at zuster.org
Wed Dec 1 18:52:39 PST 2010


Author: ddunbar
Date: Wed Dec  1 20:52:39 2010
New Revision: 120673

URL: http://llvm.org/viewvc/llvm-project?rev=120673&view=rev
Log:
Merge r120401:
--
Author: Douglas Gregor <dgregor at apple.com>
Date:   Tue Nov 30 06:38:09 2010 +0000

    Harden CGDebugInfo::CreateType() a bit for cases where we couldn't generate type info for its component types

Modified:
    cfe/branches/Apple/whitney/lib/CodeGen/CGDebugInfo.cpp

Modified: cfe/branches/Apple/whitney/lib/CodeGen/CGDebugInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/Apple/whitney/lib/CodeGen/CGDebugInfo.cpp?rev=120673&r1=120672&r2=120673&view=diff
==============================================================================
--- cfe/branches/Apple/whitney/lib/CodeGen/CGDebugInfo.cpp (original)
+++ cfe/branches/Apple/whitney/lib/CodeGen/CGDebugInfo.cpp Wed Dec  1 20:52:39 2010
@@ -1102,6 +1102,9 @@
 llvm::DIType CGDebugInfo::CreateType(const ObjCInterfaceType *Ty,
                                      llvm::DIFile Unit) {
   ObjCInterfaceDecl *ID = Ty->getDecl();
+  if (!ID)
+    return llvm::DIType();
+  
   unsigned Tag = llvm::dwarf::DW_TAG_structure_type;
 
   // Get overall information about the record type for the debug info.
@@ -1144,6 +1147,9 @@
   if (SClass) {
     llvm::DIType SClassTy =
       getOrCreateType(CGM.getContext().getObjCInterfaceType(SClass), Unit);
+    if (!SClassTy.isValid())
+      return llvm::DIType();
+    
     llvm::DIType InhTag =
       DebugFactory.CreateDerivedType(llvm::dwarf::DW_TAG_inheritance,
                                      Unit, "", Unit, 0, 0, 0,
@@ -1157,7 +1163,9 @@
   for (ObjCIvarDecl *Field = ID->all_declared_ivar_begin(); Field;
        Field = Field->getNextIvar(), ++FieldNo) {
     llvm::DIType FieldTy = getOrCreateType(Field->getType(), Unit);
-
+    if (!FieldTy.isValid())
+      return llvm::DIType();
+    
     llvm::StringRef FieldName = Field->getName();
 
     // Ignore unnamed fields.





More information about the llvm-branch-commits mailing list