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/AST/Expr.cpp | |
| parent | 01bc160ffccc03e4c0583acf82bd7ab80494219a (diff) | |
| download | clang-35366a67baa970c287c714c957cf78a4131cf60d.tar.gz clang-35366a67baa970c287c714c957cf78a4131cf60d.tar.bz2 clang-35366a67baa970c287c714c957cf78a4131cf60d.tar.xz | |
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/AST/Expr.cpp')
| -rw-r--r-- | lib/AST/Expr.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/lib/AST/Expr.cpp b/lib/AST/Expr.cpp index 54739780be..0a6d9fe128 100644 --- a/lib/AST/Expr.cpp +++ b/lib/AST/Expr.cpp @@ -287,9 +287,9 @@ unsigned CallExpr::isBuiltinCall(ASTContext &Context) const { QualType CallExpr::getCallReturnType() const { QualType CalleeType = getCallee()->getType(); - if (const PointerType *FnTypePtr = CalleeType->getAs<PointerType>()) + if (const PointerType *FnTypePtr = CalleeType->getAsPointerType()) CalleeType = FnTypePtr->getPointeeType(); - else if (const BlockPointerType *BPT = CalleeType->getAs<BlockPointerType>()) + else if (const BlockPointerType *BPT = CalleeType->getAsBlockPointerType()) CalleeType = BPT->getPointeeType(); const FunctionType *FnType = CalleeType->getAsFunctionType(); @@ -438,7 +438,7 @@ Expr *InitListExpr::updateInit(unsigned Init, Expr *expr) { /// getFunctionType - Return the underlying function type for this block. /// const FunctionType *BlockExpr::getFunctionType() const { - return getType()->getAs<BlockPointerType>()-> + return getType()->getAsBlockPointerType()-> getPointeeType()->getAsFunctionType(); } @@ -923,7 +923,7 @@ Expr::isModifiableLvalue(ASTContext &Ctx, SourceLocation *Loc) const { if (CT->isIncompleteType()) return MLV_IncompleteType; - if (const RecordType *r = CT->getAs<RecordType>()) { + if (const RecordType *r = CT->getAsRecordType()) { 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->getAs<PointerType>()->getPointeeType()->isObjCObjectPointerType()) + T->getAsPointerType()->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()->getAs<PointerType>()) { + if (const PointerType *PT = CE->getType()->getAsPointerType()) { QualType Pointee = PT->getPointeeType(); if (Pointee.getCVRQualifiers() == 0 && Pointee->isVoidType() && // to void* |
