From fec112d50e801ea624900de5efd4bfd210ce53a4 Mon Sep 17 00:00:00 2001 From: John McCall Date: Fri, 9 Sep 2011 06:11:02 +0000 Subject: Contextually converting to 'id' is not a useful operation. Contextually converting to an arbitrary Objective-C pointer type is. Without significantly re-implementing anything, change the API to reflect this, and as a minor optimization, strip the pointer conversion off before potentially building it. Mostly, this removes a really bizarre-looking bit of code from BuildInstanceMessage. llvm-svn: 139354 --- clang/lib/Sema/SemaExprObjC.cpp | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) (limited to 'clang/lib/Sema/SemaExprObjC.cpp') diff --git a/clang/lib/Sema/SemaExprObjC.cpp b/clang/lib/Sema/SemaExprObjC.cpp index f6ace99bf6c..f7f00f3f91b 100644 --- a/clang/lib/Sema/SemaExprObjC.cpp +++ b/clang/lib/Sema/SemaExprObjC.cpp @@ -1366,17 +1366,12 @@ ExprResult Sema::BuildInstanceMessage(Expr *Receiver, IsNull ? CK_NullToPointer : CK_IntegralToPointer).take(); } ReceiverType = Receiver->getType(); - } - else { + } else { ExprResult ReceiverRes; if (getLangOptions().CPlusPlus) - ReceiverRes = PerformContextuallyConvertToObjCId(Receiver); + ReceiverRes = PerformContextuallyConvertToObjCPointer(Receiver); if (ReceiverRes.isUsable()) { Receiver = ReceiverRes.take(); - if (ImplicitCastExpr *ICE = dyn_cast(Receiver)) { - Receiver = ICE->getSubExpr(); - ReceiverType = Receiver->getType(); - } return BuildInstanceMessage(Receiver, ReceiverType, SuperLoc, -- cgit v1.2.3