diff options
author | John McCall <rjmccall@apple.com> | 2010-11-18 19:01:18 +0000 |
---|---|---|
committer | John McCall <rjmccall@apple.com> | 2010-11-18 19:01:18 +0000 |
commit | 4bc41aee2bfc7bedc2e75453eb5cc443f6d204b1 (patch) | |
tree | d6ac3beb73382e5d550485b3d7fbdfd618b9c8b5 /clang/lib/AST/ExprClassification.cpp | |
parent | 2e831897d61a46ad627f16da00ec522c5a38b72d (diff) | |
download | bcm5719-llvm-4bc41aee2bfc7bedc2e75453eb5cc443f6d204b1.tar.gz bcm5719-llvm-4bc41aee2bfc7bedc2e75453eb5cc443f6d204b1.zip |
Add an assertion, fix a whole bunch of bugs, comment the assertion
out because there are still bugs left.
llvm-svn: 119722
Diffstat (limited to 'clang/lib/AST/ExprClassification.cpp')
-rw-r--r-- | clang/lib/AST/ExprClassification.cpp | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/clang/lib/AST/ExprClassification.cpp b/clang/lib/AST/ExprClassification.cpp index 4677910798f..ba5970038d7 100644 --- a/clang/lib/AST/ExprClassification.cpp +++ b/clang/lib/AST/ExprClassification.cpp @@ -64,6 +64,21 @@ Cl Expr::ClassifyImpl(ASTContext &Ctx, SourceLocation *Loc) const { kind = Cl::CL_Void; } +#if 0 + // Enable this assertion for testing. + switch (kind) { + case Cl::CL_LValue: assert(getValueKind() == VK_LValue); break; + case Cl::CL_XValue: assert(getValueKind() == VK_XValue); break; + case Cl::CL_Function: + case Cl::CL_Void: + case Cl::CL_DuplicateVectorComponents: + case Cl::CL_MemberFunction: + case Cl::CL_SubObjCPropertySetting: + case Cl::CL_ClassTemporary: + case Cl::CL_PRValue: assert(getValueKind() == VK_RValue); break; + } +#endif + Cl::ModifiableType modifiable = Cl::CM_Untested; if (Loc) modifiable = IsModifiable(Ctx, this, kind, *Loc); @@ -380,6 +395,10 @@ static Cl::Kinds ClassifyMemberExpr(ASTContext &Ctx, const MemberExpr *E) { // *E1 is an lvalue if (E->isArrow()) return Cl::CL_LValue; + Expr *Base = E->getBase()->IgnoreParenImpCasts(); + if (isa<ObjCPropertyRefExpr>(Base) || + isa<ObjCImplicitSetterGetterRefExpr>(Base)) + return Cl::CL_SubObjCPropertySetting; return ClassifyInternal(Ctx, E->getBase()); } |