Home | History | Annotate | Download | only in Sema

Lines Matching defs:Owner

5989 static bool considerVariable(VarDecl *var, Expr *ref, RetainCycleOwner &owner) {
5996 owner.Variable = var;
5998 owner.setLocsFrom(ref);
6002 static bool findRetainCycleOwner(Sema &S, Expr *e, RetainCycleOwner &owner) {
6025 if (!findRetainCycleOwner(S, ref->getBase(), owner))
6028 if (ref->isFreeIvar()) owner.setLocsFrom(ref);
6029 owner.Indirect = true;
6036 return considerVariable(var, ref, owner);
6061 owner.Indirect = true;
6063 owner.Variable = S.getCurMethodDecl()->getSelfDecl();
6064 if (!owner.Variable)
6066 owner.Loc = pre->getLocation();
6067 owner.Range = pre->getSourceRange();
6118 static Expr *findCapturingExpr(Sema &S, Expr *e, RetainCycleOwner &owner) {
6119 assert(owner.Variable && owner.Loc.isValid());
6145 if (!block || !block->getBlockDecl()->capturesVariable(owner.Variable))
6148 FindCaptureVisitor visitor(S.Context, owner.Variable);
6154 RetainCycleOwner &owner) {
6156 assert(owner.Variable && owner.Loc.isValid());
6159 << owner.Variable << capturer->getSourceRange();
6160 S.Diag(owner.Loc, diag::note_arc_retain_cycle_owner)
6161 << owner.Indirect << owner.Range;
6193 RetainCycleOwner owner;
6195 if (!findRetainCycleOwner(*this, msg->getInstanceReceiver(), owner))
6199 owner.Variable = getCurMethodDecl()->getSelfDecl();
6200 owner.Loc = msg->getSuperLoc();
6201 owner.Range = msg->getSuperLoc();
6206 if (Expr *capturer = findCapturingExpr(*this, msg->getArg(i), owner))
6207 return diagnoseRetainCycle(*this, capturer, owner);
6212 RetainCycleOwner owner;
6213 if (!findRetainCycleOwner(*this, receiver, owner))
6216 if (Expr *capturer = findCapturingExpr(*this, argument, owner))
6217 diagnoseRetainCycle(*this, capturer, owner);
6221 RetainCycleOwner Owner;
6222 if (!considerVariable(Var, /*DeclRefExpr=*/0, Owner))
6227 Owner.Loc = Var->getLocation();
6228 Owner.Range = Var->getSourceRange();
6230 if (Expr *Capturer = findCapturingExpr(*this, Init, Owner))
6231 diagnoseRetainCycle(*this, Capturer, Owner);