summaryrefslogtreecommitdiffstats
path: root/clang/lib/AST/DeclPrinter.cpp
diff options
context:
space:
mode:
authorTed Kremenek <kremenek@apple.com>2009-07-16 19:58:26 +0000
committerTed Kremenek <kremenek@apple.com>2009-07-16 19:58:26 +0000
commite3fb4b65243972788b91f98b66fe4e911e1d9e90 (patch)
tree15718d8cc74d63fe862e053662c5de8dc46c1584 /clang/lib/AST/DeclPrinter.cpp
parentc277dc408bea3697fbaa3429658c4d8deff3f066 (diff)
downloadbcm5719-llvm-e3fb4b65243972788b91f98b66fe4e911e1d9e90.tar.gz
bcm5719-llvm-e3fb4b65243972788b91f98b66fe4e911e1d9e90.zip
Add member template 'Type::getAs<T>', which converts a Type* to a respective T*.
This method is intended to eventually replace the individual Type::getAsXXXType<> methods. The motivation behind this change is twofold: 1) Reduce redundant implementations of Type::getAsXXXType() methods. Most of them are basically copy-and-paste. 2) By centralizing the implementation of the getAs<Type> logic we can more smoothly move over to Doug Gregor's proposed canonical type smart pointer scheme. Along with this patch: a) Removed 'Type::getAsPointerType()'; now clients use getAs<PointerType>. b) Removed 'Type::getAsBlockPointerTypE()'; now clients use getAs<BlockPointerType>. llvm-svn: 76098
Diffstat (limited to 'clang/lib/AST/DeclPrinter.cpp')
-rw-r--r--clang/lib/AST/DeclPrinter.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/clang/lib/AST/DeclPrinter.cpp b/clang/lib/AST/DeclPrinter.cpp
index 84ae72977e6..55d39e5cc8f 100644
--- a/clang/lib/AST/DeclPrinter.cpp
+++ b/clang/lib/AST/DeclPrinter.cpp
@@ -90,7 +90,7 @@ static QualType GetBaseType(QualType T) {
while (!BaseType->isSpecifierType()) {
if (isa<TypedefType>(BaseType))
break;
- else if (const PointerType* PTy = BaseType->getAsPointerType())
+ else if (const PointerType* PTy = BaseType->getAs<PointerType>())
BaseType = PTy->getPointeeType();
else if (const ArrayType* ATy = dyn_cast<ArrayType>(BaseType))
BaseType = ATy->getElementType();
OpenPOWER on IntegriCloud