summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen/CGObjC.cpp
diff options
context:
space:
mode:
authorJohn McCall <rjmccall@apple.com>2015-09-09 23:37:17 +0000
committerJohn McCall <rjmccall@apple.com>2015-09-09 23:37:17 +0000
commit6380a28248f8b1a86f08a505027285c5dcc45b45 (patch)
tree12f51f4fa183a9f8b1d1c900b36b0ce7e6af92fc /clang/lib/CodeGen/CGObjC.cpp
parent15d5563cea9de5dbdca0bded0bceb2b56797591c (diff)
downloadbcm5719-llvm-6380a28248f8b1a86f08a505027285c5dcc45b45.tar.gz
bcm5719-llvm-6380a28248f8b1a86f08a505027285c5dcc45b45.zip
ARC: Fix the precise-lifetime suppression of returns_inner_pointer
receiver extension for message sends via property syntax. rdar://22172983 llvm-svn: 247209
Diffstat (limited to 'clang/lib/CodeGen/CGObjC.cpp')
-rw-r--r--clang/lib/CodeGen/CGObjC.cpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/clang/lib/CodeGen/CGObjC.cpp b/clang/lib/CodeGen/CGObjC.cpp
index 242b3d5a735..a0b92c99381 100644
--- a/clang/lib/CodeGen/CGObjC.cpp
+++ b/clang/lib/CodeGen/CGObjC.cpp
@@ -273,10 +273,23 @@ shouldExtendReceiverForInnerPointerMessage(const ObjCMessageExpr *message) {
// receiver is loaded from a variable with precise lifetime.
case ObjCMessageExpr::Instance: {
const Expr *receiver = message->getInstanceReceiver();
+
+ // Look through OVEs.
+ if (auto opaque = dyn_cast<OpaqueValueExpr>(receiver)) {
+ if (opaque->getSourceExpr())
+ receiver = opaque->getSourceExpr()->IgnoreParens();
+ }
+
const ImplicitCastExpr *ice = dyn_cast<ImplicitCastExpr>(receiver);
if (!ice || ice->getCastKind() != CK_LValueToRValue) return true;
receiver = ice->getSubExpr()->IgnoreParens();
+ // Look through OVEs.
+ if (auto opaque = dyn_cast<OpaqueValueExpr>(receiver)) {
+ if (opaque->getSourceExpr())
+ receiver = opaque->getSourceExpr()->IgnoreParens();
+ }
+
// Only __strong variables.
if (receiver->getType().getObjCLifetime() != Qualifiers::OCL_Strong)
return true;
OpenPOWER on IntegriCloud