Teach libclang to be more careful around BlockDecls, and don't assume

that a TypeSourceInfo is always available, like we do everywhere else
in libclang. Fixes <rdar://problem/9311140>.

llvm-svn: 130034
This commit is contained in:
Douglas Gregor 2011-04-22 23:49:24 +00:00
parent dd450b86cf
commit 0ff2b2eda3
1 changed files with 3 additions and 2 deletions

View File

@ -582,8 +582,9 @@ bool CursorVisitor::VisitChildren(CXCursor Cursor) {
}
bool CursorVisitor::VisitBlockDecl(BlockDecl *B) {
if (Visit(B->getSignatureAsWritten()->getTypeLoc()))
return true;
if (TypeSourceInfo *TSInfo = B->getSignatureAsWritten())
if (Visit(TSInfo->getTypeLoc()))
return true;
if (Stmt *Body = B->getBody())
return Visit(MakeCXCursor(Body, StmtParent, TU));