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
diff --git a/lib/Sema/SemaChecking.cpp b/lib/Sema/SemaChecking.cpp
index 6256872..4eed018 100644
--- a/lib/Sema/SemaChecking.cpp
+++ b/lib/Sema/SemaChecking.cpp
@@ -205,7 +205,7 @@
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 @@
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 @@
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 @@
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);
}