summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema
diff options
context:
space:
mode:
authorFariborz Jahanian <fjahanian@apple.com>2012-04-10 17:30:10 +0000
committerFariborz Jahanian <fjahanian@apple.com>2012-04-10 17:30:10 +0000
commitca5c597fd017578d7ba5ad536d0c4f6832ffc85a (patch)
treeda115442ee68371c0cff1beb5b2b5268e04b1c18 /clang/lib/Sema
parent141e17ae8bcb44e47ec35a9c7d238eca9db15bba (diff)
downloadbcm5719-llvm-ca5c597fd017578d7ba5ad536d0c4f6832ffc85a.tar.gz
bcm5719-llvm-ca5c597fd017578d7ba5ad536d0c4f6832ffc85a.zip
objective-c: remove IsConstProperty as it does not
seem to get called any more. Also add an assert in isModifiableLvalue. llvm-svn: 154410
Diffstat (limited to 'clang/lib/Sema')
-rw-r--r--clang/lib/Sema/SemaExpr.cpp18
1 files changed, 1 insertions, 17 deletions
diff --git a/clang/lib/Sema/SemaExpr.cpp b/clang/lib/Sema/SemaExpr.cpp
index bf9b0ae9886..1711f356c62 100644
--- a/clang/lib/Sema/SemaExpr.cpp
+++ b/clang/lib/Sema/SemaExpr.cpp
@@ -7143,21 +7143,6 @@ static bool IsReadonlyProperty(Expr *E, Sema &S) {
return false;
}
-static bool IsConstProperty(Expr *E, Sema &S) {
- const ObjCPropertyRefExpr *PropExpr = dyn_cast<ObjCPropertyRefExpr>(E);
- if (!PropExpr) return false;
-
- assert(!S.Context.hasSameType(PropExpr->getType(),
- S.Context.PseudoObjectTy)
- && "property expression cannot be a pseudo object");
-
- if (PropExpr->isImplicitProperty()) return false;
-
- ObjCPropertyDecl *PDecl = PropExpr->getExplicitProperty();
- QualType T = PDecl->getType().getNonReferenceType();
- return T.isConstQualified();
-}
-
static bool IsReadonlyMessage(Expr *E, Sema &S) {
const MemberExpr *ME = dyn_cast<MemberExpr>(E);
if (!ME) return false;
@@ -7197,13 +7182,12 @@ static NonConstCaptureKind isReferenceToNonConstCapture(Sema &S, Expr *E) {
/// CheckForModifiableLvalue - Verify that E is a modifiable lvalue. If not,
/// emit an error and return true. If so, return false.
static bool CheckForModifiableLvalue(Expr *E, SourceLocation Loc, Sema &S) {
+ assert(!E->hasPlaceholderType(BuiltinType::PseudoObject));
SourceLocation OrigLoc = Loc;
Expr::isModifiableLvalueResult IsLV = E->isModifiableLvalue(S.Context,
&Loc);
if (IsLV == Expr::MLV_Valid && IsReadonlyProperty(E, S))
IsLV = Expr::MLV_ReadonlyProperty;
- else if (IsLV == Expr::MLV_ConstQualified && IsConstProperty(E, S))
- IsLV = Expr::MLV_Valid;
else if (IsLV == Expr::MLV_ClassTemporary && IsReadonlyMessage(E, S))
IsLV = Expr::MLV_InvalidMessageExpression;
if (IsLV == Expr::MLV_Valid)
OpenPOWER on IntegriCloud