diff options
author | John McCall <rjmccall@apple.com> | 2011-09-09 06:11:02 +0000 |
---|---|---|
committer | John McCall <rjmccall@apple.com> | 2011-09-09 06:11:02 +0000 |
commit | fec112d50e801ea624900de5efd4bfd210ce53a4 (patch) | |
tree | 182c98337b131ea1a16e11604180d1e8b5a53ee2 /clang/lib/Sema/SemaExprObjC.cpp | |
parent | 5d5134014f5d3fb75541c16efb7b34b164b30012 (diff) | |
download | bcm5719-llvm-fec112d50e801ea624900de5efd4bfd210ce53a4.tar.gz bcm5719-llvm-fec112d50e801ea624900de5efd4bfd210ce53a4.zip |
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
Diffstat (limited to 'clang/lib/Sema/SemaExprObjC.cpp')
-rw-r--r-- | clang/lib/Sema/SemaExprObjC.cpp | 9 |
1 files changed, 2 insertions, 7 deletions
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<ImplicitCastExpr>(Receiver)) { - Receiver = ICE->getSubExpr(); - ReceiverType = Receiver->getType(); - } return BuildInstanceMessage(Receiver, ReceiverType, SuperLoc, |