aboutsummaryrefslogtreecommitdiff
path: root/lib/Frontend/RewriteObjC.cpp
diff options
context:
space:
mode:
authorJohn McCall <rjmccall@apple.com>2010-05-17 21:00:27 +0000
committerJohn McCall <rjmccall@apple.com>2010-05-17 21:00:27 +0000
commit506b57e8b79d7dc2c367bf2ee7ec95420ad3fc8f (patch)
tree8d70cbc51dbea759e13389d30bc6cfc6bfe29923 /lib/Frontend/RewriteObjC.cpp
parentdcf22ad88fdb6c4dd74f9065262cde8bac4f807b (diff)
Clean up some more uses of getAs<ObjCInterfaceType>() that Fariborz pointed
out. The remaining ones are okay. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@103973 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Frontend/RewriteObjC.cpp')
-rw-r--r--lib/Frontend/RewriteObjC.cpp14
1 files changed, 7 insertions, 7 deletions
diff --git a/lib/Frontend/RewriteObjC.cpp b/lib/Frontend/RewriteObjC.cpp
index 3c415c79d9..892fc73bfc 100644
--- a/lib/Frontend/RewriteObjC.cpp
+++ b/lib/Frontend/RewriteObjC.cpp
@@ -1911,13 +1911,13 @@ Stmt *RewriteObjC::RewriteObjCTryStmt(ObjCAtTryStmt *S) {
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 @@ Stmt *RewriteObjC::SynthMessageExpr(ObjCMessageExpr *Exp,
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(),