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/Sema/SemaChecking.cpp | |
parent | 01bc160ffccc03e4c0583acf82bd7ab80494219a (diff) |
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/Sema/SemaChecking.cpp')
-rw-r--r-- | lib/Sema/SemaChecking.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/Sema/SemaChecking.cpp b/lib/Sema/SemaChecking.cpp index 6256872b5e..4eed018722 100644 --- a/lib/Sema/SemaChecking.cpp +++ b/lib/Sema/SemaChecking.cpp @@ -205,7 +205,7 @@ Sema::CheckBlockCall(NamedDecl *NDecl, CallExpr *TheCall) { bool HasVAListArg = Format->getFirstArg() == 0; if (!HasVAListArg) { const FunctionType *FT = - Ty->getAs<BlockPointerType>()->getPointeeType()->getAsFunctionType(); + Ty->getAsBlockPointerType()->getPointeeType()->getAsFunctionType(); if (const FunctionProtoType *Proto = dyn_cast<FunctionProtoType>(FT)) HasVAListArg = !Proto->isVariadic(); } @@ -241,7 +241,7 @@ bool Sema::SemaBuiltinAtomicOverloaded(CallExpr *TheCall) { return Diag(DRE->getLocStart(), diag::err_atomic_builtin_must_be_pointer) << FirstArg->getType() << FirstArg->getSourceRange(); - QualType ValType = FirstArg->getType()->getAs<PointerType>()->getPointeeType(); + QualType ValType = FirstArg->getType()->getAsPointerType()->getPointeeType(); if (!ValType->isIntegerType() && !ValType->isPointerType() && !ValType->isBlockPointerType()) return Diag(DRE->getLocStart(), @@ -344,7 +344,7 @@ bool Sema::SemaBuiltinAtomicOverloaded(CallExpr *TheCall) { TUScope, false, DRE->getLocStart())); const FunctionProtoType *BuiltinFT = NewBuiltinDecl->getType()->getAsFunctionProtoType(); - ValType = BuiltinFT->getArgType(0)->getAs<PointerType>()->getPointeeType(); + ValType = BuiltinFT->getArgType(0)->getAsPointerType()->getPointeeType(); // If the first type needs to be converted (e.g. void** -> int*), do it now. if (BuiltinFT->getArgType(0) != FirstArg->getType()) { @@ -750,7 +750,7 @@ bool Sema::SemaCheckStringLiteral(const Expr *E, const CallExpr *TheCall, if (const ArrayType *AT = Context.getAsArrayType(T)) { isConstant = AT->getElementType().isConstant(Context); } - else if (const PointerType *PT = T->getAs<PointerType>()) { + else if (const PointerType *PT = T->getAsPointerType()) { isConstant = T.isConstant(Context) && PT->getPointeeType().isConstant(Context); } |