diff options
author | John McCall <rjmccall@apple.com> | 2010-12-02 01:19:52 +0000 |
---|---|---|
committer | John McCall <rjmccall@apple.com> | 2010-12-02 01:19:52 +0000 |
commit | 12f78a6741a4cb3d904340f8d3d2714568b50e7a (patch) | |
tree | 7d3c0d003eb7060d7a7a985d6f4fa284f9207c35 /lib/AST/ExprClassification.cpp | |
parent | 9d0b2b728b9a431546b11252793844bf7506ec84 (diff) |
Simplify the ASTs by consolidating ObjCImplicitGetterSetterExpr and ObjCPropertyRefExpr
into the latter.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@120643 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/AST/ExprClassification.cpp')
-rw-r--r-- | lib/AST/ExprClassification.cpp | 18 |
1 files changed, 6 insertions, 12 deletions
diff --git a/lib/AST/ExprClassification.cpp b/lib/AST/ExprClassification.cpp index 4025f18a3b..e55545e693 100644 --- a/lib/AST/ExprClassification.cpp +++ b/lib/AST/ExprClassification.cpp @@ -104,7 +104,6 @@ static Cl::Kinds ClassifyInternal(ASTContext &Ctx, const Expr *E) { case Expr::PredefinedExprClass: // Property references are lvalues case Expr::ObjCPropertyRefExprClass: - case Expr::ObjCImplicitSetterGetterRefExprClass: // C++ [expr.typeid]p1: The result of a typeid expression is an lvalue of... case Expr::CXXTypeidExprClass: // Unresolved lookups get classified as lvalues. @@ -195,8 +194,7 @@ static Cl::Kinds ClassifyInternal(ASTContext &Ctx, const Expr *E) { Cl::Kinds K = ClassifyInternal(Ctx, Op); if (K != Cl::CL_LValue) return K; - if (isa<ObjCPropertyRefExpr>(Op) || - isa<ObjCImplicitSetterGetterRefExpr>(Op)) + if (isa<ObjCPropertyRefExpr>(Op)) return Cl::CL_SubObjCPropertySetting; return Cl::CL_LValue; } @@ -368,8 +366,7 @@ static Cl::Kinds ClassifyMemberExpr(ASTContext &Ctx, const MemberExpr *E) { return Cl::CL_LValue; // ObjC property accesses are not lvalues, but get special treatment. Expr *Base = E->getBase()->IgnoreParens(); - if (isa<ObjCPropertyRefExpr>(Base) || - isa<ObjCImplicitSetterGetterRefExpr>(Base)) + if (isa<ObjCPropertyRefExpr>(Base)) return Cl::CL_SubObjCPropertySetting; return ClassifyInternal(Ctx, Base); } @@ -395,8 +392,7 @@ static Cl::Kinds ClassifyMemberExpr(ASTContext &Ctx, const MemberExpr *E) { if (E->isArrow()) return Cl::CL_LValue; Expr *Base = E->getBase()->IgnoreParenImpCasts(); - if (isa<ObjCPropertyRefExpr>(Base) || - isa<ObjCImplicitSetterGetterRefExpr>(Base)) + if (isa<ObjCPropertyRefExpr>(Base)) return Cl::CL_SubObjCPropertySetting; return ClassifyInternal(Ctx, E->getBase()); } @@ -498,9 +494,8 @@ static Cl::ModifiableType IsModifiable(ASTContext &Ctx, const Expr *E, // Assignment to a property in ObjC is an implicit setter access. But a // setter might not exist. - if (const ObjCImplicitSetterGetterRefExpr *Expr = - dyn_cast<ObjCImplicitSetterGetterRefExpr>(E)) { - if (Expr->getSetterMethod() == 0) + if (const ObjCPropertyRefExpr *Expr = dyn_cast<ObjCPropertyRefExpr>(E)) { + if (Expr->isImplicitProperty() && Expr->getImplicitPropertySetter() == 0) return Cl::CM_NoSetterProperty; } @@ -517,8 +512,7 @@ static Cl::ModifiableType IsModifiable(ASTContext &Ctx, const Expr *E, // Records with any const fields (recursively) are not modifiable. if (const RecordType *R = CT->getAs<RecordType>()) { - assert((isa<ObjCImplicitSetterGetterRefExpr>(E) || - isa<ObjCPropertyRefExpr>(E) || + assert((isa<ObjCPropertyRefExpr>(E) || !Ctx.getLangOptions().CPlusPlus) && "C++ struct assignment should be resolved by the " "copy assignment operator."); |