diff options
author | John McCall <rjmccall@apple.com> | 2009-09-21 23:43:11 +0000 |
---|---|---|
committer | John McCall <rjmccall@apple.com> | 2009-09-21 23:43:11 +0000 |
commit | 183700f494ec9b6701b6efe82bcb25f4c79ba561 (patch) | |
tree | 797f214407f66937802226652d130f95d596e33b /lib/CodeGen/CGObjCMac.cpp | |
parent | c32b24452ebb537934b20b7133a3a0cbce447666 (diff) |
Change all the Type::getAsFoo() methods to specializations of Type::getAs().
Several of the existing methods were identical to their respective
specializations, and so have been removed entirely. Several more 'leaf'
optimizations were introduced.
The getAsFoo() methods which imposed extra conditions, like
getAsObjCInterfacePointerType(), have been left in place.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@82501 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/CGObjCMac.cpp')
-rw-r--r-- | lib/CodeGen/CGObjCMac.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/lib/CodeGen/CGObjCMac.cpp b/lib/CodeGen/CGObjCMac.cpp index f6cdd27400..df6058303a 100644 --- a/lib/CodeGen/CGObjCMac.cpp +++ b/lib/CodeGen/CGObjCMac.cpp @@ -1539,7 +1539,7 @@ CGObjCCommonMac::EmitLegacyMessageSend(CodeGen::CodeGenFunction &CGF, : ObjCTypes.getSendStretFn(IsSuper); } else if (ResultType->isFloatingType()) { if (ObjCABI == 2) { - if (const BuiltinType *BT = ResultType->getAsBuiltinType()) { + if (const BuiltinType *BT = ResultType->getAs<BuiltinType>()) { BuiltinType::Kind k = BT->getKind(); Fn = (k == BuiltinType::LongDouble) ? ObjCTypes.getSendFpretFn2(IsSuper) : ObjCTypes.getSendFn2(IsSuper); @@ -2546,7 +2546,7 @@ void CGObjCMac::EmitTryOrSynchronizedStmt(CodeGen::CodeGenFunction &CGF, if (!CatchParam) { AllMatched = true; } else { - OPT = CatchParam->getType()->getAsObjCObjectPointerType(); + OPT = CatchParam->getType()->getAs<ObjCObjectPointerType>(); // catch(id e) always matches. // FIXME: For the time being we also match id<X>; this should @@ -2569,7 +2569,7 @@ void CGObjCMac::EmitTryOrSynchronizedStmt(CodeGen::CodeGenFunction &CGF, assert(OPT && "Unexpected non-object pointer type in @catch"); QualType T = OPT->getPointeeType(); - const ObjCInterfaceType *ObjCType = T->getAsObjCInterfaceType(); + const ObjCInterfaceType *ObjCType = T->getAs<ObjCInterfaceType>(); assert(ObjCType && "Catch parameter must have Objective-C type!"); // Check if the @catch block matches the exception object. @@ -2803,7 +2803,7 @@ LValue CGObjCMac::EmitObjCValueForIvar(CodeGen::CodeGenFunction &CGF, llvm::Value *BaseValue, const ObjCIvarDecl *Ivar, unsigned CVRQualifiers) { - const ObjCInterfaceDecl *ID = ObjectTy->getAsObjCInterfaceType()->getDecl(); + const ObjCInterfaceDecl *ID = ObjectTy->getAs<ObjCInterfaceType>()->getDecl(); return EmitValueForIvarAtOffset(CGF, ID, BaseValue, Ivar, CVRQualifiers, EmitIvarOffset(CGF, ID, Ivar)); } @@ -4968,7 +4968,7 @@ LValue CGObjCNonFragileABIMac::EmitObjCValueForIvar( llvm::Value *BaseValue, const ObjCIvarDecl *Ivar, unsigned CVRQualifiers) { - const ObjCInterfaceDecl *ID = ObjectTy->getAsObjCInterfaceType()->getDecl(); + const ObjCInterfaceDecl *ID = ObjectTy->getAs<ObjCInterfaceType>()->getDecl(); return EmitValueForIvarAtOffset(CGF, ID, BaseValue, Ivar, CVRQualifiers, EmitIvarOffset(CGF, ID, Ivar)); } @@ -5462,7 +5462,7 @@ CGObjCNonFragileABIMac::EmitTryOrSynchronizedStmt(CodeGen::CodeGenFunction &CGF, } else { // All other types should be Objective-C interface pointer types. const ObjCObjectPointerType *PT = - CatchDecl->getType()->getAsObjCObjectPointerType(); + CatchDecl->getType()->getAs<ObjCObjectPointerType>(); assert(PT && "Invalid @catch type."); const ObjCInterfaceType *IT = PT->getInterfaceType(); assert(IT && "Invalid @catch type."); |