Home | History | Annotate | Download | only in Sema

Lines Matching defs:Owner

7263 static bool considerVariable(VarDecl *var, Expr *ref, RetainCycleOwner &owner) {
7270 owner.Variable = var;
7272 owner.setLocsFrom(ref);
7276 static bool findRetainCycleOwner(Sema &S, Expr *e, RetainCycleOwner &owner) {
7299 if (!findRetainCycleOwner(S, ref->getBase(), owner))
7302 if (ref->isFreeIvar()) owner.setLocsFrom(ref);
7303 owner.Indirect = true;
7310 return considerVariable(var, ref, owner);
7335 owner.Indirect = true;
7337 owner.Variable = S.getCurMethodDecl()->getSelfDecl();
7338 if (!owner.Variable)
7340 owner.Loc = pre->getLocation();
7341 owner.Range = pre->getSourceRange();
7409 static Expr *findCapturingExpr(Sema &S, Expr *e, RetainCycleOwner &owner) {
7410 assert(owner.Variable && owner.Loc.isValid());
7436 if (!block || !block->getBlockDecl()->capturesVariable(owner.Variable))
7439 FindCaptureVisitor visitor(S.Context, owner.Variable);
7445 RetainCycleOwner &owner) {
7447 assert(owner.Variable && owner.Loc.isValid());
7450 << owner.Variable << capturer->getSourceRange();
7451 S.Diag(owner.Loc, diag::note_arc_retain_cycle_owner)
7452 << owner.Indirect << owner.Range;
7484 RetainCycleOwner owner;
7486 if (!findRetainCycleOwner(*this, msg->getInstanceReceiver(), owner))
7490 owner.Variable = getCurMethodDecl()->getSelfDecl();
7491 owner.Loc = msg->getSuperLoc();
7492 owner.Range = msg->getSuperLoc();
7497 if (Expr *capturer = findCapturingExpr(*this, msg->getArg(i), owner))
7498 return diagnoseRetainCycle(*this, capturer, owner);
7503 RetainCycleOwner owner;
7504 if (!findRetainCycleOwner(*this, receiver, owner))
7507 if (Expr *capturer = findCapturingExpr(*this, argument, owner))
7508 diagnoseRetainCycle(*this, capturer, owner);
7512 RetainCycleOwner Owner;
7513 if (!considerVariable(Var, /*DeclRefExpr=*/nullptr, Owner))
7518 Owner.Loc = Var->getLocation();
7519 Owner.Range = Var->getSourceRange();
7521 if (Expr *Capturer = findCapturingExpr(*this, Init, Owner))
7522 diagnoseRetainCycle(*this, Capturer, Owner);