diff options
author | Daniel Dunbar <daniel@zuster.org> | 2009-02-26 19:54:52 +0000 |
---|---|---|
committer | Daniel Dunbar <daniel@zuster.org> | 2009-02-26 19:54:52 +0000 |
commit | 68694ada8f4d8f6c4b00ea5b900df96428b28fc8 (patch) | |
tree | 2743778711e103feef42a5a4b0bfb0f85fe4dfb4 /lib | |
parent | 6aeae7fa9cfaacba3a4077d62c01c2531d88a63e (diff) |
Remove PointerLikeType.
- Having pointers and references share a base was not a useful
notion.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65567 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r-- | lib/AST/Type.cpp | 22 | ||||
-rw-r--r-- | lib/CodeGen/CodeGenTypes.h | 1 |
2 files changed, 3 insertions, 20 deletions
diff --git a/lib/AST/Type.cpp b/lib/AST/Type.cpp index 7b07b9cbe4..210be03fa8 100644 --- a/lib/AST/Type.cpp +++ b/lib/AST/Type.cpp @@ -225,24 +225,6 @@ const FunctionTypeProto *Type::getAsFunctionTypeProto() const { } -const PointerLikeType *Type::getAsPointerLikeType() const { - // If this is directly a pointer-like type, return it. - if (const PointerLikeType *PTy = dyn_cast<PointerLikeType>(this)) - return PTy; - - // If the canonical form of this type isn't the right kind, reject it. - if (!isa<PointerLikeType>(CanonicalType)) { - // Look through type qualifiers - if (isa<PointerLikeType>(CanonicalType.getUnqualifiedType())) - return CanonicalType.getUnqualifiedType()->getAsPointerLikeType(); - return 0; - } - - // If this is a typedef for a pointer type, strip the typedef off without - // losing all typedef information. - return getDesugaredType()->getAsPointerLikeType(); -} - const PointerType *Type::getAsPointerType() const { // If this is directly a pointer type, return it. if (const PointerType *PTy = dyn_cast<PointerType>(this)) @@ -331,8 +313,10 @@ bool Type::isVariablyModifiedType() const { // Also, C++ references and member pointers can point to a variably modified // type, where VLAs appear as an extension to C++, and should be treated // correctly. - if (const PointerLikeType *PT = getAsPointerLikeType()) + if (const PointerType *PT = getAsPointerType()) return PT->getPointeeType()->isVariablyModifiedType(); + if (const ReferenceType *RT = getAsReferenceType()) + return RT->getPointeeType()->isVariablyModifiedType(); if (const MemberPointerType *PT = getAsMemberPointerType()) return PT->getPointeeType()->isVariablyModifiedType(); diff --git a/lib/CodeGen/CodeGenTypes.h b/lib/CodeGen/CodeGenTypes.h index 9c548ec099..228502d0cd 100644 --- a/lib/CodeGen/CodeGenTypes.h +++ b/lib/CodeGen/CodeGenTypes.h @@ -36,7 +36,6 @@ namespace clang { class FunctionTypeProto; class ObjCInterfaceDecl; class ObjCIvarDecl; - class PointerLikeType; class PointerType; class QualType; class RecordDecl; |