summaryrefslogtreecommitdiffstats
path: root/clang/lib/AST/Expr.cpp
diff options
context:
space:
mode:
authorTed Kremenek <kremenek@apple.com>2009-07-29 21:53:49 +0000
committerTed Kremenek <kremenek@apple.com>2009-07-29 21:53:49 +0000
commitc23c7e6a51927d48a2d4d91a86bd422262f7352d (patch)
tree35b19b3eff4bfc9556abe0a4716d2e63da5a7152 /clang/lib/AST/Expr.cpp
parent4301526e8dad61db333728626e8fe3c916bb2cc2 (diff)
downloadbcm5719-llvm-c23c7e6a51927d48a2d4d91a86bd422262f7352d.tar.gz
bcm5719-llvm-c23c7e6a51927d48a2d4d91a86bd422262f7352d.zip
Change uses of:
Type::getAsReferenceType() -> Type::getAs<ReferenceType>() Type::getAsRecordType() -> Type::getAs<RecordType>() Type::getAsPointerType() -> Type::getAs<PointerType>() Type::getAsBlockPointerType() -> Type::getAs<BlockPointerType>() Type::getAsLValueReferenceType() -> Type::getAs<LValueReferenceType>() Type::getAsRValueReferenceType() -> Type::getAs<RValueReferenceType>() Type::getAsMemberPointerType() -> Type::getAs<MemberPointerType>() Type::getAsReferenceType() -> Type::getAs<ReferenceType>() Type::getAsTagType() -> Type::getAs<TagType>() And remove Type::getAsReferenceType(), etc. This change is similar to one I made a couple weeks ago, but that was partly reverted pending some additional design discussion. With Doug's pending smart pointer changes for Types, it seemed natural to take this approach. llvm-svn: 77510
Diffstat (limited to 'clang/lib/AST/Expr.cpp')
-rw-r--r--clang/lib/AST/Expr.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/clang/lib/AST/Expr.cpp b/clang/lib/AST/Expr.cpp
index 79ebb546d07..842caa8d00a 100644
--- a/clang/lib/AST/Expr.cpp
+++ b/clang/lib/AST/Expr.cpp
@@ -288,9 +288,9 @@ unsigned CallExpr::isBuiltinCall(ASTContext &Context) const {
QualType CallExpr::getCallReturnType() const {
QualType CalleeType = getCallee()->getType();
- if (const PointerType *FnTypePtr = CalleeType->getAsPointerType())
+ if (const PointerType *FnTypePtr = CalleeType->getAs<PointerType>())
CalleeType = FnTypePtr->getPointeeType();
- else if (const BlockPointerType *BPT = CalleeType->getAsBlockPointerType())
+ else if (const BlockPointerType *BPT = CalleeType->getAs<BlockPointerType>())
CalleeType = BPT->getPointeeType();
const FunctionType *FnType = CalleeType->getAsFunctionType();
@@ -439,7 +439,7 @@ Expr *InitListExpr::updateInit(unsigned Init, Expr *expr) {
/// getFunctionType - Return the underlying function type for this block.
///
const FunctionType *BlockExpr::getFunctionType() const {
- return getType()->getAsBlockPointerType()->
+ return getType()->getAs<BlockPointerType>()->
getPointeeType()->getAsFunctionType();
}
@@ -923,7 +923,7 @@ Expr::isModifiableLvalue(ASTContext &Ctx, SourceLocation *Loc) const {
if (CT->isIncompleteType())
return MLV_IncompleteType;
- if (const RecordType *r = CT->getAsRecordType()) {
+ if (const RecordType *r = CT->getAs<RecordType>()) {
if (r->hasConstFields())
return MLV_ConstQualified;
}
@@ -999,7 +999,7 @@ bool Expr::isOBJCGCCandidate(ASTContext &Ctx) const {
QualType T = VD->getType();
// dereferencing to an object pointer is always a gc'able candidate
if (T->isPointerType() &&
- T->getAsPointerType()->getPointeeType()->isObjCObjectPointerType())
+ T->getAs<PointerType>()->getPointeeType()->isObjCObjectPointerType())
return true;
}
@@ -1427,7 +1427,7 @@ bool Expr::isNullPointerConstant(ASTContext &Ctx) const
if (const ExplicitCastExpr *CE = dyn_cast<ExplicitCastExpr>(this)) {
if (!Ctx.getLangOptions().CPlusPlus) {
// Check that it is a cast to void*.
- if (const PointerType *PT = CE->getType()->getAsPointerType()) {
+ if (const PointerType *PT = CE->getType()->getAs<PointerType>()) {
QualType Pointee = PT->getPointeeType();
if (Pointee.getCVRQualifiers() == 0 &&
Pointee->isVoidType() && // to void*
OpenPOWER on IntegriCloud