summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen/CGDebugInfo.cpp
diff options
context:
space:
mode:
authorDaniel Dunbar <daniel@zuster.org>2008-11-08 04:42:29 +0000
committerDaniel Dunbar <daniel@zuster.org>2008-11-08 04:42:29 +0000
commit8ec8048f937600c65ef21f8aa9e32e327e99dd54 (patch)
treecd42f5d1a106549e770e55ac11e59497d9135124 /clang/lib/CodeGen/CGDebugInfo.cpp
parentad0a0f9cd2842987894ae58b0a8cab099bf8eb5f (diff)
downloadbcm5719-llvm-8ec8048f937600c65ef21f8aa9e32e327e99dd54.tar.gz
bcm5719-llvm-8ec8048f937600c65ef21f8aa9e32e327e99dd54.zip
"Fix" PR3021, don't crash on generating record types when we can't
generate the type of a member. llvm-svn: 58889
Diffstat (limited to 'clang/lib/CodeGen/CGDebugInfo.cpp')
-rw-r--r--clang/lib/CodeGen/CGDebugInfo.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/clang/lib/CodeGen/CGDebugInfo.cpp b/clang/lib/CodeGen/CGDebugInfo.cpp
index 478f862775e..08cd129b63f 100644
--- a/clang/lib/CodeGen/CGDebugInfo.cpp
+++ b/clang/lib/CodeGen/CGDebugInfo.cpp
@@ -363,6 +363,7 @@ CGDebugInfo::getOrCreateFunctionType(QualType type, llvm::CompileUnitDesc *Unit)
for (unsigned int i =0; i < FTPro->getNumArgs(); i++) {
QualType ParamType = FTPro->getArgType(i);
ArgTy = getOrCreateType(ParamType, Unit);
+ // FIXME: Remove once we support all types.
if (ArgTy) Elements.push_back(ArgTy);
}
}
@@ -407,8 +408,11 @@ void CGDebugInfo::getOrCreateRecordType(QualType type,
for (int i = 0; i < NumMembers; i++) {
FieldDecl *Member = RecDecl->getMember(i);
llvm::TypeDesc *MemberTy = getOrCreateType(Member->getType(), Unit);
- MemberTy->setOffset(RL.getFieldOffset(i));
- Elements.push_back(MemberTy);
+ // FIXME: Remove once we support all types.
+ if (MemberTy) {
+ MemberTy->setOffset(RL.getFieldOffset(i));
+ Elements.push_back(MemberTy);
+ }
}
// Fill in the blanks.
OpenPOWER on IntegriCloud