Lines Matching refs:scope
12 // Calls to NSAutoreleasePools will be rewritten as an @autorelease scope.
23 // - There is not a corresponding -release/-drain in the same scope
25 // - There is a variable that is declared inside the intended @autorelease scope
97 PoolScope &scope = *scpI;
98 clearRefsIn(*scope.Begin, info.Refs);
99 clearRefsIn(*scope.End, info.Refs);
100 clearRefsIn(scope.Releases.begin(), scope.Releases.end(), info.Refs);
121 PoolScope &scope = *scpI;
122 clearUnavailableDiags(*scope.Begin);
123 clearUnavailableDiags(*scope.End);
124 if (scope.IsFollowedBySimpleReturnStmt) {
125 // Include the return in the scope.
126 Pass.TA.replaceStmt(*scope.Begin, "@autoreleasepool {");
127 Pass.TA.removeStmt(*scope.End);
128 Stmt::child_iterator retI = scope.End;
137 SourceRange(scope.getIndentedRange().getBegin(),
139 scope.CompoundParent->getLocStart());
141 Pass.TA.replaceStmt(*scope.Begin, "@autoreleasepool {");
142 Pass.TA.replaceStmt(*scope.End, "}");
143 Pass.TA.increaseIndentation(scope.getIndentedRange(),
144 scope.CompoundParent->getLocStart());
152 PoolScope &scope = *scpI;
154 relI = scope.Releases.begin(),
155 relE = scope.Releases.end(); relI != relE; ++relI) {
207 PoolScope &scope = Scopes.back();
208 scope.End = I;
209 handlePoolScope(scope, S);
253 NameReferenceChecker(ASTContext &ctx, PoolScope &scope,
258 ScopeRange = SourceRange((*scope.Begin)->getLocStart(),
259 (*scope.End)->getLocStart());
299 void handlePoolScope(PoolScope &scope, CompoundStmt *compoundS) {
300 // Check that all names declared inside the scope are not used
301 // outside the scope.
305 Stmt::child_iterator SI = scope.End, SE = compoundS->body_end();
307 // Check if the autoreleasepool scope is followed by a simple return
308 // statement, in which case we will include the return in the scope.
314 scope.IsFollowedBySimpleReturnStmt = true;
315 ++SI; // the return will be included in scope, don't check it.
319 nameUsedOutsideScope = !NameReferenceChecker(Pass.Ctx, scope,
327 // declared inside the pool scope are used outside of it.
331 "NSAutoreleasePool scope that it was declared in", referenceLoc);
333 Pass.TA.reportNote("intended @autoreleasepool scope begins here",
334 (*scope.Begin)->getLocStart());
335 Pass.TA.reportNote("intended @autoreleasepool scope ends here",
336 (*scope.End)->getLocStart());
343 ReleaseCollector releaseColl(scope.PoolVar, scope.Releases);
344 Stmt::child_iterator I = scope.Begin;
346 for (; I != scope.End; ++I)
350 PoolVars[scope.PoolVar].Scopes.push_back(scope);