Lines Matching defs:Owner
8737 static bool considerVariable(VarDecl *var, Expr *ref, RetainCycleOwner &owner) {
8744 owner.Variable = var;
8746 owner.setLocsFrom(ref);
8750 static bool findRetainCycleOwner(Sema &S, Expr *e, RetainCycleOwner &owner) {
8773 if (!findRetainCycleOwner(S, ref->getBase(), owner))
8776 if (ref->isFreeIvar()) owner.setLocsFrom(ref);
8777 owner.Indirect = true;
8784 return considerVariable(var, ref, owner);
8809 owner.Indirect = true;
8811 owner.Variable = S.getCurMethodDecl()->getSelfDecl();
8812 if (!owner.Variable)
8814 owner.Loc = pre->getLocation();
8815 owner.Range = pre->getSourceRange();
8883 static Expr *findCapturingExpr(Sema &S, Expr *e, RetainCycleOwner &owner) {
8884 assert(owner.Variable && owner.Loc.isValid());
8910 if (!block || !block->getBlockDecl()->capturesVariable(owner.Variable))
8913 FindCaptureVisitor visitor(S.Context, owner.Variable);
8919 RetainCycleOwner &owner) {
8921 assert(owner.Variable && owner.Loc.isValid());
8924 << owner.Variable << capturer->getSourceRange();
8925 S.Diag(owner.Loc, diag::note_arc_retain_cycle_owner)
8926 << owner.Indirect << owner.Range;
9125 RetainCycleOwner owner;
9127 if (!findRetainCycleOwner(*this, msg->getInstanceReceiver(), owner))
9131 owner.Variable = getCurMethodDecl()->getSelfDecl();
9132 owner.Loc = msg->getSuperLoc();
9133 owner.Range = msg->getSuperLoc();
9138 if (Expr *capturer = findCapturingExpr(*this, msg->getArg(i), owner))
9139 return diagnoseRetainCycle(*this, capturer, owner);
9144 RetainCycleOwner owner;
9145 if (!findRetainCycleOwner(*this, receiver, owner))
9148 if (Expr *capturer = findCapturingExpr(*this, argument, owner))
9149 diagnoseRetainCycle(*this, capturer, owner);
9153 RetainCycleOwner Owner;
9154 if (!considerVariable(Var, /*DeclRefExpr=*/nullptr, Owner))
9159 Owner.Loc = Var->getLocation();
9160 Owner.Range = Var->getSourceRange();
9162 if (Expr *Capturer = findCapturingExpr(*this, Init, Owner))
9163 diagnoseRetainCycle(*this, Capturer, Owner);