@@ -1690,8 +1690,7 @@ class IRGenDebugInfoImpl : public IRGenDebugInfo {
16901690 static bool canMangle (TypeBase *Ty) {
16911691 // TODO: C++ types are not yet supported (SR-13223).
16921692 if (Ty->getStructOrBoundGenericStruct () &&
1693- Ty->getStructOrBoundGenericStruct ()->getClangDecl () &&
1694- isa<clang::CXXRecordDecl>(
1693+ isa_and_nonnull<clang::CXXRecordDecl>(
16951694 Ty->getStructOrBoundGenericStruct ()->getClangDecl ()))
16961695 return false ;
16971696
@@ -2445,7 +2444,7 @@ void IRGenDebugInfoImpl::emitVariableDeclaration(
24452444 while (isa<llvm::DILexicalBlock>(Scope))
24462445 Scope = cast<llvm::DILexicalBlock>(Scope)->getScope ();
24472446 }
2448- assert (Scope && isa <llvm::DIScope>(Scope) && " variable has no scope" );
2447+ assert (isa_and_nonnull <llvm::DIScope>(Scope) && " variable has no scope" );
24492448 llvm::DIFile *Unit = getFile (Scope);
24502449 llvm::DIType *DITy = getOrCreateType (DbgTy);
24512450 assert (DITy && " could not determine debug type of variable" );
@@ -2636,8 +2635,7 @@ void IRGenDebugInfoImpl::emitGlobalVariableDeclaration(
26362635 if (MetatypeType *metaTy = dyn_cast<MetatypeType>(ty))
26372636 ty = metaTy->getInstanceType ().getPointer ();
26382637 if (ty->getStructOrBoundGenericStruct () &&
2639- ty->getStructOrBoundGenericStruct ()->getClangDecl () &&
2640- isa<clang::CXXRecordDecl>(
2638+ isa_and_nonnull<clang::CXXRecordDecl>(
26412639 ty->getStructOrBoundGenericStruct ()->getClangDecl ()))
26422640 return ;
26432641 }
0 commit comments