diff options
author | Fariborz Jahanian <fjahanian@apple.com> | 2009-08-18 20:50:23 +0000 |
---|---|---|
committer | Fariborz Jahanian <fjahanian@apple.com> | 2009-08-18 20:50:23 +0000 |
commit | 154440e6a8fa6ac5bca395876d79b530b39a2c1c (patch) | |
tree | 0e2cb0ba45e69bfb532ce6002a3f1a91780a9c42 /include/clang | |
parent | f53b4433abb7a3bc14c0329d3175cbc291280137 (diff) |
Renamed ObjCKVCRefExpr to ObjCImplctSetterGetterRefExpr.
Removed an unnecessary loop to get to setters incoming
argument. Added DoxyGen comments. Still more work
to do in this area (WIP).
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@79365 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/clang')
-rw-r--r-- | include/clang/AST/ExprObjC.h | 38 | ||||
-rw-r--r-- | include/clang/AST/StmtNodes.def | 2 | ||||
-rw-r--r-- | include/clang/Frontend/PCHBitCodes.h | 2 |
3 files changed, 27 insertions, 15 deletions
diff --git a/include/clang/AST/ExprObjC.h b/include/clang/AST/ExprObjC.h index d04d4977a0..03d54afa02 100644 --- a/include/clang/AST/ExprObjC.h +++ b/include/clang/AST/ExprObjC.h @@ -257,13 +257,24 @@ public: virtual child_iterator child_end(); }; -/// ObjCKVCRefExpr - A dot-syntax expression to access "implicit" properties -/// (i.e. methods following the property naming convention). KVC stands for -/// Key Value Encoding, a generic concept for accessing or setting a 'Key' -/// value for an object. -/// -class ObjCKVCRefExpr : public Expr { +/// ObjCImplctSetterGetterRefExpr - A dot-syntax expression to access two +/// methods; one to set a value to an 'ivar' (Setter) and the other to access +/// an 'ivar' (Setter). +/// An example for use of this AST is: +/// @code +/// @interface Test { } +/// - (Test *)crash; +/// - (void)setCrash: (Test*)value; +/// @end +/// void foo(Test *p1, Test *p2) +/// { +/// p2.crash = p1.crash; // Uses ObjCImplctSetterGetterRefExpr AST +/// } +/// @endcode +class ObjCImplctSetterGetterRefExpr : public Expr { + /// Setter - Setter method user declared for setting its 'ivar' to a value ObjCMethodDecl *Setter; + /// Getter - Getter method user declared for accessing 'ivar' it controls. ObjCMethodDecl *Getter; SourceLocation Loc; // FIXME: Swizzle these into a single pointer. @@ -272,22 +283,23 @@ class ObjCKVCRefExpr : public Expr { SourceLocation ClassLoc; public: - ObjCKVCRefExpr(ObjCMethodDecl *getter, + ObjCImplctSetterGetterRefExpr(ObjCMethodDecl *getter, QualType t, ObjCMethodDecl *setter, SourceLocation l, Expr *base) - : Expr(ObjCKVCRefExprClass, t), Setter(setter), + : Expr(ObjCImplctSetterGetterRefExprClass, t), Setter(setter), Getter(getter), Loc(l), Base(base), ClassProp(0), ClassLoc(SourceLocation()) { } - ObjCKVCRefExpr(ObjCMethodDecl *getter, + ObjCImplctSetterGetterRefExpr(ObjCMethodDecl *getter, QualType t, ObjCMethodDecl *setter, SourceLocation l, ObjCInterfaceDecl *C, SourceLocation CL) - : Expr(ObjCKVCRefExprClass, t), Setter(setter), + : Expr(ObjCImplctSetterGetterRefExprClass, t), Setter(setter), Getter(getter), Loc(l), Base(0), ClassProp(C), ClassLoc(CL) { } - explicit ObjCKVCRefExpr(EmptyShell Empty) : Expr(ObjCKVCRefExprClass, Empty){} + explicit ObjCImplctSetterGetterRefExpr(EmptyShell Empty) + : Expr(ObjCImplctSetterGetterRefExprClass, Empty){} ObjCMethodDecl *getGetterMethod() const { return Getter; } ObjCMethodDecl *getSetterMethod() const { return Setter; } @@ -311,9 +323,9 @@ public: void setClassLoc(SourceLocation L) { ClassLoc = L; } static bool classof(const Stmt *T) { - return T->getStmtClass() == ObjCKVCRefExprClass; + return T->getStmtClass() == ObjCImplctSetterGetterRefExprClass; } - static bool classof(const ObjCKVCRefExpr *) { return true; } + static bool classof(const ObjCImplctSetterGetterRefExpr *) { return true; } // Iterators virtual child_iterator child_begin(); diff --git a/include/clang/AST/StmtNodes.def b/include/clang/AST/StmtNodes.def index e278d1763a..ebbeba2ac2 100644 --- a/include/clang/AST/StmtNodes.def +++ b/include/clang/AST/StmtNodes.def @@ -144,7 +144,7 @@ EXPR(ObjCSelectorExpr , Expr) EXPR(ObjCProtocolExpr , Expr) EXPR(ObjCIvarRefExpr , Expr) EXPR(ObjCPropertyRefExpr , Expr) -EXPR(ObjCKVCRefExpr , Expr) +EXPR(ObjCImplctSetterGetterRefExpr , Expr) EXPR(ObjCSuperExpr , Expr) EXPR(ObjCIsaExpr , Expr) diff --git a/include/clang/Frontend/PCHBitCodes.h b/include/clang/Frontend/PCHBitCodes.h index 15f5518210..f4284e9c5c 100644 --- a/include/clang/Frontend/PCHBitCodes.h +++ b/include/clang/Frontend/PCHBitCodes.h @@ -636,7 +636,7 @@ namespace clang { EXPR_OBJC_IVAR_REF_EXPR, /// \brief An ObjCPropertyRefExpr record. EXPR_OBJC_PROPERTY_REF_EXPR, - /// \brief An ObjCKVCRefExpr record. + /// \brief An ObjCImplctSetterGetterRefExpr record. EXPR_OBJC_KVC_REF_EXPR, /// \brief An ObjCMessageExpr record. EXPR_OBJC_MESSAGE_EXPR, |