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/Sema/SemaChecking.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/Sema/SemaChecking.cpp')
-rw-r--r-- | lib/Sema/SemaChecking.cpp | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/lib/Sema/SemaChecking.cpp b/lib/Sema/SemaChecking.cpp index a8a6095079..1e26c3507b 100644 --- a/lib/Sema/SemaChecking.cpp +++ b/lib/Sema/SemaChecking.cpp @@ -199,7 +199,7 @@ bool Sema::CheckFunctionCall(FunctionDecl *FDecl, CallExpr *TheCall) { bool HasVAListArg = Format->getFirstArg() == 0; if (!HasVAListArg) { if (const FunctionProtoType *Proto - = FDecl->getType()->getAsFunctionProtoType()) + = FDecl->getType()->getAs<FunctionProtoType>()) HasVAListArg = !Proto->isVariadic(); } CheckPrintfArguments(TheCall, HasVAListArg, Format->getFormatIdx() - 1, @@ -234,7 +234,7 @@ bool Sema::CheckBlockCall(NamedDecl *NDecl, CallExpr *TheCall) { bool HasVAListArg = Format->getFirstArg() == 0; if (!HasVAListArg) { const FunctionType *FT = - Ty->getAs<BlockPointerType>()->getPointeeType()->getAsFunctionType(); + Ty->getAs<BlockPointerType>()->getPointeeType()->getAs<FunctionType>(); if (const FunctionProtoType *Proto = dyn_cast<FunctionProtoType>(FT)) HasVAListArg = !Proto->isVariadic(); } @@ -372,7 +372,7 @@ bool Sema::SemaBuiltinAtomicOverloaded(CallExpr *TheCall) { cast<FunctionDecl>(LazilyCreateBuiltin(NewBuiltinII, NewBuiltinID, TUScope, false, DRE->getLocStart())); const FunctionProtoType *BuiltinFT = - NewBuiltinDecl->getType()->getAsFunctionProtoType(); + NewBuiltinDecl->getType()->getAs<FunctionProtoType>(); ValType = BuiltinFT->getArgType(0)->getAs<PointerType>()->getPointeeType(); // If the first type needs to be converted (e.g. void** -> int*), do it now. @@ -633,7 +633,7 @@ Action::OwningExprResult Sema::SemaBuiltinShuffleVector(CallExpr *TheCall) { return ExprError(); } - numElements = FAType->getAsVectorType()->getNumElements(); + numElements = FAType->getAs<VectorType>()->getNumElements(); if (TheCall->getNumArgs() != numElements+2) { if (TheCall->getNumArgs() < numElements+2) return ExprError(Diag(TheCall->getLocEnd(), @@ -694,7 +694,7 @@ bool Sema::SemaBuiltinPrefetch(CallExpr *TheCall) { QualType RWType = Arg->getType(); - const BuiltinType *BT = RWType->getAsBuiltinType(); + const BuiltinType *BT = RWType->getAs<BuiltinType>(); llvm::APSInt Result; if (!BT || BT->getKind() != BuiltinType::Int) return Diag(TheCall->getLocStart(), diag::err_prefetch_invalid_argument) @@ -733,7 +733,7 @@ bool Sema::SemaBuiltinObjectSize(CallExpr *TheCall) { return false; QualType ArgType = Arg->getType(); - const BuiltinType *BT = ArgType->getAsBuiltinType(); + const BuiltinType *BT = ArgType->getAs<BuiltinType>(); llvm::APSInt Result(32); if (!BT || BT->getKind() != BuiltinType::Int) return Diag(TheCall->getLocStart(), diag::err_object_size_invalid_argument) @@ -1092,7 +1092,7 @@ void Sema::CheckPrintfString(const StringLiteral *FExpr, // Perform type checking on width/precision specifier. const Expr *E = TheCall->getArg(format_idx+numConversions); - if (const BuiltinType *BT = E->getType()->getAsBuiltinType()) + if (const BuiltinType *BT = E->getType()->getAs<BuiltinType>()) if (BT->getKind() == BuiltinType::Int) break; |