[Clang][AST] Resolve FIXME: Remove ObjCObjectPointer from
authorAlfonso Gregory <gfunni234@gmail.com>
Wed, 20 Oct 2021 17:29:02 +0000 (10:29 -0700)
committerAkira Hatanaka <ahatanaka@apple.com>
Wed, 20 Oct 2021 17:32:46 +0000 (10:32 -0700)
isSpecifierType

There is no reason to have this here, (since all tests pass) and it
isn't even a specifier anyway. We can just treat it as a pointer
instead.

Differential Revision: https://reviews.llvm.org/D110068

clang/lib/AST/DeclPrinter.cpp
clang/lib/AST/Type.cpp

index 4dcf3d0..f2d7a79 100644 (file)
@@ -153,11 +153,14 @@ static QualType GetBaseType(QualType T) {
   while (!BaseType->isSpecifierType()) {
     if (const PointerType *PTy = BaseType->getAs<PointerType>())
       BaseType = PTy->getPointeeType();
+    else if (const ObjCObjectPointerType *OPT =
+                 BaseType->getAs<ObjCObjectPointerType>())
+      BaseType = OPT->getPointeeType();
     else if (const BlockPointerType *BPy = BaseType->getAs<BlockPointerType>())
       BaseType = BPy->getPointeeType();
-    else if (const ArrayTypeATy = dyn_cast<ArrayType>(BaseType))
+    else if (const ArrayType *ATy = dyn_cast<ArrayType>(BaseType))
       BaseType = ATy->getElementType();
-    else if (const FunctionTypeFTy = BaseType->getAs<FunctionType>())
+    else if (const FunctionType *FTy = BaseType->getAs<FunctionType>())
       BaseType = FTy->getReturnType();
     else if (const VectorType *VTy = BaseType->getAs<VectorType>())
       BaseType = VTy->getElementType();
index 58cae03..e7cdf58 100644 (file)
@@ -2785,7 +2785,6 @@ bool Type::isSpecifierType() const {
   case DependentTemplateSpecialization:
   case ObjCInterface:
   case ObjCObject:
-  case ObjCObjectPointer: // FIXME: object pointers aren't really specifiers
     return true;
   default:
     return false;