virtual child_iterator child_end();
};
-/// ObjCImplctSetterGetterRefExpr - A dot-syntax expression to access two
+/// ObjCImplicitSetterGetterRefExpr - 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:
/// @end
/// void foo(Test *p1, Test *p2)
/// {
-/// p2.crash = p1.crash; // Uses ObjCImplctSetterGetterRefExpr AST
+/// p2.crash = p1.crash; // Uses ObjCImplicitSetterGetterRefExpr AST
/// }
/// @endcode
-class ObjCImplctSetterGetterRefExpr : public Expr {
+class ObjCImplicitSetterGetterRefExpr : 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;
+ /// Location of the member in the dot syntax notation. This is location
+ /// of the getter method.
+ SourceLocation MemberLoc;
// FIXME: Swizzle these into a single pointer.
Stmt *Base;
ObjCInterfaceDecl *InterfaceDecl;
+ /// Location of the receiver class in the dot syntax notation
+ /// used to call a class method setter/getter.
SourceLocation ClassLoc;
public:
- ObjCImplctSetterGetterRefExpr(ObjCMethodDecl *getter,
+ ObjCImplicitSetterGetterRefExpr(ObjCMethodDecl *getter,
QualType t,
ObjCMethodDecl *setter,
SourceLocation l, Expr *base)
- : Expr(ObjCImplctSetterGetterRefExprClass, t), Setter(setter),
- Getter(getter), Loc(l), Base(base), InterfaceDecl(0),
+ : Expr(ObjCImplicitSetterGetterRefExprClass, t), Setter(setter),
+ Getter(getter), MemberLoc(l), Base(base), InterfaceDecl(0),
ClassLoc(SourceLocation()) {
}
- ObjCImplctSetterGetterRefExpr(ObjCMethodDecl *getter,
+ ObjCImplicitSetterGetterRefExpr(ObjCMethodDecl *getter,
QualType t,
ObjCMethodDecl *setter,
SourceLocation l, ObjCInterfaceDecl *C, SourceLocation CL)
- : Expr(ObjCImplctSetterGetterRefExprClass, t), Setter(setter),
- Getter(getter), Loc(l), Base(0), InterfaceDecl(C), ClassLoc(CL) {
+ : Expr(ObjCImplicitSetterGetterRefExprClass, t), Setter(setter),
+ Getter(getter), MemberLoc(l), Base(0), InterfaceDecl(C), ClassLoc(CL) {
}
- explicit ObjCImplctSetterGetterRefExpr(EmptyShell Empty)
- : Expr(ObjCImplctSetterGetterRefExprClass, Empty){}
+ explicit ObjCImplicitSetterGetterRefExpr(EmptyShell Empty)
+ : Expr(ObjCImplicitSetterGetterRefExprClass, Empty){}
ObjCMethodDecl *getGetterMethod() const { return Getter; }
ObjCMethodDecl *getSetterMethod() const { return Setter; }
virtual SourceRange getSourceRange() const {
if (Base)
- return SourceRange(getBase()->getLocStart(), Loc);
- return SourceRange(ClassLoc, Loc);
+ return SourceRange(getBase()->getLocStart(), MemberLoc);
+ return SourceRange(ClassLoc, MemberLoc);
}
const Expr *getBase() const { return cast_or_null<Expr>(Base); }
Expr *getBase() { return cast_or_null<Expr>(Base); }
void setBase(Expr *base) { Base = base; }
- SourceLocation getLocation() const { return Loc; }
- void setLocation(SourceLocation L) { Loc = L; }
+ SourceLocation getLocation() const { return MemberLoc; }
+ void setLocation(SourceLocation L) { MemberLoc = L; }
SourceLocation getClassLoc() const { return ClassLoc; }
void setClassLoc(SourceLocation L) { ClassLoc = L; }
static bool classof(const Stmt *T) {
- return T->getStmtClass() == ObjCImplctSetterGetterRefExprClass;
+ return T->getStmtClass() == ObjCImplicitSetterGetterRefExprClass;
}
- static bool classof(const ObjCImplctSetterGetterRefExpr *) { return true; }
+ static bool classof(const ObjCImplicitSetterGetterRefExpr *) { return true; }
// Iterators
virtual child_iterator child_begin();
EXPR(ObjCProtocolExpr , Expr)
EXPR(ObjCIvarRefExpr , Expr)
EXPR(ObjCPropertyRefExpr , Expr)
-EXPR(ObjCImplctSetterGetterRefExpr , Expr)
+EXPR(ObjCImplicitSetterGetterRefExpr , Expr)
EXPR(ObjCSuperExpr , Expr)
EXPR(ObjCIsaExpr , Expr)
EXPR_OBJC_IVAR_REF_EXPR,
/// \brief An ObjCPropertyRefExpr record.
EXPR_OBJC_PROPERTY_REF_EXPR,
- /// \brief An ObjCImplctSetterGetterRefExpr record.
+ /// \brief An ObjCImplicitSetterGetterRefExpr record.
EXPR_OBJC_KVC_REF_EXPR,
/// \brief An ObjCMessageExpr record.
EXPR_OBJC_MESSAGE_EXPR,
case ObjCMessageExprClass:
return false;
- case ObjCImplctSetterGetterRefExprClass: { // Dot syntax for message send.
+ case ObjCImplicitSetterGetterRefExprClass: { // Dot syntax for message send.
#if 0
- const ObjCImplctSetterGetterRefExpr *Ref =
- cast<ObjCImplctSetterGetterRefExpr>(this);
+ const ObjCImplicitSetterGetterRefExpr *Ref =
+ cast<ObjCImplicitSetterGetterRefExpr>(this);
// FIXME: We really want the location of the '.' here.
Loc = Ref->getLocation();
R1 = SourceRange(Ref->getLocation(), Ref->getLocation());
return LV_Valid;
case ObjCPropertyRefExprClass: // FIXME: check if read-only property.
return LV_Valid;
- case ObjCImplctSetterGetterRefExprClass: // FIXME: check if read-only property.
+ case ObjCImplicitSetterGetterRefExprClass: // FIXME: check if read-only property.
return LV_Valid;
case PredefinedExprClass:
return LV_Valid;
}
// Assigning to an 'implicit' property?
- else if (isa<ObjCImplctSetterGetterRefExpr>(this)) {
- const ObjCImplctSetterGetterRefExpr* Expr =
- cast<ObjCImplctSetterGetterRefExpr>(this);
+ else if (isa<ObjCImplicitSetterGetterRefExpr>(this)) {
+ const ObjCImplicitSetterGetterRefExpr* Expr =
+ cast<ObjCImplicitSetterGetterRefExpr>(this);
if (Expr->getSetterMethod() == 0)
return MLV_NoSetterProperty;
}
Stmt::child_iterator ObjCPropertyRefExpr::child_begin() { return &Base; }
Stmt::child_iterator ObjCPropertyRefExpr::child_end() { return &Base+1; }
-// ObjCImplctSetterGetterRefExpr
-Stmt::child_iterator ObjCImplctSetterGetterRefExpr::child_begin() {
+// ObjCImplicitSetterGetterRefExpr
+Stmt::child_iterator ObjCImplicitSetterGetterRefExpr::child_begin() {
return &Base;
}
-Stmt::child_iterator ObjCImplctSetterGetterRefExpr::child_end() {
+Stmt::child_iterator ObjCImplicitSetterGetterRefExpr::child_end() {
return &Base+1;
}
void VisitObjCSelectorExpr(ObjCSelectorExpr *Node);
void VisitObjCProtocolExpr(ObjCProtocolExpr *Node);
void VisitObjCPropertyRefExpr(ObjCPropertyRefExpr *Node);
- void VisitObjCImplctSetterGetterRefExpr(
- ObjCImplctSetterGetterRefExpr *Node);
+ void VisitObjCImplicitSetterGetterRefExpr(
+ ObjCImplicitSetterGetterRefExpr *Node);
void VisitObjCIvarRefExpr(ObjCIvarRefExpr *Node);
void VisitObjCSuperExpr(ObjCSuperExpr *Node);
};
Node->getProperty()->getNameAsString().c_str());
}
-void StmtDumper::VisitObjCImplctSetterGetterRefExpr(
- ObjCImplctSetterGetterRefExpr *Node) {
+void StmtDumper::VisitObjCImplicitSetterGetterRefExpr(
+ ObjCImplicitSetterGetterRefExpr *Node) {
DumpExpr(Node);
ObjCMethodDecl *Getter = Node->getGetterMethod();
OS << Node->getProperty()->getNameAsCString();
}
-void StmtPrinter::VisitObjCImplctSetterGetterRefExpr(
- ObjCImplctSetterGetterRefExpr *Node) {
+void StmtPrinter::VisitObjCImplicitSetterGetterRefExpr(
+ ObjCImplicitSetterGetterRefExpr *Node) {
if (Node->getBase()) {
PrintExpr(Node->getBase());
OS << ".";
VisitDecl(S->getProperty());
}
-void StmtProfiler::VisitObjCImplctSetterGetterRefExpr(
- ObjCImplctSetterGetterRefExpr *S) {
+void StmtProfiler::VisitObjCImplicitSetterGetterRefExpr(
+ ObjCImplicitSetterGetterRefExpr *S) {
VisitExpr(S);
VisitDecl(S->getGetterMethod());
VisitDecl(S->getSetterMethod());
return;
case Stmt::ObjCPropertyRefExprClass:
- case Stmt::ObjCImplctSetterGetterRefExprClass:
+ case Stmt::ObjCImplicitSetterGetterRefExprClass:
// FIXME: Property assignments are lvalues, but not really "locations".
// e.g.: self.x = something;
// Here the "self.x" really can translate to a method call (setter) when
Expr* LHS = B->getLHS()->IgnoreParens();
Expr* RHS = B->getRHS()->IgnoreParens();
- // FIXME: Add proper support for ObjCImplctSetterGetterRefExpr.
- if (isa<ObjCImplctSetterGetterRefExpr>(LHS)) {
+ // FIXME: Add proper support for ObjCImplicitSetterGetterRefExpr.
+ if (isa<ObjCImplicitSetterGetterRefExpr>(LHS)) {
Visit(RHS, Pred, Dst);
return;
}
return EmitObjCIvarRefLValue(cast<ObjCIvarRefExpr>(E));
case Expr::ObjCPropertyRefExprClass:
return EmitObjCPropertyRefLValue(cast<ObjCPropertyRefExpr>(E));
- case Expr::ObjCImplctSetterGetterRefExprClass:
- return EmitObjCKVCRefLValue(cast<ObjCImplctSetterGetterRefExpr>(E));
+ case Expr::ObjCImplicitSetterGetterRefExprClass:
+ return EmitObjCKVCRefLValue(cast<ObjCImplicitSetterGetterRefExpr>(E));
case Expr::ObjCSuperExprClass:
return EmitObjCSuperExprLValue(cast<ObjCSuperExpr>(E));
isUnion = true;
CVRQualifiers = PTy->getPointeeType().getCVRQualifiers();
} else if (isa<ObjCPropertyRefExpr>(BaseExpr) ||
- isa<ObjCImplctSetterGetterRefExpr>(BaseExpr)) {
+ isa<ObjCImplicitSetterGetterRefExpr>(BaseExpr)) {
RValue RV = EmitObjCPropertyGet(BaseExpr);
BaseValue = RV.getAggregateAddr();
if (BaseExpr->getType()->isUnionType())
LValue
CodeGenFunction::EmitObjCKVCRefLValue(
- const ObjCImplctSetterGetterRefExpr *E) {
+ const ObjCImplicitSetterGetterRefExpr *E) {
// This is a special l-value that just issues sends when we load or
// store through it.
return LValue::MakeKVCRef(E, E->getType().getCVRQualifiers());
EmitAggLoadOfLValue(E);
}
void VisitObjCPropertyRefExpr(ObjCPropertyRefExpr *E);
- void VisitObjCImplctSetterGetterRefExpr(ObjCImplctSetterGetterRefExpr *E);
+ void VisitObjCImplicitSetterGetterRefExpr(ObjCImplicitSetterGetterRefExpr *E);
void VisitConditionalOperator(const ConditionalOperator *CO);
void VisitChooseExpr(const ChooseExpr *CE);
EmitFinalDestCopy(E, RV);
}
-void AggExprEmitter::VisitObjCImplctSetterGetterRefExpr(
- ObjCImplctSetterGetterRefExpr *E) {
+void AggExprEmitter::VisitObjCImplicitSetterGetterRefExpr(
+ ObjCImplicitSetterGetterRefExpr *E) {
RValue RV = CGF.EmitObjCPropertyGet(E);
EmitFinalDestCopy(E, RV);
}
ComplexPairTy VisitObjCPropertyRefExpr(ObjCPropertyRefExpr *E) {
return EmitLoadOfLValue(E);
}
- ComplexPairTy VisitObjCImplctSetterGetterRefExpr(
- ObjCImplctSetterGetterRefExpr *E) {
+ ComplexPairTy VisitObjCImplicitSetterGetterRefExpr(
+ ObjCImplicitSetterGetterRefExpr *E) {
return EmitLoadOfLValue(E);
}
ComplexPairTy VisitObjCMessageExpr(ObjCMessageExpr *E) {
Value *VisitObjCPropertyRefExpr(ObjCPropertyRefExpr *E) {
return EmitLoadOfLValue(E);
}
- Value *VisitObjCImplctSetterGetterRefExpr(
- ObjCImplctSetterGetterRefExpr *E) {
+ Value *VisitObjCImplicitSetterGetterRefExpr(
+ ObjCImplicitSetterGetterRefExpr *E) {
return EmitLoadOfLValue(E);
}
Value *VisitObjCMessageExpr(ObjCMessageExpr *E) {
EmitScalarExpr(E->getBase()),
false, CallArgList());
} else {
- const ObjCImplctSetterGetterRefExpr *KE =
- cast<ObjCImplctSetterGetterRefExpr>(Exp);
+ const ObjCImplicitSetterGetterRefExpr *KE =
+ cast<ObjCImplicitSetterGetterRefExpr>(Exp);
Selector S = KE->getGetterMethod()->getSelector();
llvm::Value *Receiver;
if (KE->getInterfaceDecl()) {
CGM.getObjCRuntime().GenerateMessageSend(*this, getContext().VoidTy, S,
EmitScalarExpr(E->getBase()),
false, Args);
- } else if (const ObjCImplctSetterGetterRefExpr *E =
- dyn_cast<ObjCImplctSetterGetterRefExpr>(Exp)) {
+ } else if (const ObjCImplicitSetterGetterRefExpr *E =
+ dyn_cast<ObjCImplicitSetterGetterRefExpr>(Exp)) {
Selector S = E->getSetterMethod()->getSelector();
CallArgList Args;
llvm::Value *Receiver;
namespace clang {
class ObjCPropertyRefExpr;
- class ObjCImplctSetterGetterRefExpr;
+ class ObjCImplicitSetterGetterRefExpr;
namespace CodeGen {
// Obj-C property reference expression
const ObjCPropertyRefExpr *PropertyRefExpr;
// ObjC 'implicit' property reference expression
- const ObjCImplctSetterGetterRefExpr *KVCRefExpr;
+ const ObjCImplicitSetterGetterRefExpr *KVCRefExpr;
};
bool Volatile:1;
}
// 'implicit' property ref lvalue
- const ObjCImplctSetterGetterRefExpr *getKVCRefExpr() const {
+ const ObjCImplicitSetterGetterRefExpr *getKVCRefExpr() const {
assert(isKVCRef());
return KVCRefExpr;
}
return R;
}
- static LValue MakeKVCRef(const ObjCImplctSetterGetterRefExpr *E,
+ static LValue MakeKVCRef(const ObjCImplicitSetterGetterRefExpr *E,
unsigned Qualifiers) {
LValue R;
R.LVType = KVCRef;
LValue EmitObjCMessageExprLValue(const ObjCMessageExpr *E);
LValue EmitObjCIvarRefLValue(const ObjCIvarRefExpr *E);
LValue EmitObjCPropertyRefLValue(const ObjCPropertyRefExpr *E);
- LValue EmitObjCKVCRefLValue(const ObjCImplctSetterGetterRefExpr *E);
+ LValue EmitObjCKVCRefLValue(const ObjCImplicitSetterGetterRefExpr *E);
LValue EmitObjCSuperExprLValue(const ObjCSuperExpr *E);
LValue EmitStmtExprLValue(const StmtExpr *E);
unsigned VisitObjCProtocolExpr(ObjCProtocolExpr *E);
unsigned VisitObjCIvarRefExpr(ObjCIvarRefExpr *E);
unsigned VisitObjCPropertyRefExpr(ObjCPropertyRefExpr *E);
- unsigned VisitObjCImplctSetterGetterRefExpr(
- ObjCImplctSetterGetterRefExpr *E);
+ unsigned VisitObjCImplicitSetterGetterRefExpr(
+ ObjCImplicitSetterGetterRefExpr *E);
unsigned VisitObjCMessageExpr(ObjCMessageExpr *E);
unsigned VisitObjCSuperExpr(ObjCSuperExpr *E);
unsigned VisitObjCIsaExpr(ObjCIsaExpr *E);
return 1;
}
-unsigned PCHStmtReader::VisitObjCImplctSetterGetterRefExpr(
- ObjCImplctSetterGetterRefExpr *E) {
+unsigned PCHStmtReader::VisitObjCImplicitSetterGetterRefExpr(
+ ObjCImplicitSetterGetterRefExpr *E) {
VisitExpr(E);
E->setGetterMethod(
cast_or_null<ObjCMethodDecl>(Reader.GetDecl(Record[Idx++])));
S = new (Context) ObjCPropertyRefExpr(Empty);
break;
case pch::EXPR_OBJC_KVC_REF_EXPR:
- S = new (Context) ObjCImplctSetterGetterRefExpr(Empty);
+ S = new (Context) ObjCImplicitSetterGetterRefExpr(Empty);
break;
case pch::EXPR_OBJC_MESSAGE_EXPR:
S = new (Context) ObjCMessageExpr(Empty);
void VisitObjCProtocolExpr(ObjCProtocolExpr *E);
void VisitObjCIvarRefExpr(ObjCIvarRefExpr *E);
void VisitObjCPropertyRefExpr(ObjCPropertyRefExpr *E);
- void VisitObjCImplctSetterGetterRefExpr(
- ObjCImplctSetterGetterRefExpr *E);
+ void VisitObjCImplicitSetterGetterRefExpr(
+ ObjCImplicitSetterGetterRefExpr *E);
void VisitObjCMessageExpr(ObjCMessageExpr *E);
void VisitObjCSuperExpr(ObjCSuperExpr *E);
void VisitObjCIsaExpr(ObjCIsaExpr *E);
Code = pch::EXPR_OBJC_PROPERTY_REF_EXPR;
}
-void PCHStmtWriter::VisitObjCImplctSetterGetterRefExpr(
- ObjCImplctSetterGetterRefExpr *E) {
+void PCHStmtWriter::VisitObjCImplicitSetterGetterRefExpr(
+ ObjCImplicitSetterGetterRefExpr *E) {
VisitExpr(E);
Writer.AddDeclRef(E->getGetterMethod(), Record);
Writer.AddDeclRef(E->getSetterMethod(), Record);
void VisitObjCSelectorExpr(ObjCSelectorExpr *Node);
void VisitObjCProtocolExpr(ObjCProtocolExpr *Node);
void VisitObjCPropertyRefExpr(ObjCPropertyRefExpr *Node);
- void VisitObjCImplctSetterGetterRefExpr(
- ObjCImplctSetterGetterRefExpr *Node);
+ void VisitObjCImplicitSetterGetterRefExpr(
+ ObjCImplicitSetterGetterRefExpr *Node);
void VisitObjCIvarRefExpr(ObjCIvarRefExpr *Node);
void VisitObjCSuperExpr(ObjCSuperExpr *Node);
#endif
Doc.addAttribute("property", Node->getProperty()->getNameAsString());
}
-void StmtXML::VisitObjCImplctSetterGetterRefExpr(
- ObjCImplctSetterGetterRefExpr *Node) {
+void StmtXML::VisitObjCImplicitSetterGetterRefExpr(
+ ObjCImplicitSetterGetterRefExpr *Node) {
DumpExpr(Node);
ObjCMethodDecl *Getter = Node->getGetterMethod();
ObjCMethodDecl *Setter = Node->getSetterMethod();
// Get the expression type from Setter's incoming parameter.
PType = (*(Setter->param_end() -1))->getType();
// FIXME: we must check that the setter has property type.
- return Owned(new (Context) ObjCImplctSetterGetterRefExpr(Getter, PType,
+ return Owned(new (Context) ObjCImplicitSetterGetterRefExpr(Getter, PType,
Setter, MemberLoc, BaseExpr));
}
return ExprError(Diag(MemberLoc, diag::err_property_not_found)
// Get the expression type from Setter's incoming parameter.
PType = (*(Setter->param_end() -1))->getType();
// FIXME: we must check that the setter has property type.
- return Owned(new (Context) ObjCImplctSetterGetterRefExpr(Getter, PType,
+ return Owned(new (Context) ObjCImplicitSetterGetterRefExpr(Getter, PType,
Setter, MemberLoc, BaseExpr));
}
return ExprError(Diag(MemberLoc, diag::err_property_not_found)
E = Setter->param_end(); PI != E; ++PI)
PType = (*PI)->getType();
}
- return Owned(new (Context) ObjCImplctSetterGetterRefExpr(
+ return Owned(new (Context) ObjCImplicitSetterGetterRefExpr(
Getter, PType, Setter,
propertyNameLoc, IFace, receiverNameLoc));
}
// cases now.
unsigned DiagID = diag::warn_unused_expr;
E = E->IgnoreParens();
- if (isa<ObjCImplctSetterGetterRefExpr>(E))
+ if (isa<ObjCImplicitSetterGetterRefExpr>(E))
DiagID = diag::warn_unused_property_expr;
Diag(Loc, DiagID) << R1 << R2;
template<typename Derived>
Sema::OwningExprResult
-TreeTransform<Derived>::TransformObjCImplctSetterGetterRefExpr(
- ObjCImplctSetterGetterRefExpr *E) {
+TreeTransform<Derived>::TransformObjCImplicitSetterGetterRefExpr(
+ ObjCImplicitSetterGetterRefExpr *E) {
// FIXME: Implement this!
assert(false && "Cannot transform Objective-C expressions yet");
return SemaRef.Owned(E->Retain());