diff options
| author | Douglas Gregor <dgregor@apple.com> | 2010-11-30 06:38:09 +0000 |
|---|---|---|
| committer | Douglas Gregor <dgregor@apple.com> | 2010-11-30 06:38:09 +0000 |
| commit | 2f53a0bbf2b84e1192fb8dbf580afcf8901bda9c (patch) | |
| tree | 31b38ad9294e7613c8180c368565a75249eff913 /clang | |
| parent | e3ea1cba791e269c5b78072ad28f69d02c703973 (diff) | |
| download | bcm5719-llvm-2f53a0bbf2b84e1192fb8dbf580afcf8901bda9c.tar.gz bcm5719-llvm-2f53a0bbf2b84e1192fb8dbf580afcf8901bda9c.zip | |
Harden CGDebugInfo::CreateType() a bit for cases where we couldn't generate type info for its component types
llvm-svn: 120401
Diffstat (limited to 'clang')
| -rw-r--r-- | clang/lib/CodeGen/CGDebugInfo.cpp | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/clang/lib/CodeGen/CGDebugInfo.cpp b/clang/lib/CodeGen/CGDebugInfo.cpp index f01690665c6..d532214cc96 100644 --- a/clang/lib/CodeGen/CGDebugInfo.cpp +++ b/clang/lib/CodeGen/CGDebugInfo.cpp @@ -1103,6 +1103,9 @@ llvm::DIType CGDebugInfo::CreateType(const ObjCObjectType *Ty, 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. @@ -1145,6 +1148,9 @@ llvm::DIType CGDebugInfo::CreateType(const ObjCInterfaceType *Ty, 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, @@ -1158,7 +1164,9 @@ llvm::DIType CGDebugInfo::CreateType(const ObjCInterfaceType *Ty, 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. |

