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 /lib/AST | |
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 'lib/AST')
-rw-r--r-- | lib/AST/Expr.cpp | 32 | ||||
-rw-r--r-- | lib/AST/StmtDumper.cpp | 6 | ||||
-rw-r--r-- | lib/AST/StmtPrinter.cpp | 7 | ||||
-rw-r--r-- | lib/AST/StmtProfile.cpp | 3 |
4 files changed, 30 insertions, 18 deletions
diff --git a/lib/AST/Expr.cpp b/lib/AST/Expr.cpp index ec44584585..225f177903 100644 --- a/lib/AST/Expr.cpp +++ b/lib/AST/Expr.cpp @@ -542,14 +542,15 @@ bool Expr::isUnusedResultAWarning(SourceLocation &Loc, SourceRange &R1, case ObjCMessageExprClass: return false; - case ObjCKVCRefExprClass: { // Dot syntax for message send. + case ObjCImplctSetterGetterRefExprClass: { // Dot syntax for message send. #if 0 - const ObjCKVCRefExpr *KVCRef = cast<ObjCKVCRefExpr>(this); + const ObjCImplctSetterGetterRefExpr *Ref = + cast<ObjCImplctSetterGetterRefExpr>(this); // FIXME: We really want the location of the '.' here. - Loc = KVCRef->getLocation(); - R1 = SourceRange(KVCRef->getLocation(), KVCRef->getLocation()); - if (KVCRef->getBase()) - R2 = KVCRef->getBase()->getSourceRange(); + Loc = Ref->getLocation(); + R1 = SourceRange(Ref->getLocation(), Ref->getLocation()); + if (Ref->getBase()) + R2 = Ref->getBase()->getSourceRange(); #else Loc = getExprLoc(); R1 = getSourceRange(); @@ -793,7 +794,7 @@ Expr::isLvalueResult Expr::isLvalueInternal(ASTContext &Ctx) const { return LV_Valid; case ObjCPropertyRefExprClass: // FIXME: check if read-only property. return LV_Valid; - case ObjCKVCRefExprClass: // FIXME: check if read-only property. + case ObjCImplctSetterGetterRefExprClass: // FIXME: check if read-only property. return LV_Valid; case PredefinedExprClass: return LV_Valid; @@ -914,9 +915,10 @@ Expr::isModifiableLvalue(ASTContext &Ctx, SourceLocation *Loc) const { } // Assigning to an 'implicit' property? - else if (isa<ObjCKVCRefExpr>(this)) { - const ObjCKVCRefExpr* KVCExpr = cast<ObjCKVCRefExpr>(this); - if (KVCExpr->getSetterMethod() == 0) + else if (isa<ObjCImplctSetterGetterRefExpr>(this)) { + const ObjCImplctSetterGetterRefExpr* Expr = + cast<ObjCImplctSetterGetterRefExpr>(this); + if (Expr->getSetterMethod() == 0) return MLV_NoSetterProperty; } return MLV_Valid; @@ -1861,9 +1863,13 @@ Stmt::child_iterator ObjCIvarRefExpr::child_end() { return &Base+1; } Stmt::child_iterator ObjCPropertyRefExpr::child_begin() { return &Base; } Stmt::child_iterator ObjCPropertyRefExpr::child_end() { return &Base+1; } -// ObjCKVCRefExpr -Stmt::child_iterator ObjCKVCRefExpr::child_begin() { return &Base; } -Stmt::child_iterator ObjCKVCRefExpr::child_end() { return &Base+1; } +// ObjCImplctSetterGetterRefExpr +Stmt::child_iterator ObjCImplctSetterGetterRefExpr::child_begin() { + return &Base; +} +Stmt::child_iterator ObjCImplctSetterGetterRefExpr::child_end() { + return &Base+1; +} // ObjCSuperExpr Stmt::child_iterator ObjCSuperExpr::child_begin() { return child_iterator(); } diff --git a/lib/AST/StmtDumper.cpp b/lib/AST/StmtDumper.cpp index d3bd8add7f..6a48d5a47b 100644 --- a/lib/AST/StmtDumper.cpp +++ b/lib/AST/StmtDumper.cpp @@ -148,7 +148,8 @@ namespace { void VisitObjCSelectorExpr(ObjCSelectorExpr *Node); void VisitObjCProtocolExpr(ObjCProtocolExpr *Node); void VisitObjCPropertyRefExpr(ObjCPropertyRefExpr *Node); - void VisitObjCKVCRefExpr(ObjCKVCRefExpr *Node); + void VisitObjCImplctSetterGetterRefExpr( + ObjCImplctSetterGetterRefExpr *Node); void VisitObjCIvarRefExpr(ObjCIvarRefExpr *Node); void VisitObjCSuperExpr(ObjCSuperExpr *Node); }; @@ -521,7 +522,8 @@ void StmtDumper::VisitObjCPropertyRefExpr(ObjCPropertyRefExpr *Node) { Node->getProperty()->getNameAsString().c_str()); } -void StmtDumper::VisitObjCKVCRefExpr(ObjCKVCRefExpr *Node) { +void StmtDumper::VisitObjCImplctSetterGetterRefExpr( + ObjCImplctSetterGetterRefExpr *Node) { DumpExpr(Node); ObjCMethodDecl *Getter = Node->getGetterMethod(); diff --git a/lib/AST/StmtPrinter.cpp b/lib/AST/StmtPrinter.cpp index a2c04978b0..9b8dfce00e 100644 --- a/lib/AST/StmtPrinter.cpp +++ b/lib/AST/StmtPrinter.cpp @@ -518,12 +518,15 @@ void StmtPrinter::VisitObjCPropertyRefExpr(ObjCPropertyRefExpr *Node) { OS << Node->getProperty()->getNameAsCString(); } -void StmtPrinter::VisitObjCKVCRefExpr(ObjCKVCRefExpr *Node) { +void StmtPrinter::VisitObjCImplctSetterGetterRefExpr( + ObjCImplctSetterGetterRefExpr *Node) { if (Node->getBase()) { PrintExpr(Node->getBase()); OS << "."; } - // FIXME: Setter/Getter names + if (Node->getGetterMethod()) + OS << Node->getGetterMethod()->getNameAsString(); + } void StmtPrinter::VisitPredefinedExpr(PredefinedExpr *Node) { diff --git a/lib/AST/StmtProfile.cpp b/lib/AST/StmtProfile.cpp index 5d9b8bc7bb..cb32e8d25f 100644 --- a/lib/AST/StmtProfile.cpp +++ b/lib/AST/StmtProfile.cpp @@ -583,7 +583,8 @@ void StmtProfiler::VisitObjCPropertyRefExpr(ObjCPropertyRefExpr *S) { VisitDecl(S->getProperty()); } -void StmtProfiler::VisitObjCKVCRefExpr(ObjCKVCRefExpr *S) { +void StmtProfiler::VisitObjCImplctSetterGetterRefExpr( + ObjCImplctSetterGetterRefExpr *S) { VisitExpr(S); VisitDecl(S->getGetterMethod()); VisitDecl(S->getSetterMethod()); |