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
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)
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(); }
OS << Node->getDecl()->getName();
}
-void StmtPrinter::VisitObjCSuperRefExpr(ObjCSuperRefExpr *Node) {
- OS << "super";
-}
-
void StmtPrinter::VisitObjCIvarRefExpr(ObjCIvarRefExpr *Node) {
if (Node->getBase()) {
PrintExpr(Node->getBase());
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
//===----------------------------------------------------------------------===//
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);
}
}