Use getXXXType over getXXXDecl in a bunch of places

This commit is contained in:
Hamish Knight
2019-11-06 17:36:04 -08:00
parent 18088b04f0
commit cb0c9adc46
11 changed files with 26 additions and 36 deletions

View File

@@ -4265,12 +4265,12 @@ Type ASTContext::getBridgedToObjC(const DeclContext *dc, Type type,
// Check whether the type is an existential that contains
// Error. If so, it's bridged to NSError.
if (type->isExistentialWithError()) {
if (auto nsErrorDecl = getNSErrorDecl()) {
if (auto nsErrorTy = getNSErrorType()) {
// The corresponding value type is Error.
if (bridgedValueType)
*bridgedValueType = getErrorDecl()->getDeclaredInterfaceType();
return nsErrorDecl->getDeclaredInterfaceType();
return nsErrorTy;
}
}
@@ -4308,8 +4308,8 @@ Type ASTContext::getBridgedToObjC(const DeclContext *dc, Type type,
*bridgedValueType = getErrorDecl()->getDeclaredInterfaceType();
// Bridge to NSError.
if (auto nsErrorDecl = getNSErrorDecl())
return nsErrorDecl->getDeclaredInterfaceType();
if (auto nsErrorTy = getNSErrorType())
return nsErrorTy;
}
// No special bridging to Objective-C, but this can become an 'Any'.