[cfe-commits] r54617 - in /cfe/trunk: include/clang/AST/ExprObjC.h include/clang/AST/StmtNodes.def lib/AST/Expr.cpp lib/AST/StmtPrinter.cpp lib/AST/StmtSerialization.cpp lib/Sema/SemaExpr.cpp
Steve Naroff
snaroff at apple.com
Sun Aug 10 12:10:42 PDT 2008
Author: snaroff
Date: Sun Aug 10 14:10:41 2008
New Revision: 54617
URL: http://llvm.org/viewvc/llvm-project?rev=54617&view=rev
Log:
Cleanup ObjCSuperRefExpr (remove last usage and AST node:-).
Modified:
cfe/trunk/include/clang/AST/ExprObjC.h
cfe/trunk/include/clang/AST/StmtNodes.def
cfe/trunk/lib/AST/Expr.cpp
cfe/trunk/lib/AST/StmtPrinter.cpp
cfe/trunk/lib/AST/StmtSerialization.cpp
cfe/trunk/lib/Sema/SemaExpr.cpp
Modified: cfe/trunk/include/clang/AST/ExprObjC.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/AST/ExprObjC.h?rev=54617&r1=54616&r2=54617&view=diff
==============================================================================
--- cfe/trunk/include/clang/AST/ExprObjC.h (original)
+++ cfe/trunk/include/clang/AST/ExprObjC.h Sun Aug 10 14:10:41 2008
@@ -359,28 +359,6 @@
static ObjCMessageExpr* CreateImpl(llvm::Deserializer& D, ASTContext& C);
};
-/// ObjCSuperRefExpr - A reference to super.
-class ObjCSuperRefExpr : public Expr {
- SourceLocation Loc;
-public:
- ObjCSuperRefExpr(QualType t, SourceLocation l) :
- Expr(ObjCSuperRefExprClass, t), Loc(l) {}
-
- virtual SourceRange getSourceRange() const { return SourceRange(Loc); }
-
- static bool classof(const Stmt *T) {
- return T->getStmtClass() == ObjCSuperRefExprClass;
- }
- static bool classof(const ObjCSuperRefExpr *) { return true; }
-
- // Iterators
- virtual child_iterator child_begin();
- virtual child_iterator child_end();
-
- virtual void EmitImpl(llvm::Serializer& S) const;
- static ObjCSuperRefExpr* CreateImpl(llvm::Deserializer& D, ASTContext& C);
-};
-
} // end namespace clang
#endif
Modified: cfe/trunk/include/clang/AST/StmtNodes.def
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/AST/StmtNodes.def?rev=54617&r1=54616&r2=54617&view=diff
==============================================================================
--- cfe/trunk/include/clang/AST/StmtNodes.def (original)
+++ cfe/trunk/include/clang/AST/StmtNodes.def Sun Aug 10 14:10:41 2008
@@ -101,11 +101,10 @@
STMT(74, ObjCProtocolExpr , Expr)
STMT(75, ObjCIvarRefExpr , Expr)
STMT(76, ObjCPropertyRefExpr , Expr)
-STMT(77, ObjCSuperRefExpr , Expr)
// Clang Extensions.
-STMT(78, OverloadExpr , Expr)
-STMT(79, ShuffleVectorExpr , Expr)
+STMT(77, OverloadExpr , Expr)
+STMT(78, ShuffleVectorExpr , Expr)
LAST_EXPR(79)
Modified: cfe/trunk/lib/AST/Expr.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/Expr.cpp?rev=54617&r1=54616&r2=54617&view=diff
==============================================================================
--- cfe/trunk/lib/AST/Expr.cpp (original)
+++ cfe/trunk/lib/AST/Expr.cpp Sun Aug 10 14:10:41 2008
@@ -1259,10 +1259,6 @@
Stmt::child_iterator ObjCPropertyRefExpr::child_begin() { return &Base; }
Stmt::child_iterator ObjCPropertyRefExpr::child_end() { return &Base+1; }
-// ObjCSuperRefExpr
-Stmt::child_iterator ObjCSuperRefExpr::child_begin() { return child_iterator();}
-Stmt::child_iterator ObjCSuperRefExpr::child_end() { return child_iterator(); }
-
// PredefinedExpr
Stmt::child_iterator PredefinedExpr::child_begin() { return child_iterator(); }
Stmt::child_iterator PredefinedExpr::child_end() { return child_iterator(); }
Modified: cfe/trunk/lib/AST/StmtPrinter.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/StmtPrinter.cpp?rev=54617&r1=54616&r2=54617&view=diff
==============================================================================
--- cfe/trunk/lib/AST/StmtPrinter.cpp (original)
+++ cfe/trunk/lib/AST/StmtPrinter.cpp Sun Aug 10 14:10:41 2008
@@ -476,10 +476,6 @@
OS << Node->getDecl()->getName();
}
-void StmtPrinter::VisitObjCSuperRefExpr(ObjCSuperRefExpr *Node) {
- OS << "super";
-}
-
void StmtPrinter::VisitObjCIvarRefExpr(ObjCIvarRefExpr *Node) {
if (Node->getBase()) {
PrintExpr(Node->getBase());
Modified: cfe/trunk/lib/AST/StmtSerialization.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/StmtSerialization.cpp?rev=54617&r1=54616&r2=54617&view=diff
==============================================================================
--- cfe/trunk/lib/AST/StmtSerialization.cpp (original)
+++ cfe/trunk/lib/AST/StmtSerialization.cpp Sun Aug 10 14:10:41 2008
@@ -1089,17 +1089,6 @@
return new ObjCStringLiteral(String,T,L);
}
-void ObjCSuperRefExpr::EmitImpl(Serializer& S) const {
- S.Emit(Loc);
- S.Emit(getType());
-}
-
-ObjCSuperRefExpr* ObjCSuperRefExpr::CreateImpl(Deserializer& D, ASTContext& C) {
- SourceLocation Loc = SourceLocation::ReadVal(D);
- QualType T = QualType::ReadVal(D);
- return new ObjCSuperRefExpr(T, Loc);
-}
-
//===----------------------------------------------------------------------===//
// C++ Serialization
//===----------------------------------------------------------------------===//
Modified: cfe/trunk/lib/Sema/SemaExpr.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaExpr.cpp?rev=54617&r1=54616&r2=54617&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/SemaExpr.cpp (original)
+++ cfe/trunk/lib/Sema/SemaExpr.cpp Sun Aug 10 14:10:41 2008
@@ -332,10 +332,11 @@
static_cast<Expr*>(SelfExpr.Val), true, true);
}
}
+ // Needed to implement property "super.method" notation.
if (SD == 0 && !strcmp(II.getName(), "super")) {
QualType T = Context.getPointerType(Context.getObjCInterfaceType(
getCurMethodDecl()->getClassInterface()));
- return new ObjCSuperRefExpr(T, Loc);
+ return new PredefinedExpr(Loc, T, PredefinedExpr::ObjCSuper);
}
}
More information about the cfe-commits
mailing list