Clean up some more uses of getAs<ObjCInterfaceType>() that Fariborz pointed
out.  The remaining ones are okay.

llvm-svn: 103973
diff --git a/clang/lib/Frontend/RewriteObjC.cpp b/clang/lib/Frontend/RewriteObjC.cpp
index 3c415c7..892fc73 100644
--- a/clang/lib/Frontend/RewriteObjC.cpp
+++ b/clang/lib/Frontend/RewriteObjC.cpp
@@ -1911,13 +1911,13 @@
         buf += "1) { ";
         ReplaceText(startLoc, lParenLoc-startBuf+1, buf);
         sawIdTypedCatch = true;
-      } else if (t->isObjCObjectPointerType()) {
-        QualType InterfaceTy = t->getPointeeType();
-        const ObjCInterfaceType *cls = // Should be a pointer to a class.
-          InterfaceTy->getAs<ObjCInterfaceType>();
-        if (cls) {
+      } else if (const ObjCObjectPointerType *Ptr =
+                   t->getAs<ObjCObjectPointerType>()) {
+        // Should be a pointer to a class.
+        ObjCInterfaceDecl *IDecl = Ptr->getObjectType()->getInterface();
+        if (IDecl) {
           buf += "objc_exception_match((struct objc_class *)objc_getClass(\"";
-          buf += cls->getDecl()->getNameAsString();
+          buf += IDecl->getNameAsString();
           buf += "\"), (struct objc_object *)_caught)) { ";
           ReplaceText(startLoc, lParenLoc-startBuf+1, buf);
         }
@@ -2811,7 +2811,7 @@
     llvm::SmallVector<Expr*, 8> ClsExprs;
     QualType argType = Context->getPointerType(Context->CharTy);
     ObjCInterfaceDecl *Class
-      = Exp->getClassReceiver()->getAs<ObjCInterfaceType>()->getDecl();
+      = Exp->getClassReceiver()->getAs<ObjCObjectType>()->getInterface();
     IdentifierInfo *clsName = Class->getIdentifier();
     ClsExprs.push_back(StringLiteral::Create(*Context,
                                              clsName->getNameStart(),