Merge Clang debug info crash fix rev 200797:

Debug info: fix a crasher when when emitting debug info for
    not-yet-completed templated types. getTypeSize() needs a complete type.

    rdar://problem/15931354

PR:		193347
MFC after:	3 days
Sponsored by:	DARPA, AFRL
This commit is contained in:
Ed Maste 2014-09-08 18:43:33 +00:00
parent a9ff4acab2
commit 2c123ad8b3
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=271282

View file

@ -2235,9 +2235,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);