Eliminate usage of ObjCSuperExpr used for
'super' as receiver of property or a setter/getter
methods. //rdar: //8525788
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@116483 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Serialization/ASTReaderStmt.cpp b/lib/Serialization/ASTReaderStmt.cpp
index f361f0d..2f4bddf 100644
--- a/lib/Serialization/ASTReaderStmt.cpp
+++ b/lib/Serialization/ASTReaderStmt.cpp
@@ -122,7 +122,6 @@
void VisitObjCImplicitSetterGetterRefExpr(
ObjCImplicitSetterGetterRefExpr *E);
void VisitObjCMessageExpr(ObjCMessageExpr *E);
- void VisitObjCSuperExpr(ObjCSuperExpr *E);
void VisitObjCIsaExpr(ObjCIsaExpr *E);
void VisitObjCForCollectionStmt(ObjCForCollectionStmt *);
@@ -843,7 +842,13 @@
VisitExpr(E);
E->setProperty(cast<ObjCPropertyDecl>(Reader.GetDecl(Record[Idx++])));
E->setLocation(ReadSourceLocation(Record, Idx));
- E->setBase(Reader.ReadSubExpr());
+ E->SuperLoc = ReadSourceLocation(Record, Idx);
+ if (E->isSuperReceiver()) {
+ QualType T = Reader.GetType(Record[Idx++]);
+ E->BaseExprOrSuperType = T.getTypePtr();
+ }
+ else
+ E->setBase(Reader.ReadSubExpr());
}
void ASTStmtReader::VisitObjCImplicitSetterGetterRefExpr(
@@ -858,6 +863,9 @@
E->setBase(Reader.ReadSubExpr());
E->setLocation(ReadSourceLocation(Record, Idx));
E->setClassLoc(ReadSourceLocation(Record, Idx));
+ E->SuperLoc = ReadSourceLocation(Record, Idx);
+ E->SuperTy = Reader.GetType(Record[Idx++]);
+ E->IsSuper = Record[Idx++];
}
void ASTStmtReader::VisitObjCMessageExpr(ObjCMessageExpr *E) {
@@ -898,11 +906,6 @@
E->setArg(I, Reader.ReadSubExpr());
}
-void ASTStmtReader::VisitObjCSuperExpr(ObjCSuperExpr *E) {
- VisitExpr(E);
- E->setLoc(ReadSourceLocation(Record, Idx));
-}
-
void ASTStmtReader::VisitObjCForCollectionStmt(ObjCForCollectionStmt *S) {
VisitStmt(S);
S->setElement(Reader.ReadSubStmt());
@@ -1631,9 +1634,6 @@
S = ObjCMessageExpr::CreateEmpty(*Context,
Record[ASTStmtReader::NumExprFields]);
break;
- case EXPR_OBJC_SUPER_EXPR:
- S = new (Context) ObjCSuperExpr(Empty);
- break;
case EXPR_OBJC_ISA:
S = new (Context) ObjCIsaExpr(Empty);
break;