]> granicus.if.org Git - clang/commitdiff
Eradicate IsSuper field from ObjCImplicitSetterGetterRefExprClass
authorFariborz Jahanian <fjahanian@apple.com>
Fri, 15 Oct 2010 18:40:05 +0000 (18:40 +0000)
committerFariborz Jahanian <fjahanian@apple.com>
Fri, 15 Oct 2010 18:40:05 +0000 (18:40 +0000)
AST node. (finishing off radar 8525788).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@116603 91177308-0d34-0410-b5e6-96231b3b80d8

include/clang/AST/ExprObjC.h
lib/Serialization/ASTReaderStmt.cpp
lib/Serialization/ASTWriterStmt.cpp

index 407a64938bf54790398e3baf73fe485b38976808..edcbe3d6caf58b4b19184f4e92cc8d94fedfd056 100644 (file)
@@ -336,10 +336,6 @@ class ObjCImplicitSetterGetterRefExpr : public Expr {
   /// the type associated with 'super' keyword.
   QualType SuperTy;
   
-  /// \brief When the receiver in dot-syntax expression is 'super', this is
-  /// set to true.
-  bool IsSuper:1;
-  
 public:
   ObjCImplicitSetterGetterRefExpr(ObjCMethodDecl *getter,
                  QualType t,
@@ -348,9 +344,7 @@ public:
     : Expr(ObjCImplicitSetterGetterRefExprClass, t, /*TypeDependent=*/false, 
            base->isValueDependent()),
       Setter(setter), Getter(getter), MemberLoc(l), Base(base),
-      InterfaceDecl(0), ClassLoc(SourceLocation()) {
-      IsSuper = false;
-    }
+      InterfaceDecl(0), ClassLoc(SourceLocation()) {}
   
   ObjCImplicitSetterGetterRefExpr(ObjCMethodDecl *getter,
                                   QualType t,
@@ -361,8 +355,8 @@ public:
   : Expr(ObjCImplicitSetterGetterRefExprClass, t, /*TypeDependent=*/false, 
          false),
   Setter(setter), Getter(getter), MemberLoc(l),
-  InterfaceDecl(0), ClassLoc(SourceLocation()), 
-  SuperLoc(sl), SuperTy(st), IsSuper(true) {
+  Base(0), InterfaceDecl(0), ClassLoc(SourceLocation()), 
+  SuperLoc(sl), SuperTy(st) {
   }
   
   ObjCImplicitSetterGetterRefExpr(ObjCMethodDecl *getter,
@@ -371,9 +365,7 @@ public:
                  SourceLocation l, ObjCInterfaceDecl *C, SourceLocation CL)
     : Expr(ObjCImplicitSetterGetterRefExprClass, t, false, false),
       Setter(setter), Getter(getter), MemberLoc(l), Base(0), InterfaceDecl(C),
-      ClassLoc(CL) {
-        IsSuper = false;
-    }
+      ClassLoc(CL) {}
   explicit ObjCImplicitSetterGetterRefExpr(EmptyShell Empty)
            : Expr(ObjCImplicitSetterGetterRefExprClass, Empty){}
 
@@ -402,7 +394,9 @@ public:
   
   SourceLocation getSuperLocation() const { return SuperLoc; }
   QualType getSuperType() const { return SuperTy; }
-  bool isSuperReceiver() const { return IsSuper; }
+  /// \brief When the receiver in dot-syntax expression is 'super', this
+  /// method returns true if both Base expression and Interface are null.
+  bool isSuperReceiver() const { return InterfaceDecl == 0 && Base == 0; }
 
   static bool classof(const Stmt *T) {
     return T->getStmtClass() == ObjCImplicitSetterGetterRefExprClass;
@@ -417,7 +411,6 @@ private:
   friend class ASTStmtReader;
   void setSuperLocation(SourceLocation Loc) { SuperLoc = Loc; }
   void setSuperType(QualType T) { SuperTy = T; }
-  void setSuperReceiver(bool bv) { IsSuper = bv; }
 };
 
 /// \brief An expression that sends a message to the given Objective-C
index dad3b70cb27322389cf004842709c38e5a999721..f1137c0e3386844258d8736b3002ea601453bf15 100644 (file)
@@ -873,7 +873,6 @@ void ASTStmtReader::VisitObjCImplicitSetterGetterRefExpr(
   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) {
index b4d9f4dee2921dacbdef1fe47fac074edfd053da..657cd68343f1311c64cb32729e9802d2307ff47e 100644 (file)
@@ -846,7 +846,6 @@ void ASTStmtWriter::VisitObjCImplicitSetterGetterRefExpr(
   Writer.AddSourceLocation(E->getClassLoc(), Record);
   Writer.AddSourceLocation(E->getSuperLocation(), Record);
   Writer.AddTypeRef(E->getSuperType(), Record);
-  Record.push_back(E->isSuperReceiver());
   Code = serialization::EXPR_OBJC_KVC_REF_EXPR;
 }