diff options
author | Ted Kremenek <kremenek@apple.com> | 2009-07-17 17:50:17 +0000 |
---|---|---|
committer | Ted Kremenek <kremenek@apple.com> | 2009-07-17 17:50:17 +0000 |
commit | 35366a67baa970c287c714c957cf78a4131cf60d (patch) | |
tree | 053ba730a50f0c434f8e6d6ca89d03d9cdcfc14d /lib/Sema/SemaTemplate.cpp | |
parent | 01bc160ffccc03e4c0583acf82bd7ab80494219a (diff) |
Per offline discussion with Steve Naroff, add back Type::getAsXXXType() methods
until Doug Gregor's Type smart pointer code lands (or more discussion occurs).
These methods just call the new Type::getAs<XXX> methods, so we still have
reduced implementation redundancy. Having explicit getAsXXXType() methods makes
it easier to set breakpoints in the debugger.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@76193 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaTemplate.cpp')
-rw-r--r-- | lib/Sema/SemaTemplate.cpp | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/lib/Sema/SemaTemplate.cpp b/lib/Sema/SemaTemplate.cpp index 9ee4f3fcab..568d68c9a7 100644 --- a/lib/Sema/SemaTemplate.cpp +++ b/lib/Sema/SemaTemplate.cpp @@ -225,8 +225,8 @@ Sema::CheckNonTypeTemplateParameterType(QualType T, SourceLocation Loc) { if (T->isIntegralType() || T->isEnumeralType() || // -- pointer to object or pointer to function, (T->isPointerType() && - (T->getAs<PointerType>()->getPointeeType()->isObjectType() || - T->getAs<PointerType>()->getPointeeType()->isFunctionType())) || + (T->getAsPointerType()->getPointeeType()->isObjectType() || + T->getAsPointerType()->getPointeeType()->isFunctionType())) || // -- reference to object or reference to function, T->isReferenceType() || // -- pointer to member. @@ -1329,7 +1329,7 @@ bool Sema::CheckTemplateArgument(TemplateTypeParmDecl *Param, const TagType *Tag = 0; if (const EnumType *EnumT = Arg->getAsEnumType()) Tag = EnumT; - else if (const RecordType *RecordT = Arg->getAs<RecordType>()) + else if (const RecordType *RecordT = Arg->getAsRecordType()) Tag = RecordT; if (Tag && Tag->getDecl()->getDeclContext()->isFunctionOrMethod()) return Diag(ArgLoc, diag::err_template_arg_local_type) @@ -1648,13 +1648,13 @@ bool Sema::CheckTemplateArgument(NonTypeTemplateParmDecl *Param, // function is selected from the set (13.4). // In C++0x, any std::nullptr_t value can be converted. (ParamType->isPointerType() && - ParamType->getAs<PointerType>()->getPointeeType()->isFunctionType()) || + ParamType->getAsPointerType()->getPointeeType()->isFunctionType()) || // -- For a non-type template-parameter of type reference to // function, no conversions apply. If the template-argument // represents a set of overloaded functions, the matching // function is selected from the set (13.4). (ParamType->isReferenceType() && - ParamType->getAs<ReferenceType>()->getPointeeType()->isFunctionType()) || + ParamType->getAsReferenceType()->getPointeeType()->isFunctionType()) || // -- For a non-type template-parameter of type pointer to // member function, no conversions apply. If the // template-argument represents a set of overloaded member @@ -1662,7 +1662,7 @@ bool Sema::CheckTemplateArgument(NonTypeTemplateParmDecl *Param, // the set (13.4). // Again, C++0x allows a std::nullptr_t value. (ParamType->isMemberPointerType() && - ParamType->getAs<MemberPointerType>()->getPointeeType() + ParamType->getAsMemberPointerType()->getPointeeType() ->isFunctionType())) { if (Context.hasSameUnqualifiedType(ArgType, ParamType.getNonReferenceType())) { @@ -1721,7 +1721,7 @@ bool Sema::CheckTemplateArgument(NonTypeTemplateParmDecl *Param, // object, qualification conversions (4.4) and the // array-to-pointer conversion (4.2) are applied. // C++0x also allows a value of std::nullptr_t. - assert(ParamType->getAs<PointerType>()->getPointeeType()->isObjectType() && + assert(ParamType->getAsPointerType()->getPointeeType()->isObjectType() && "Only object pointers allowed here"); if (ArgType->isNullPtrType()) { @@ -1755,7 +1755,7 @@ bool Sema::CheckTemplateArgument(NonTypeTemplateParmDecl *Param, return false; } - if (const ReferenceType *ParamRefType = ParamType->getAs<ReferenceType>()) { + if (const ReferenceType *ParamRefType = ParamType->getAsReferenceType()) { // -- For a non-type template-parameter of type reference to // object, no conversions apply. The type referred to by the // reference may be more cv-qualified than the (otherwise |