[cfe-commits] r116603 - in /cfe/trunk: include/clang/AST/ExprObjC.h lib/Serialization/ASTReaderStmt.cpp lib/Serialization/ASTWriterStmt.cpp

Fariborz Jahanian fjahanian at apple.com
Fri Oct 15 11:40:05 PDT 2010


Author: fjahanian
Date: Fri Oct 15 13:40:05 2010
New Revision: 116603

URL: http://llvm.org/viewvc/llvm-project?rev=116603&view=rev
Log:
Eradicate IsSuper field from ObjCImplicitSetterGetterRefExprClass
AST node. (finishing off radar 8525788).

Modified:
    cfe/trunk/include/clang/AST/ExprObjC.h
    cfe/trunk/lib/Serialization/ASTReaderStmt.cpp
    cfe/trunk/lib/Serialization/ASTWriterStmt.cpp

Modified: cfe/trunk/include/clang/AST/ExprObjC.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/AST/ExprObjC.h?rev=116603&r1=116602&r2=116603&view=diff
==============================================================================
--- cfe/trunk/include/clang/AST/ExprObjC.h (original)
+++ cfe/trunk/include/clang/AST/ExprObjC.h Fri Oct 15 13:40:05 2010
@@ -336,10 +336,6 @@
   /// 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 @@
     : 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 @@
   : 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 @@
                  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 @@
   
   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 @@
   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

Modified: cfe/trunk/lib/Serialization/ASTReaderStmt.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Serialization/ASTReaderStmt.cpp?rev=116603&r1=116602&r2=116603&view=diff
==============================================================================
--- cfe/trunk/lib/Serialization/ASTReaderStmt.cpp (original)
+++ cfe/trunk/lib/Serialization/ASTReaderStmt.cpp Fri Oct 15 13:40:05 2010
@@ -873,7 +873,6 @@
   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) {

Modified: cfe/trunk/lib/Serialization/ASTWriterStmt.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Serialization/ASTWriterStmt.cpp?rev=116603&r1=116602&r2=116603&view=diff
==============================================================================
--- cfe/trunk/lib/Serialization/ASTWriterStmt.cpp (original)
+++ cfe/trunk/lib/Serialization/ASTWriterStmt.cpp Fri Oct 15 13:40:05 2010
@@ -846,7 +846,6 @@
   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;
 }
 





More information about the cfe-commits mailing list