From 34376a68c414ccf372e9d83f3251ecb08eb055f2 Mon Sep 17 00:00:00 2001 From: John McCall Date: Sat, 4 Dec 2010 03:47:34 +0000 Subject: Although we currently have explicit lvalue-to-rvalue conversions, they're not actually frequently used, because ImpCastExprToType only creates a node if the types differ. So explicitly create an ICE in the lvalue-to-rvalue conversion code in DefaultFunctionArrayLvalueConversion() as well as several other new places, and consistently deal with the consequences throughout the compiler. In addition, introduce a new cast kind for loading an ObjCProperty l-value, and make sure we emit those nodes whenever an ObjCProperty l-value appears that's not on the LHS of an assignment operator. This breaks a couple of rewriter tests, which I've x-failed until future development occurs on the rewriter. Ted Kremenek kindly contributed the analyzer workarounds in this patch. llvm-svn: 120890 --- clang/lib/Sema/SemaExprObjC.cpp | 3 +++ 1 file changed, 3 insertions(+) (limited to 'clang/lib/Sema/SemaExprObjC.cpp') diff --git a/clang/lib/Sema/SemaExprObjC.cpp b/clang/lib/Sema/SemaExprObjC.cpp index e60aa071e2d..d63b228f36c 100644 --- a/clang/lib/Sema/SemaExprObjC.cpp +++ b/clang/lib/Sema/SemaExprObjC.cpp @@ -284,6 +284,9 @@ bool Sema::CheckMessageArgumentTypes(Expr **Args, unsigned NumArgs, } bool Sema::isSelfExpr(Expr *RExpr) { + if (ImplicitCastExpr *ICE = dyn_cast(RExpr)) + if (ICE->getCastKind() == CK_LValueToRValue) + RExpr = ICE->getSubExpr(); if (DeclRefExpr *DRE = dyn_cast(RExpr)) if (DRE->getDecl()->getIdentifier() == &Context.Idents.get("self")) return true; -- cgit v1.2.3