[cfe-commits] r58889 - in /cfe/trunk: lib/CodeGen/CGDebugInfo.cpp test/CodeGen/PR3021-debug-info-and-typeof.c
Daniel Dunbar
daniel at zuster.org
Fri Nov 7 20:42:30 PST 2008
Author: ddunbar
Date: Fri Nov 7 22:42:29 2008
New Revision: 58889
URL: http://llvm.org/viewvc/llvm-project?rev=58889&view=rev
Log:
"Fix" PR3021, don't crash on generating record types when we can't
generate the type of a member.
Added:
cfe/trunk/test/CodeGen/PR3021-debug-info-and-typeof.c
Modified:
cfe/trunk/lib/CodeGen/CGDebugInfo.cpp
Modified: cfe/trunk/lib/CodeGen/CGDebugInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGDebugInfo.cpp?rev=58889&r1=58888&r2=58889&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/CGDebugInfo.cpp (original)
+++ cfe/trunk/lib/CodeGen/CGDebugInfo.cpp Fri Nov 7 22:42:29 2008
@@ -363,6 +363,7 @@
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 @@
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.
Added: cfe/trunk/test/CodeGen/PR3021-debug-info-and-typeof.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/PR3021-debug-info-and-typeof.c?rev=58889&view=auto
==============================================================================
--- cfe/trunk/test/CodeGen/PR3021-debug-info-and-typeof.c (added)
+++ cfe/trunk/test/CodeGen/PR3021-debug-info-and-typeof.c Fri Nov 7 22:42:29 2008
@@ -0,0 +1,5 @@
+// RUN: clang -o %t --emit-llvm -g %s
+
+void convert(void) {
+ struct { typeof(0) f0; } v0;
+}
More information about the cfe-commits
mailing list