diff options
| author | Adrian Prantl <aprantl@apple.com> | 2014-02-04 21:29:50 +0000 |
|---|---|---|
| committer | Adrian Prantl <aprantl@apple.com> | 2014-02-04 21:29:50 +0000 |
| commit | 381e75589db9e5df3b9363fe794f9c0dd04b1ca8 (patch) | |
| tree | 7852fd1caf04ffd125be90f5ac46af003bee77b5 /clang/lib/CodeGen | |
| parent | df82c62fcf5221800b63271286962581316cdc51 (diff) | |
| download | bcm5719-llvm-381e75589db9e5df3b9363fe794f9c0dd04b1ca8.tar.gz bcm5719-llvm-381e75589db9e5df3b9363fe794f9c0dd04b1ca8.zip | |
Debug info: fix a crasher when when emitting debug info for
not-yet-completed templated types. getTypeSize() needs a complete type.
rdar://problem/15931354
llvm-svn: 200797
Diffstat (limited to 'clang/lib/CodeGen')
| -rw-r--r-- | clang/lib/CodeGen/CGDebugInfo.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/clang/lib/CodeGen/CGDebugInfo.cpp b/clang/lib/CodeGen/CGDebugInfo.cpp index 59ba47c334c..dddc7e7569f 100644 --- a/clang/lib/CodeGen/CGDebugInfo.cpp +++ b/clang/lib/CodeGen/CGDebugInfo.cpp @@ -2251,9 +2251,10 @@ llvm::DICompositeType CGDebugInfo::CreateLimitedType(const RecordType *Ty) { if (T && (!T.isForwardDecl() || !RD->getDefinition())) return T; - // If this is just a forward declaration, construct an appropriately - // marked node and just return it. - if (!RD->getDefinition()) + // If this is just a forward or incomplete declaration, construct an + // appropriately marked node and just return it. + const RecordDecl *D = RD->getDefinition(); + if (!D || !D->isCompleteDefinition()) return getOrCreateRecordFwdDecl(Ty, RDContext); uint64_t Size = CGM.getContext().getTypeSize(Ty); |

