diff options
author | Ted Kremenek <kremenek@apple.com> | 2009-07-17 01:01:15 +0000 |
---|---|---|
committer | Ted Kremenek <kremenek@apple.com> | 2009-07-17 01:01:15 +0000 |
commit | 808825cd08704d1cccef605f8cd3ef83c93eac78 (patch) | |
tree | 55bc5893cb2fb81c2741fdc64686318dae9f1b02 /lib/AST/Type.cpp | |
parent | 21375a3cd51586ebbb311499f3533210bfab2fd4 (diff) |
Replace Type::getAsReferenceType() with Type::getAs<ReferenceType>().
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@76132 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/AST/Type.cpp')
-rw-r--r-- | lib/AST/Type.cpp | 20 |
1 files changed, 1 insertions, 19 deletions
diff --git a/lib/AST/Type.cpp b/lib/AST/Type.cpp index 13d0cb03e8..28c3a8f42a 100644 --- a/lib/AST/Type.cpp +++ b/lib/AST/Type.cpp @@ -305,24 +305,6 @@ QualType Type::getPointeeType() const { return QualType(); } -const ReferenceType *Type::getAsReferenceType() const { - // If this is directly a reference type, return it. - if (const ReferenceType *RTy = dyn_cast<ReferenceType>(this)) - return RTy; - - // If the canonical form of this type isn't the right kind, reject it. - if (!isa<ReferenceType>(CanonicalType)) { - // Look through type qualifiers - if (isa<ReferenceType>(CanonicalType.getUnqualifiedType())) - return CanonicalType.getUnqualifiedType()->getAsReferenceType(); - return 0; - } - - // If this is a typedef for a reference type, strip the typedef off without - // losing all typedef information. - return cast<ReferenceType>(getDesugaredType()); -} - const LValueReferenceType *Type::getAsLValueReferenceType() const { // If this is directly an lvalue reference type, return it. if (const LValueReferenceType *RTy = dyn_cast<LValueReferenceType>(this)) @@ -395,7 +377,7 @@ bool Type::isVariablyModifiedType() const { // correctly. if (const PointerType *PT = getAs<PointerType>()) return PT->getPointeeType()->isVariablyModifiedType(); - if (const ReferenceType *RT = getAsReferenceType()) + if (const ReferenceType *RT = getAs<ReferenceType>()) return RT->getPointeeType()->isVariablyModifiedType(); if (const MemberPointerType *PT = getAsMemberPointerType()) return PT->getPointeeType()->isVariablyModifiedType(); |