aboutsummaryrefslogtreecommitdiff
path: root/lib/Sema/SemaTemplateDeduction.cpp
diff options
context:
space:
mode:
authorJohn McCall <rjmccall@apple.com>2009-09-21 23:43:11 +0000
committerJohn McCall <rjmccall@apple.com>2009-09-21 23:43:11 +0000
commit183700f494ec9b6701b6efe82bcb25f4c79ba561 (patch)
tree797f214407f66937802226652d130f95d596e33b /lib/Sema/SemaTemplateDeduction.cpp
parentc32b24452ebb537934b20b7133a3a0cbce447666 (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/SemaTemplateDeduction.cpp')
-rw-r--r--lib/Sema/SemaTemplateDeduction.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/lib/Sema/SemaTemplateDeduction.cpp b/lib/Sema/SemaTemplateDeduction.cpp
index 5a5d63edc2..8d4999bf6d 100644
--- a/lib/Sema/SemaTemplateDeduction.cpp
+++ b/lib/Sema/SemaTemplateDeduction.cpp
@@ -410,7 +410,7 @@ DeduceTemplateArguments(ASTContext &Context,
// T
// cv-list T
if (const TemplateTypeParmType *TemplateTypeParm
- = Param->getAsTemplateTypeParmType()) {
+ = Param->getAs<TemplateTypeParmType>()) {
unsigned Index = TemplateTypeParm->getIndex();
bool RecanonicalizeArg = false;
@@ -1040,7 +1040,7 @@ Sema::DeduceTemplateArguments(ClassTemplatePartialSpecializationDecl *Partial,
/// \brief Determine whether the given type T is a simple-template-id type.
static bool isSimpleTemplateIdType(QualType T) {
if (const TemplateSpecializationType *Spec
- = T->getAsTemplateSpecializationType())
+ = T->getAs<TemplateSpecializationType>())
return Spec->getTemplateName().getAsTemplateDecl() != 0;
return false;
@@ -1157,7 +1157,7 @@ Sema::SubstituteExplicitTemplateArguments(
if (FunctionType) {
// FIXME: exception-specifications?
const FunctionProtoType *Proto
- = Function->getType()->getAsFunctionProtoType();
+ = Function->getType()->getAs<FunctionProtoType>();
assert(Proto && "Function template does not have a prototype?");
QualType ResultType
@@ -1310,7 +1310,7 @@ Sema::DeduceTemplateArguments(FunctionTemplateDecl *FunctionTemplate,
return TDK_TooFewArguments;
else if (NumArgs > Function->getNumParams()) {
const FunctionProtoType *Proto
- = Function->getType()->getAsFunctionProtoType();
+ = Function->getType()->getAs<FunctionProtoType>();
if (!Proto->isVariadic())
return TDK_TooManyArguments;
@@ -1384,7 +1384,7 @@ Sema::DeduceTemplateArguments(FunctionTemplateDecl *FunctionTemplate,
// the argument is an lvalue, the type A& is used in place of A for
// type deduction.
if (isa<RValueReferenceType>(ParamRefType) &&
- ParamRefType->getAsTemplateTypeParmType() &&
+ ParamRefType->getAs<TemplateTypeParmType>() &&
Args[I]->isLvalue(Context) == Expr::LV_Valid)
ArgType = Context.getLValueReferenceType(ArgType);
}