aboutsummaryrefslogtreecommitdiff
path: root/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
commitd7f6050113598797078f2718bc9f76c3ae35f0df (patch)
tree838b5684e4a2a209b2b06b06e66bafa9e02d0425 /lib/CodeGen/CGDebugInfo.cpp
parentb90585c3c65db9ab587674586602729edbd096aa (diff)
"Fix" PR3021, don't crash on generating record types when we can't
generate the type of a member. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@58889 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/CGDebugInfo.cpp')
-rw-r--r--lib/CodeGen/CGDebugInfo.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/lib/CodeGen/CGDebugInfo.cpp b/lib/CodeGen/CGDebugInfo.cpp
index 478f862775..08cd129b63 100644
--- a/lib/CodeGen/CGDebugInfo.cpp
+++ b/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.